• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

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


0
mrnmrn
Asked:
mrnmrn
1 Solution
 
RoyalNepalCommented:
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);
 
  }


I think its not getting the ding2 class in the run time...make sure the jar file which you pluged in is in the class path.....
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now