Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 225625

Summary: Error moving resource: null after cancelling file overwrite dialog
Product: [WebTools] WTP Webservices Reporter: Kathy Chan <kathy>
Component: jst.wsAssignee: Peter Moogk <pmoogk>
Status: CLOSED FIXED QA Contact: Kathy Chan <kathy>
Severity: normal    
Priority: P3 CC: hjzhang, neil.hauge
Version: 3.0Flags: kathy: pmc_approved? (david_williams)
kathy: pmc_approved? (raghunathan.srinivasan)
kathy: pmc_approved? (naci.dai)
kathy: pmc_approved? (deboer)
neil.hauge: pmc_approved+
kathy: pmc_approved? (kaloyan)
Target Milestone: 3.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_APPROVED
Attachments:
Description Flags
Patch for this defect. none

Description Kathy Chan CLA 2008-04-03 14:52:29 EDT
I used the 03/29 WTP 3.0 driver with a new workspace and did the following:

1. Create a bottom-up Java Web service using the Web Service wizard with the converter bean.  
2. Select the converter.wsdl file in WebContent/wsdl, right-click and select Web Services -> Generate client to bringing up the Web Service client wizard to create client.
3. Click Finish resulted in the File overwrite screen shot (as in attachment 94762 [details]).

So I verify that the File overwrite dialog will be up by default.  If you cancel (rather than answering Yes or Yes to all), then the converter.java file will not be updated.  There is an error dialog that comes up after you hit Cancel.
 
IWAB0523E Error moving resource: null
    java.lang.NullPointerException
    at org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand.moveGeneratedFiles(WSDL2JavaCommand.java:304)
    at org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand.execute(WSDL2JavaCommand.java:222)
    at org.eclipse.jst.ws.internal.axis.consumption.ui.task.ClientCodeGenOperation$ClientWSModifyOperation.execute(ClientCodeGenOperation.java:99)
    at org.eclipse.jst.ws.internal.axis.consumption.ui.task.ClientCodeGenOperation.execute(ClientCodeGenOperation.java:61)
    at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)
Comment 1 Kathy Chan CLA 2008-05-01 12:43:05 EDT
Peter, 

Please take a look at this RC1 candidate.
Comment 2 Peter Moogk CLA 2008-05-06 14:34:10 EDT
Created attachment 98908 [details]
Patch for this defect.
Comment 3 Peter Moogk CLA 2008-05-06 16:02:38 EDT
Problem description: 
this defect occurs in a top down scenario.  For this problem occur the scenario needs to be run twice.  The first time through will create all the artifacts required for this TD scenario.  On the second time through the user will be prompted if they want to overwrite a particular artifact.  If the user selects cancel so that the file is not overwritten, a null point exception is thrown.

Workaround:
The user need to always overwrite the artifacts that are generated.

Patch:
The code fix was relatively simple.  Just needed to put in a null pointer check.

Testing:
I went through the TD scenario with a new project.  The scenario continued to work fine.  I then went through it a second time and selected cancel when prompted to overwrite.  No exception was thrown and the scenario continued to test successfully as expected.

Review:
Kathy will review the patch for this defect.
Comment 4 Kathy Chan CLA 2008-05-06 23:50:45 EDT
Thanks for the patch, Peter!  Looks good.

PMC, please approve for WTP 3.0 RC1.
Comment 5 Neil Hauge CLA 2008-05-07 11:58:08 EDT
Approved based on risk of fix relative to the severity of the bug.
Comment 6 Kathy Chan CLA 2008-05-08 17:30:56 EDT
Patch committed and released to HEAD as v200805082126.
Comment 7 Kathy Chan CLA 2008-06-05 17:06:41 EDT
Verified on 05/23 WTP 3.0 driver.