Jump to content
Sign in to follow this  
keshari

Frustating problem related to java webservice

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...