• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Axis Web Service Client : NullPointerException

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have written a very simple web service on my local machine. Am using Tomcat w/Apache Axis to implement the same. I coded a very simple *.jws file in the Tomcat webapp directory. The file has two very simple public methods. With Tomcat & Axis, I was able to see the wsdl of the web service on my browser. That said, I started with the client. I generated the stub classes & interfaces (2 each) using the WSDL2Java tool and moved those generated classes in my workspace. Once done, I tried to run my client from the command line (Actually, I am using Eclipse IDE). The client is able to locate the service but throws a NullPointerException on the Call.Invoke method. ( I see this in the Stacktrace). I checked the Apache Axis docs for troubleshooting and found that it might be the Validation library (Crimson, by default) or the fact that the client and server are both on local server. I downloaded Xerces and referenced it in my project. I just do not understand why there is an issue with the client and the server being on the same local host. Does this mean that if the web service is on a remote machine, I wont run into this issue? Please help.

Thanks.

- Himanshu
PS> I am using the first example from the 'Real web services' book and having this issue.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the snippet of your error details. Also try to use some tcpip sniffers like Apache SOAPTCPMonitor from Axis or TCP/IP Trace from also www.pocketsoap.com, this will tell what messages sent btwn client and server and where exactly the error occurs.
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I am exactly getting the same NPE error. Below is the stack trace. I am just not able to identify the problem. Since it was throwing parse errors, I did give a reference to the xml parsers.

However, I am able to bind to the service but not able to call the webservice method. I have been trying to resolve this for 2 days now. Thanks !

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mentioned that you run your client in your workspace. You might have some jar files which contain older versions of some classes which axis uses now. For example, I encounter a similar problem because my workspace contains jaxm.jar(from 2003) which has the same set of classes as saaj.jar which comes with axis. As soon as I removed the jaxm.jar, everything runs fine. I even wrote a utility myself to inspect jar files under a directry and list which classes apear in more than one jar files.
 
mooooooo ..... tiny ad ....
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic