Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Generic objects used by a servlet  RSS feed

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.
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
Boost this thread!