Bug 995534 - Creating Service Test via tooling fails with NPE when project not yet built
Creating Service Test via tooling fails with NPE when project not yet built
Status: CLOSED CURRENTRELEASE
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard Editor (Show other bugs)
6.0.0 GA
Unspecified Unspecified
unspecified Severity unspecified
: ER3
: ---
Assigned To: Rob Cernich
lvaskova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-09 12:20 EDT by Brian Fitzpatrick
Modified: 2014-06-16 19:51 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker SWITCHYARD-1639 Major Closed Creating Service Test via tooling fails with NPE when project not yet built 2014-06-16 19:51:02 EDT

  None (edit)
Description Brian Fitzpatrick 2013-08-09 12:20:42 EDT
Description of problem:
While testing quickstarts I discovered that the Create Service Test Class menu option fails with a NPE if a) the project hasn't been built yet or b) "Build Automatically" is turned off.

Version-Release number of selected component (if applicable):


How reproducible:
Every time

Steps to Reproduce:
1. Turn off "Build Automatically" (Project->Build Automatically)
2. Create a new SY project with a testable composite service
3. Right-click on the composite service and select "New Service Test Class" from popup menu (not available on button pad)
4. Click Finish

Actual results:
[1]
!ENTRY org.switchyard.tools.ui 4 0 2013-08-08 15:24:56.526
!MESSAGE Error resolving service interface.
!STACK 0
java.lang.NullPointerException
       at org.switchyard.extensions.java.JavaService.fromClass(JavaService.java:78)
       at org.switchyard.tools.ui.SwitchYardModelUtils.getServiceInterface(SwitchYardModelUtils.java:246)
       at org.switchyard.tools.ui.wizards.NewServiceTestClassWizardPage.resolveServiceType(NewServiceTestClassWizardPage.java:702)
       at org.switchyard.tools.ui.wizards.NewServiceTestClassWizardPage.createTypeMembers(NewServiceTestClassWizardPage.java:336)
       at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createType(NewTypeWizardPage.java:2207)
       at org.switchyard.tools.ui.operations.CreateServiceTestOperation.execute(CreateServiceTestOperation.java:53)
       at org.switchyard.tools.ui.operations.AbstractSwitchYardProjectOperation.run(AbstractSwitchYardProjectOperation.java:117)
       at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
       at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2327)
       at org.switchyard.tools.ui.wizards.NewServiceTestClassWizard$1.run(NewServiceTestClassWizard.java:73)
       at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Expected results:
No error. Generated test class.

Additional info:
Comment 2 JBoss JIRA Server 2013-08-19 10:53:40 EDT
Brian Fitzpatrick <bfitzpat@redhat.com> made a comment on jira SWITCHYARD-1639

This may actually be resolved by the work done in SWITCHYARD-1654. Doing some checking now. Same area affected in SY Model Utils I believe.
Comment 3 JBoss JIRA Server 2013-08-19 11:07:34 EDT
Brian Fitzpatrick <bfitzpat@redhat.com> made a comment on jira SWITCHYARD-1639

Looks like that's the case. But now we're seeing a different issue when testing against the camel-mail-binding quickstart whether it's built or not built:

{code}
!ENTRY org.eclipse.graphiti.ui 4 0 2013-08-19 09:01:05.487
!MESSAGE GFCommandStack.execute(Command) java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:319)
	at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(AdapterManager.java:356)
	at org.switchyard.tools.ui.editor.diagram.CreateServiceTestCustomFeature.getResourceForInterface(CreateServiceTestCustomFeature.java:96)
	at org.switchyard.tools.ui.editor.diagram.CreateServiceTestCustomFeature.execute(CreateServiceTestCustomFeature.java:90)
	at org.eclipse.graphiti.features.custom.AbstractCustomFeature.execute(AbstractCustomFeature.java:83)
	at org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext.execute(GenericFeatureCommandWithContext.java:64)
	at org.eclipse.graphiti.internal.command.CommandContainer.execute(CommandContainer.java:81)
	at org.eclipse.graphiti.ui.internal.command.GefCommandWrapper.execute(GefCommandWrapper.java:51)
	at org.eclipse.graphiti.ui.internal.editor.EmfOnGefCommand.execute(EmfOnGefCommand.java:54)
	at org.eclipse.graphiti.internal.command.GFPreparableCommand2.doExecute(GFPreparableCommand2.java:37)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:84)
	at org.eclipse.graphiti.ui.internal.editor.GFCommandStack.execute(GFCommandStack.java:138)
	at org.eclipse.graphiti.ui.internal.action.CustomAction.executeOnCommandStack(CustomAction.java:65)
	at org.eclipse.graphiti.ui.internal.action.CustomAction.run(CustomAction.java:60)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	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:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
{code}
Comment 4 Rob Cernich 2013-08-26 15:28:28 EDT
The second issue was because the new test wizard did not accommodate inherited interfaces on composite service/references.  In addition to cleaning up the NPE, we will also try to resolve the inherited interface (i.e. the one defined on the promoted service/reference).
Comment 5 JBoss JIRA Server 2013-08-27 11:31:02 EDT
Keith Babo <kbabo@redhat.com> made a comment on jira SWITCHYARD-1639

pushed
Comment 9 JBoss JIRA Server 2014-06-16 19:51:04 EDT
Keith Babo <kbabo@redhat.com> updated the status of jira SWITCHYARD-1639 to Closed

Note You need to log in before you can comment on or make changes to this bug.