File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes NullPointer Exception by apache axis stub at client side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "NullPointer Exception by apache axis stub at client side" Watch "NullPointer Exception by apache axis stub at client side" New topic
Author

NullPointer Exception by apache axis stub at client side

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
Hi all,
I am using apache axis 1.3.My Problem is that when I send request to server,server receives the request but at client side I get NullPointer exception by the stub class.The response send by the server does not come to the client calling class but before that the stub class at the client generates a null pointer exception.

AxisFault
faultCode:{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultString:java.lang.NullPointerException

Please help

with regards,
ajse
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
The service successfully processed the request? No null exception was thrown in the server?
ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
Yes,you are correct.

The server has processed the request but at the client side,instead of response,i have got NullPointer Exception.

My client application is deployed on tomcat and I am starting the client side by clicking on an executable icon on the desktop.Is it a multiple jvm instance problem becouse,clicking on icon statrs a jvm and tomcat server has also a jvm associated with it,so the server might be sending the response to the client application which is deployed on tomcat and the other jvm instance is not receiving the response at all and throwing the exception.Please express your views.

with regards,
ajse
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41101
    
  45
Where is the exception thrown? That is to say: show us the full stack trace.


Ping & DNS - my free Android networking tools app
ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
Following is the stackTrace:
---------------------------------------------------------------------------------------------------------------------------
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:test1

java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
ationContext.java:1087)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
Context.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
tandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.set.ops.application.service.WebService
s.WebServicesSoapBindingStub.WebServices(Unknown Source)
at com.set.ops.application.DataReceiver.Registration(Unknown Source)
at com.set.ops.application.DataReceiver.main(Unknown Source)
ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
The exception is thrown on the client side instead of response.
ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
Hi all,
I have found out the solution.When Tomcat is running as a service at the server side ,I am getting NullPointerException on the client side.But if I start Tomcat manually through batch file(%TOMCAT_HOME%/bin/startup.bat),it is working fine.There is no exception on client side.

Can anybody tell me what is the difference between above two ways of starting tomcat.I will be thankful.

with regards,
ajse
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by ajse roy:
Can anybody tell me what is the difference between above two ways of starting tomcat.


The problem is probably less Tomcat and more the account that Tomcat is operating under when it runs as a service.
You should be able to configure the service to run under your account. If the problem goes away - then your job really starts - finding the significant difference(s) between your account and the service account. It could be the class path or other environment variables but more likely it's something to do with access rights and privileges (or the lack thereof).
Check the Tomcat logs directory it may contain some logs that could give you a clue about what is missing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointer Exception by apache axis stub at client side
 
Similar Threads
Axis and HTTPSender
Different ways of starting tomcat
Jax-RPC Vs SAAJ
SSLHandshakeException
WebServices - How it is working