NoSuchMethodError generated at runtime when using auxiliary classes
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hagamoto_Yamocho
Posted On:   Tuesday, March 12, 2002 09:14 AM

I have string handling methods in their own class, and that class is in its own folder in my javaclasses directory. The class compiles successfully. In my servlets that are to use these methods, I import the string handling class's package, instantiate a string handling object, and call " . ( )". For the majority of methods, NoSuchMethodError is generated when I attempt to run the servlet. All of the methods are declared similarly, public and non-static, and all have the same return type. I've recompiled all classes and servlets about 50 times each since the last revision. Example servlet code: ... import stringHandlingPackage;    More>>

I have string handling methods in their own class, and that class is in its own folder in my javaclasses directory. The class compiles successfully. In my servlets that are to use these methods, I import the string handling class's package, instantiate a string handling object, and call " . ( )". For the majority of methods, NoSuchMethodError is generated when I attempt to run the servlet. All of the methods are declared similarly, public and non-static, and all have the same return type. I've recompiled all classes and servlets about 50 times each since the last revision.



Example servlet code:

						
...

import stringHandlingPackage;

...

stringHandling strh = new stringHandling();

...

strh.checkNull("string");
strh.leadingZeroes("hi", 4);


The above code conks out on the first method (the constructor is ok, though). If I simply include the method definition in the servlet--removing the string handling object as well--the methods work fine.


Thanks in advance if anyone can decipher my vague description and help me solve my problem.

   <<Less

Re: NoSuchMethodError generated at runtime when using auxiliary classes

Posted By:   Jorge_Perez  
Posted On:   Wednesday, March 13, 2002 09:43 AM

Konnichi wa Yamocho San
This could be a dumb one, but its always good to check:
When you compile your class I must assume you have all the ncessary classes in your path (classpath) but, did you include those same classes in your servlet engone's classpath¿?( e.x lib directory or such?)
SOmetimes its unable to instatiate the class if its unable to find it in a good classpath known to the servlet engine.
If it's not the case, and I'll try to look further.
About | Sitemap | Contact