wood burning stoves*
The moose likes Servlets and the fly likes Servlet marked as unavailable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet marked as unavailable" Watch "Servlet marked as unavailable" New topic
Author

Servlet marked as unavailable

jess tan
Greenhorn

Joined: Oct 15, 2009
Posts: 8
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.
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

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..


Regards, Prasad
SCJP 5 (93%)
jess tan
Greenhorn

Joined: Oct 15, 2009
Posts: 8
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.
Nilesh Miskin
Ranch Hand

Joined: Jun 17, 2010
Posts: 44
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.

Nilesh Miskin
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

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

Joined: Oct 15, 2009
Posts: 8
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!!!
 
 
subject: Servlet marked as unavailable
 
Similar Threads
ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
java.lang.IllegalStateException
Missing CharacterEncodingFilter, UrlRewriteFilter?
Spring tomcat error
Why NestedServletException?