Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot test fails when creating xtext resource
SWTBot test fails when creating xtext resource [message #1809856] Wed, 24 July 2019 23:06 Go to next message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 100
Registered: August 2017
Senior Member
I am using SWTBot to test a custom Eclipse application. The SWTBot test run configuration is set to launch this application. When creating an xtext file within the SWTBot test, the following exception is thrown. The root of the problem seems to be a class not found error. This does not happen when the application is normally run, it only happens within an SWTBot test. Any help would be appreciated.

org.eclipse.emf.common.util.WrappedException: org.eclipse.core.runtime.CoreException: org/eclipse/xtext/ui/shared/SharedStateModule (occurred in gov.nasa.arc.advocate.argument.dsl.ui.ArgumentExecutableExtensionFactory)
at org.eclipse.emf.ecore.plugin.RegistryReader$PluginClassDescriptor.createInstance(RegistryReader.java:171)
at org.eclipse.emf.ecore.plugin.RegistryReader$ResourceFactoryDescriptor.createFactory(RegistryReader.java:189)
at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.convert(ResourceFactoryRegistryImpl.java:92)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$2.delegatedGetFactory(ResourceSetImpl.java:458)
at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.getFactory(ResourceFactoryRegistryImpl.java:144)
at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.getFactory(ResourceFactoryRegistryImpl.java:85)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:431)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:423)
at gov.nasa.arc.advocate.common.ui.wizards.AbstractAdvocateFileWizard.initSemanticModel(AbstractAdvocateFileWizard.java:174)
at gov.nasa.arc.advocate.common.ui.wizards.AbstractAdvocateFileWizard.performFinish(AbstractAdvocateFileWizard.java:221)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:778)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:417)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:269)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:290)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:151)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at gov.nasa.arc.advocate.branding.application.AdvocateApplication.start(AdvocateApplication.java:529)
at org.eclipse.swtbot.eclipse.core.UITestApplication.start(UITestApplication.java:57)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: org.eclipse.core.runtime.CoreException: org/eclipse/xtext/ui/shared/SharedStateModule (occurred in gov.nasa.arc.advocate.argument.dsl.ui.ArgumentExecutableExtensionFactory)
at org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory.handleCreationError(AbstractGuiceAwareExecutableExtensionFactory.java:96)
at org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory.create(AbstractGuiceAwareExecutableExtensionFactory.java:64)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:262)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.emf.ecore.plugin.RegistryReader$PluginClassDescriptor.createInstance(RegistryReader.java:167)
... 69 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/xtext/ui/shared/SharedStateModule
at gov.nasa.arc.advocate.argument.dsl.ui.internal.DslActivator.getSharedStateModule(DslActivator.java:90)
at gov.nasa.arc.advocate.argument.dsl.ui.internal.DslActivator.createInjector(DslActivator.java:64)
at gov.nasa.arc.advocate.argument.dsl.ui.internal.DslActivator.getInjector(DslActivator.java:55)
at gov.nasa.arc.advocate.argument.dsl.ui.ArgumentExecutableExtensionFactory.getInjector(ArgumentExecutableExtensionFactory.java:26)
at org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory.create(AbstractGuiceAwareExecutableExtensionFactory.java:53)
... 72 more
Re: SWTBot test fails when creating xtext resource [message #1809861 is a reply to message #1809856] Thu, 25 July 2019 02:50 Go to previous messageGo to next message
Eclipse UserFriend
IIRC NoClassDefFoundErrors happen because of a previous ClassNotFoundException or some other error during class-loading. Look further back and see if there's another problem reported?
Re: SWTBot test fails when creating xtext resource [message #1809933 is a reply to message #1809861] Thu, 25 July 2019 19:45 Go to previous messageGo to next message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 100
Registered: August 2017
Senior Member
Ok. I was curious too though how this could happen in the SWTBot test but not in the application. Shouldn't they basically be the same thing, as SWTBot runs the application?
Re: SWTBot test fails when creating xtext resource [message #1809988 is a reply to message #1809933] Sat, 27 July 2019 15:45 Go to previous message
Eclipse UserFriend
You haven't given us much context. From the last part of the stack trace, i the problem is arising from trying to load a CPA reference by an extension point. Can you show your extension point definition,? What do your full logs show? Was it working previously? If so, what changed? How are you launching the test? Are there any resolution errors reported?
Previous Topic:SWTBot tests not running the correct application
Next Topic:Test application with existing project data
Goto Forum:
  


Current Time: Thu Apr 25 17:16:34 GMT 2024

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

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

Back to the top