This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 102826 - call web service operation in servlet throws NPE
Summary: call web service operation in servlet throws NPE
Status: RESOLVED DUPLICATE of bug 102202
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@webservices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-27 20:27 UTC by tamiro
Modified: 2007-04-30 14:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tamiro 2007-04-27 20:27:34 UTC
After creating the simple WSIT tutorial-like calculator 
app, and a client, attempting to reference an operation 
provided by the service from a client servlet results 
in an NPE. 
Steps to repro
1. Create Web->Application
2. Add Web Service
3. In java source, right click Web Service -> Add operation 
   and create an operation named "add" that adds two ints
4. Create client Web -> Application
5. Add Web Service client that refernces the service WSDL
6. Add servlet
7. In servlet, right click and select Web Service Client Resources ->
   Call Web Service Operation and select the "add" operation 
   in the GUI tree displayed

At this point a Warning pops up:
org.netbeans.modules.java.source.query.QueryException

It seems that due to this error, the servlet code does not 
get the entries 

      @WebServiceRef(wsdlLocation =
"http://localhost:8080/CalcApp/CalcAppWSService?wsdl")
    private org.me.calc.client.CalcAppWSService service;

As a result, the following generated code has a compilation error: 
symbol service not found
 
try { // Call Web Service Operation
            org.me.calc.client.CalcAppWS port = service.getCalcAppWSPort();
            // TODO initialize WS operation arguments here
            int i = 2;
            int j = 2;

This is a regression from NB 5.5.1
Comment 1 Jaroslav Pospisil 2007-04-30 11:11:48 UTC
I can't reproduce the exception and missing @WebServiceRef section is
reproducible only when I invoke Call Web Service Operation in code before this
line inside processRequest method:

"PrintWriter out = response.getWriter();"

If I invoke Call.. under this line,everything is correct.

Also,when annotation isn't generated automatically,it could be added manually,so
I suppose this could be even P3 and not P2.
Comment 2 Andrey Yamkovoy 2007-04-30 11:43:18 UTC
This issue is reproducyble independently of the line I invoke Call WS Operation.
I check it on several PCs and it's 100% reproducible.

I agree that @WebServiceRef could be added manually but I think this isuue is P2
as minimum (even maybe P1).
Comment 3 Lukas Jungmann 2007-04-30 11:50:07 UTC
Can you please check whether this is a dup of issue 102202 or issue 101395? If
not then attach your stacktrace here, please.
Comment 4 tamiro 2007-04-30 14:23:18 UTC
I checked and Yes this appears to be a duplicate of 
102202

I get the same stack dump
WARNING [global]: java.lang.NullPointerException
java.lang.NullPointerException
	at
org.netbeans.modules.java.source.save.CasualDiff.isCommaSeparated(CasualDiff.java:2519)
	at
org.netbeans.modules.java.source.save.CasualDiff.filterHidden(CasualDiff.java:1759)
	at
org.netbeans.modules.java.source.save.CasualDiff.diffClassDef(CasualDiff.java:310)
	at org.netbeans.modules.java.source.save.CasualDiff.diffTree(CasualDiff.java:2101)
	at
org.netbeans.modules.java.source.save.CasualDiff.diffListImports(CasualDiff.java:1864)
	at
org.netbeans.modules.java.source.save.CasualDiff.diffTopLevel(CasualDiff.java:135)
	at org.netbeans.modules.java.source.save.CasualDiff.diffTree(CasualDiff.java:2095)
	at org.netbeans.modules.java.source.save.CasualDiff.diff(CasualDiff.java:87)
	at org.netbeans.modules.java.source.save.Commit.commit(Commit.java:194)
	at
org.netbeans.modules.java.source.save.Commit.visitCompilationUnit(Commit.java:146)
Caused: QueryException
	at org.netbeans.modules.java.source.query.Query.error(Query.java:117)
	at
org.netbeans.modules.java.source.save.Commit.visitCompilationUnit(Commit.java:154)
	at
org.netbeans.modules.java.source.save.Commit.visitCompilationUnit(Commit.java:53)
	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:476)
	at org.netbeans.modules.java.source.engine.RootTree.accept(RootTree.java:60)
	at org.netbeans.modules.java.source.query.Query.apply(Query.java:95)
	at org.netbeans.modules.java.source.save.Commit.commit(Commit.java:94)
[catch] at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:201)


*** This issue has been marked as a duplicate of 102202 ***