• 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

Servlet marked as unavailable

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a problem whereby whenever i run the servlet in eclipse using tomcat 6.0.26, my serlvlet was marked as unavailable. have stripped down the servlet to bare minimum and was able to run it. It was only after i placed the following code that it was unable to run.

public void doGet (HttpServletRequest request, HttpServletResponse response, String additionalParameter) throws ServletException, IOException, Exception {

int which = 0;
String name = request.getParameter( "name" );

try {
Oracle oracle = new Oracle(jdbcUrl, user, password);

Attachment attachment = Attachment.createInstance(
new String[] {}, "OWLPRIME",
InferenceMaintenanceMode.NO_UPDATE, QueryOptions.DEFAULT);


GraphOracleSem graph = new GraphOracleSem(oracle, modelName, attachment);
ModelOracleSem model3 = new ModelOracleSem(graph);


Part of the error is as follow:

Jun 22, 2010 9:44:50 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet ExpertFinderServlet as unavailable
Jun 22, 2010 9:44:50 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet MyServlet
java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)

Unable to find explaination or solution to this problem. Would appreciate any help here. Thank You.
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

public void doGet (HttpServletRequest request, HttpServletResponse response, String additionalParameter) throws ServletException, IOException, Exception {



you need to override, doGet or doPost methods in the servlet, in the above code, you are passing a additionalParameter, so this function doesn't override the doGet method, so the container thinks there is no service method, and marks the servlet as unavailable..
 
jess tan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thks for the quick reply. but i have already override it by doing this

public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {

doGet (request,response,"Additional parameter");
} catch (Exception e) {
}
}


but the error still shows.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error log says:
...java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model ...
Check if your classpath settings are proper & jars for all the required libraries have been set in the classpath.
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

SEVERE: Allocate exception for servlet MyServlet
java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.Model



Then, I think, here the exception lies, ClassnotFoundException... Are you sure, you have com.hp.hpl.jena.rdf.model.Model on the classpath..
 
jess tan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think that was the problem... I put the jar in the user library but not in the Web-Inf lib folder. After I place it in managed to get it to work!

Thanks a lot!!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic