Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » cannot run Junit plugin tests anymore
cannot run Junit plugin tests anymore [message #892500] Thu, 28 June 2012 13:19 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

today I downloaded the brand new eclipse xtext 2.3 distribution but I
can't seem to run junit plugin tests anymore (the ones using the ui
injector), I always get this exception

java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
initiated loading for a different type with name
"com/google/inject/Injector"

any clue please?

cheers
Lorenzo


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: cannot run Junit plugin tests anymore [message #892598 is a reply to message #892500] Thu, 28 June 2012 16:48 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 06/28/2012 03:19 PM, Lorenzo Bettini wrote:
> Hi
>
> today I downloaded the brand new eclipse xtext 2.3 distribution but I
> can't seem to run junit plugin tests anymore (the ones using the ui
> injector), I always get this exception
>
> java.lang.LinkageError: loader constraint violation: loader (instance of
> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
> initiated loading for a different type with name
> "com/google/inject/Injector"
>
> any clue please?

By the way, I can reproduce this problem also by modifying this test in
the domain model example and run it as a Junit plugin test:

package org.eclipse.xtext.example.domainmodel.tests

import org.eclipse.xtext.example.domainmodel.DomainmodelUiInjectorProvider
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(DomainmodelUiInjectorProvider))
class CompilerTest {

@Test
def void testGeneratedJava() {

}


}

and here's the trace

java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
initiated loading for a different type with name
"com/google/inject/Injector"
at org.eclipse.xtext.junit4.XtextRunner.createTest(XtextRunner.java:39)
at
org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
at org.eclipse.xtext.junit4.XtextRunner.methodBlock(XtextRunner.java:62)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
at
org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3529)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3182)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at
org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
at
org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:41)
at
org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)




--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: cannot run Junit plugin tests anymore [message #892640 is a reply to message #892598] Thu, 28 June 2012 22:11 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Lorenzo,

Do you have two different versions of com.google.inject on your class path?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 28.06.12 18:48, schrieb Lorenzo Bettini:
> On 06/28/2012 03:19 PM, Lorenzo Bettini wrote:
>> Hi
>>
>> today I downloaded the brand new eclipse xtext 2.3 distribution but I
>> can't seem to run junit plugin tests anymore (the ones using the ui
>> injector), I always get this exception
>>
>> java.lang.LinkageError: loader constraint violation: loader (instance of
>> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
>> initiated loading for a different type with name
>> "com/google/inject/Injector"
>>
>> any clue please?
>
> By the way, I can reproduce this problem also by modifying this test in
> the domain model example and run it as a Junit plugin test:
>
> package org.eclipse.xtext.example.domainmodel.tests
>
> import org.eclipse.xtext.example.domainmodel.DomainmodelUiInjectorProvider
> import org.eclipse.xtext.junit4.InjectWith
> import org.eclipse.xtext.junit4.XtextRunner
> import org.junit.Test
> import org.junit.runner.RunWith
>
> @RunWith(typeof(XtextRunner))
> @InjectWith(typeof(DomainmodelUiInjectorProvider))
> class CompilerTest {
>
> @Test
> def void testGeneratedJava() {
>
> }
>
>
> }
>
> and here's the trace
>
> java.lang.LinkageError: loader constraint violation: loader (instance of
> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously
> initiated loading for a different type with name
> "com/google/inject/Injector"
> at org.eclipse.xtext.junit4.XtextRunner.createTest(XtextRunner.java:39)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
>
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>
> at
> org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
>
> at org.eclipse.xtext.junit4.XtextRunner.methodBlock(XtextRunner.java:62)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
>
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
>
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
>
> at
> org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3529)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3182)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
>
> at
> org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runApp(NonUIThreadTestApplication.java:54)
>
> at
> org.eclipse.pde.internal.junit.runtime.UITestApplication.runApp(UITestApplication.java:41)
>
> at
> org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.start(NonUIThreadTestApplication.java:48)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
>
>
>
>
Re: cannot run Junit plugin tests anymore [message #892643 is a reply to message #892640] Thu, 28 June 2012 23:15 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 06/29/2012 12:11 AM, Sebastian Zarnekow wrote:
> Lorenzo,
>
> Do you have two different versions of com.google.inject on your class path?
>
> Regards,
> Sebastian

Hi Sebastian

I'll check that, but I know that I only have one version of
com.google.inject (I started with an xtext 2.3 distribution of Itemis,
but I also tried by starting from an eclipse-modeling-juno and
installing xtext from the composite site)... moreover I tried that with
a brand new domainmodel example (in a new workspace)...

you don't get this error by running this as a plugin junit test?

package org.eclipse.xtext.example.domainmodel.tests

import org.eclipse.xtext.example.domainmodel.DomainmodelUiInjectorProvider
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(DomainmodelUiInjectorProvider))
class CompilerTest {

@Test
def void testGeneratedJava() {

}


}

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: cannot run Junit plugin tests anymore [message #892739 is a reply to message #892643] Fri, 29 June 2012 12:16 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I filed a bug

https://bugs.eclipse.org/bugs/show_bug.cgi?id=383889

I can reproduce it both in windows and linux with the domainmodel example...

thanks
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Previous Topic:generating classes for evaluating Xbase expressions in Xtext?
Next Topic:mwe2 with resources from different projects
Goto Forum:
  


Current Time: Wed Feb 19 22:00:12 GMT 2020

Powered by FUDForum. Page generated in 0.02741 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top