Link to home
Start Free TrialLog in
Avatar of mrnmrn
mrnmrn

asked on

calling a class,method in a jar file from web service created with eclipse toolkit

All,
I'm a newbie to web services and have a question that I hope you can help me with.

My question is as follows.

I get the following exception when I try ro run a method ( returnValuefromJarFile) that is inside a class which I expose as a web service.

"exception: java.lang.reflect.InvocationTargetException"

The class that I converted to a web service looks follows

public class Ding
 {

 ding2 ding2class ;
   //private Object ding2class;
 
 public String returnValuefromJarFiile()
  {
 
  String test = new String("InitialValue");
  System.out.println("in returnvaluefromjarfile test is " + test );

   //   ding2 is defined in the jar file.
   ding2 ding2class = new ding2() ;
      test =  ding2class.getding2() ;
   //   System.out.println("in returnvalue  before return to main value of test from jar file is ::" + test );
      return( test);
 
  }

public String addtwoStringshere( String a, String b )
  {
   String c = a + b ;
   return (c );    
  }

  public String returnValuefromthisMethod()
  {
  String test = new String("Value from this method");
  return( test);
 
  }


}


The methods returnValuefromthisMethod() and addtwoStrings both return the right values. My guess as to why the returnValuefromJarFile gives me an exception is that the jar file the which contains the class ding2 is not getting deployed to the webservice runtime. Or some link from the calling class to the client.jar file is broken. Where do I find this plumbing ?

I know the jar file is fine because if I have a  class with a main() method inside of it I can that calls all three methods all three of the methods work fine.

Any help would be appreciated.

TIA,
mrnmrn

Eclipse version 3.1.1 and I installed all the web services plugins  from wtp-all-in-one-sdk-1.0-win32
Web Service Runtime Apache Axis
Server : Apache Tomcat 4.1

Please let me know if you need any more specific information


ASKER CERTIFIED SOLUTION
Avatar of RoyalNepal
RoyalNepal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial