2

I have multiple jar files at a specific location .Based on some calculation, I need to load different jar files and invoke a certain method inside the jar. The jar file contains methods that act as a client to web services. When I invoke the method using reflection, it throws an error Wrapper class not found. Have you run APT to generate them?

Linger
  • 14,942
  • 23
  • 52
  • 79
  • How do you load the jar files ? Do you use an URLClassLoader ? And once loader how do you determine what class you're going to invoke ? – pgras May 19 '09 at 05:55

3 Answers3

1

It sounds like the classes that you are loadiing from the JAR use other classes that are not on the classpath. You can add the libraries they depend on to the system classpath of your application or list them in the Class-Path entry in the manifest files of the JARs you are loading.

Nat
  • 9,820
  • 3
  • 31
  • 33
0

Check out this question for a possible solution.

I'm not sure why you would get such an error when you attempt to call a method via reflection but a little googling came up with this forum post (among others).

Community
  • 1
  • 1
Ronald Wildenberg
  • 31,634
  • 14
  • 90
  • 133
0

Just checking you aren't using -jar option at all? This is mutually exclusive of -classpath. See here for more explanation.

Community
  • 1
  • 1
toolkit
  • 49,809
  • 17
  • 109
  • 135
  • the jar files does not have reference to any other class.It simply is a client to a web service.So is it something to do with how i created the web service client? –  May 20 '09 at 14:02