• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generic objects used by a servlet

 
Kevin Adams
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive me if my terminology is not proper...
I created an object that looks up data on my server. Basically, one of the methods takes a code (String) and returns a description of that code (String)... simple enough.
I tested that object by instantiating it from another object. No problem there...
But, when I try to instantiate it in my servlet, the servlet bombs...
The class compiles correctly (java -verbose even shows it getting the definition from the right package) but it won't run.
Could it be that the application server has a different classpath than the one that was used to compile the class?
Any help would be appreciated.
Kevin
 
Tano_Ortiga
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's possible that your webserver could not locate the class that it needs for the servlet. Make sure that the new class is also included in the classpath. Also, you might want to check if that class that you instantiated in the servlet is inside a package, in this case you have to include the dirname of the package in the classpath of the webserver/application server (e.g. if your class is packaged in C:\testclass dir, include C:\ in your classpath).
what exactly was the error message that you got?
I hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic