Jump to content

Frustating problem related to java webservice


keshari

Recommended Posts

Hey AllMe getting a frustating problem while making the webservice using Eclipse, jdk1.6.0_03,and Tomcat-5.0.The overall scenario is like this.There is a class “WsEpp” of which I have to make webservice.”WsEpp” class is using the object of another class “EppService”, and if certain conditions will be fullfill then “EppService” class will use the object of another class “PrintClass”,which is allready using the object of class “PrintLib”.“PrintLib” class is a long file and its using many classes which are in supported jar files.Here is the some part of “PrintLib” where I am facing the problem, Scenario-1 public epp_Command command_data = new epp_Command(); public PrintLib() { System.out.println("CONSTRUCTOR 1"); this.command_data = new epp_Command(); System.out.println("CONSTRUCTOR 2"); }Here I am using the constructor of the “PrintLib” and “epp_Command” is included into jar files.When “WsEpp” is running as web service then <faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.reflect.InvocationTargetException</faultstring>occurs as the response of webservice.Scenario-2//public epp_Command command_data = new epp_Command(); public PrintLib() { System.out.println("CONSTRUCTOR 1"); // this.command_data = new epp_Command(); System.out.println("CONSTRUCTOR 2"); }When I am commenting the lines as shown in scenarion-2,then the service is running well and printing CONSTRUCTOR 1 and CONSTRUCTOR 2 as given in println command.And response of webservice gives the desired result.Scenario-3 public epp_Command command_data = null; public PrintLib() { System.out.println("CONSTRUCTOR 1"); this.command_data = new epp_Command(); System.out.println("CONSTRUCTOR 2"); }By using scenarion-3 the service is running and printing only CONSTRUCTOR 1 as given in println command.And also <faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.reflect.InvocationTargetException</faultstring>occurs as the response of webservice.I am suffering with this problem from last 2 weeks.Kindally help me and provide me the some suggestions and tips.In case of any more requirement I can provid ethe whole codes.

Link to comment
Share on other sites

According to this blog - http://www.jroller.com/sjivan/entry/things...hould_know_when - the InvocationTargetException is a wrapper class that wraps an underlying exception in the invoked method or constructor. He mentions a bug:

Unfortunately from the very early days of Java, reflection based methods result in InvocationTargetException's wrapping not only java.lang.Exception's from the execution, but also wrapping java.lang.Error's.
So, you might read that blog and take his advice in trying to determine what the underlying Exception (or Error) is. It may be something as simple as a missing environment variable or something.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...