axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier.Br...@vodafone-us.com
Subject Re: Method calls throwing NullPointer exception with beta-3
Date Fri, 19 Jul 2002 17:11:21 GMT

Helen,

A lot of things have changed from beta 2 to beta 3, so you can imagine
going from beta 1 to beta 3 !
This NullPointerException might come from one of the generated Object from
WSDL2Java (if you are using it).
To be compliant with the JavaBeans specification (who knows why ???), the
setXXX code has changed. It caused these NullPointerExceptions for me.
Basically,you have 2 setXXX methods, one taking an array and another one an
index and a value. Never call the second one if you have not called the
first one. The second method does not check if the array is null or not,
therefore throwing exceptions. Beta 1 and 2 were checking and initializing
the array for you.
A good workaround is to create an ArrayList object and then call the
toArray method when you are ready to call the setXXX

If you are not using objects generated by WSDL2Java, then the above
description does not apply to your case.

Olivier



                                                                                         
                                                
                    "Helen L Rehn"                                                       
                                                
                    <hlrehn@us.ibm       To:     axis-user@xml.apache.org             
                                                   
                    .com>                cc:                                          
                                                   
                                         Subject:     Method calls throwing NullPointer exception
with beta-3                             
                    07/19/2002                                                           
                                                
                    10:04 AM                                                             
                                                
                    Please respond                                                       
                                                
                    to axis-user                                                         
                                                
                                                                                         
                                                
                                                                                         
                                                




Hi,

I have a web service which was working fine with beta 1.  I've since been
trying to upgrade to beta 3, mainly to get proper support for arrays with
wrapped style (doc/literal messages).  Now, whenever I make a call on the
web service, I get the following exception on the server side:

[7/19/02 13:00:42:942 EDT]   6eba19 SystemOut     U - Exception:
AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.userException
 faultString: java.lang.NullPointerException
 faultActor: null
 faultDetail:
        stackTrace: java.lang.NullPointerException
        at
org.apache.axis.description.OperationDesc.getParamByQName(OperationDe
sc.java:268)
        at
org.apache.axis.description.OperationDesc.getInputParamByQName(Operat
ionDesc.java:279)
        at
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:181)
        at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Dese
rializationContextImpl.java:857)
        at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:199)
        at
org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:644)
        at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:201)
        at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:259)
        at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider
.java:161)
        at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
289)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:312)
        at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:57
7)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(Servlet
Manager.java:827)
        at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictL
ifecycleServlet.java:167)
        at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycl
eServlet.java:297)
        at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLi
fecycleServlet.java:110)
        at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.
java:472)
        at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(Ser
vletManager.java:1012)
        at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Servl
etManager.java:913)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDis
patch(Unknown Source)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Unknow
n Source)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(Unknown
 Source)
        at
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java
:91)
        at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppI
nvoker.java:184)
        at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:67)
        at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Serv
letRequestProcessor.java:122)
        at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEL
istener.java:315)
        at
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnec
tion.java:60)
        at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja
va:323)
        at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
        at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)


java.lang.NullPointerException
java.lang.NullPointerException
        at
org.apache.axis.description.OperationDesc.getParamByQName(OperationDe
sc.java:268)
        at
org.apache.axis.description.OperationDesc.getInputParamByQName(Operat
ionDesc.java:279)
        at
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:181)
        at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Dese
rializationContextImpl.java:857)
        at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:199)
        at
org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:644)
        at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:201)
        at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:259)
        at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider
.java:161)
        at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
289)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:312)
        at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:57
7)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(Servlet
Manager.java:827)
        at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictL
ifecycleServlet.java:167)
        at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycl
eServlet.java:297)
        at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLi
fecycleServlet.java:110)
        at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.
java:472)
        at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(Ser
vletManager.java:1012)
        at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Servl
etManager.java:913)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDis
patch(Unknown Source)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Unknow
n Source)
        at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(Unknown
 Source)
        at
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java
:91)
        at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppI
nvoker.java:184)
        at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:67)
        at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Serv
letRequestProcessor.java:122)
        at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEL
istener.java:315)
        at
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnec
tion.java:60)
        at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja
va:323)
        at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
        at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

What could be causing this exception?

Thanks,
Nell

Helen (Nell) L. Rehn
Extreme Blue Intern
919-254-6251 (office)
Helen L Rehn/Durham/IBM
hlrehn@us.ibm.com





Mime
View raw message