This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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.
All of the following truths are shameless lies. But what about this tiny ad:
Become a Java guru with IntelliJ IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!