• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generic objects used by a servlet

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic