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:
Joined: May 18, 2011
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.
subject: Web Service Client in Tomcat servlet: NullPointerException @ Service.getPort()