• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic