aspose file tools*
The moose likes Web Services and the fly likes Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort()" Watch "Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort()" New topic
Author

Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort()

Nick Abousselam
Greenhorn

Joined: May 18, 2011
Posts: 2
Hi,

I am publishing a web service in Ubuntu 10.10 with the Sun Java 6 JRE in my own web service publisher class (no application server).
I can successfully call the methods in this service when I create a standard java class to use the service.

When I attempt to call the methods of the service in a Servlet in Tomcat (running on the same server) I get a NullPointerException. The client I
created in this servlet is almost identical to my test client class which works fine. Tomcat is using the same JRE as the test client.

The exception occurs in this code at the service.getPort() line (line 12):



I have the Publisher, implementation bean and server interface source files if it would help to see them.
Here is the stack trace received through the browser when I access the servlet:

Nick Abousselam
Greenhorn

Joined: May 18, 2011
Posts: 2
Ok found out the problem,
I realised I had been compiling all my classes using OpenJDK in Eclipse, (under Window>Preferences>Java>Installed JRE's I have java-6-openjdk). Switched this to Sun, ran everything again and it all seems to be working fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort()