Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Exception on Papyrus JUnit tests( ...error occurred... activating bundle org.eclipse.papyrus.infra.ui.emf)
Exception on Papyrus JUnit tests [message #1852165] Tue, 03 May 2022 08:52 Go to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Hello community,

I'm having some problems with Papyrus JUnit tests.
This is the simple test I run:
@Headless
public class TestBasic extends AbstractPapyrusTest {
	
	@Rule
	public final ModelSetFixture modelSet = new ModelSetFixture();
	
	@Test
	public void basicTest() throws Exception {		
	}	
}


This is the exception thrown:
!ENTRY org.eclipse.osgi 4 0 2022-05-03 10:39:08.886
!MESSAGE An error occurred while automatically activating bundle org.eclipse.papyrus.infra.ui.emf (954).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.papyrus.infra.ui.internal.emf.Activator.start() of bundle org.eclipse.papyrus.infra.ui.emf.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:835)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:763)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1012)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:366)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:506)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:572)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:401)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:480)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:617)
	at org.eclipse.papyrus.infra.emf.readonly.ReadOnlyManager.<clinit>(ReadOnlyManager.java:123)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.dispose(PapyrusROTransactionalEditingDomain.java:251)
	at org.eclipse.papyrus.infra.core.resource.ModelSet.unload(ModelSet.java:1029)
	at org.eclipse.papyrus.infra.core.services.ModelSetServiceAdapter.disposeService(ModelSetServiceAdapter.java:106)
	at org.eclipse.papyrus.infra.core.services.internal.ServiceAdapterEntry.disposeService(ServiceAdapterEntry.java:60)
	at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.disposeService(StartStartupEntry.java:93)
	at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeServices(ServicesRegistry.java:1046)
	at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeRegistry(ServicesRegistry.java:907)
	at org.eclipse.papyrus.junit.utils.rules.ModelSetFixture.finished(ModelSetFixture.java:83)
	at org.junit.rules.TestWatcher.finishedQuietly(TestWatcher.java:122)
	at org.junit.rules.TestWatcher.access$400(TestWatcher.java:52)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:70)
	at org.eclipse.papyrus.junit.utils.rules.ProjectFixture$1.evaluate(ProjectFixture.java:238)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner.access$0(ClassificationRunner.java:1)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner$1.runChild(ClassificationRunner.java:58)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunnerImpl.runChild(ClassificationRunnerImpl.java:87)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner.runChild(ClassificationRunner.java:86)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:768)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:117)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.start(CoreTestApplication.java:28)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
Caused by: java.lang.ExceptionInInitializerError
	at org.eclipse.papyrus.infra.ui.internal.emf.Activator.start(Activator.java:71)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:814)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	... 63 more
Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
	at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:102)
	at org.eclipse.papyrus.infra.ui.util.EditorHelper.getActiveWindow(EditorHelper.java:61)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.registerPapyrusEditorListener(ArchitectureFrameworkCustomizationManagerUpdater.java:103)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.<init>(ArchitectureFrameworkCustomizationManagerUpdater.java:94)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.<clinit>(ArchitectureFrameworkCustomizationManagerUpdater.java:74)
	... 68 more
Root exception:
java.lang.ExceptionInInitializerError
	at org.eclipse.papyrus.infra.ui.internal.emf.Activator.start(Activator.java:71)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:814)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:763)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1012)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:366)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:506)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:572)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:401)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:480)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:617)
	at org.eclipse.papyrus.infra.emf.readonly.ReadOnlyManager.<clinit>(ReadOnlyManager.java:123)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.dispose(PapyrusROTransactionalEditingDomain.java:251)
	at org.eclipse.papyrus.infra.core.resource.ModelSet.unload(ModelSet.java:1029)
	at org.eclipse.papyrus.infra.core.services.ModelSetServiceAdapter.disposeService(ModelSetServiceAdapter.java:106)
	at org.eclipse.papyrus.infra.core.services.internal.ServiceAdapterEntry.disposeService(ServiceAdapterEntry.java:60)
	at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.disposeService(StartStartupEntry.java:93)
	at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeServices(ServicesRegistry.java:1046)
	at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeRegistry(ServicesRegistry.java:907)
	at org.eclipse.papyrus.junit.utils.rules.ModelSetFixture.finished(ModelSetFixture.java:83)
	at org.junit.rules.TestWatcher.finishedQuietly(TestWatcher.java:122)
	at org.junit.rules.TestWatcher.access$400(TestWatcher.java:52)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:70)
	at org.eclipse.papyrus.junit.utils.rules.ProjectFixture$1.evaluate(ProjectFixture.java:238)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner.access$0(ClassificationRunner.java:1)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner$1.runChild(ClassificationRunner.java:58)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunnerImpl.runChild(ClassificationRunnerImpl.java:87)
	at org.eclipse.papyrus.junit.framework.classification.ClassificationRunner.runChild(ClassificationRunner.java:86)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:768)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:117)
	at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.start(CoreTestApplication.java:28)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
	at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:102)
	at org.eclipse.papyrus.infra.ui.util.EditorHelper.getActiveWindow(EditorHelper.java:61)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.registerPapyrusEditorListener(ArchitectureFrameworkCustomizationManagerUpdater.java:103)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.<init>(ArchitectureFrameworkCustomizationManagerUpdater.java:94)
	at org.eclipse.papyrus.infra.ui.emf.internal.facet.ArchitectureFrameworkCustomizationManagerUpdater.<clinit>(ArchitectureFrameworkCustomizationManagerUpdater.java:74)
	... 68 more


Any ideas?

Many thanks,
Alberto
Re: Exception on Papyrus JUnit tests [message #1852511 is a reply to message #1852165] Thu, 19 May 2022 12:20 Go to previous messageGo to next message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 264
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hi Alberto,
I think the ModelSetFixture can't work with Headless, but not sure.

/Vincent
Re: Exception on Papyrus JUnit tests [message #1852512 is a reply to message #1852511] Thu, 19 May 2022 12:48 Go to previous messageGo to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
It worked for the Papyrus version supported by Eclipse Neon.

Let me add that the JUnit test works also for the latest version of Papyrus The difference is that, in this case, the BundleException appears.
Re: Exception on Papyrus JUnit tests [message #1852588 is a reply to message #1852512] Wed, 25 May 2022 12:08 Go to previous message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Any ideas?
Previous Topic:parser Sysml1.6
Next Topic:How to inherit attributes in class/block diagram using Eclipse Papyrus?
Goto Forum:
  


Current Time: Wed Sep 25 00:14:44 GMT 2024

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

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

Back to the top