Two Laptop Bag*
The moose likes Struts and the fly likes Servlet action is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Servlet action is not available" Watch "Servlet action is not available" New topic
Author

Servlet action is not available

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
Hi all,

I m not getting why my Tomcat 6 servlet container is unable to find the ActionServlet.
I have made entry for this servlet in web.xml and done mapping also
WEB-INF\lib is having the "struts-core-1.3.10.jar" file. I am not using other struts modules/ features like jsp tags, validation, tiles etc.

I have checked my code and file structure with that available in book "Struts Complete Reference". Code downloaded runs fines.
For my code the container is not getting ActionServlet itself.

web.xml listing


Thank you all.


SCJP 1.4
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

I m not getting why my Tomcat 6 servlet container is unable to find the ActionServlet.


Exact what is the error saying?? Please post the stack trace of the error that you get here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
As such there is no stack trace in tomcat window. The browser shows 404 error:
----------------------------------------------------------
HTTP Status 404 - Servlet action is not available

type Status report

message Servlet action is not available

description The requested resource (Servlet action is not available) is not available.

Apache Tomcat/6.0.20
---------------------------------------------------------
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please turn up the logging level to DEBUG and check the log immediately after startup.
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
David Newton wrote:Please turn up the logging level to DEBUG and check the log immediately after startup.


How can i do that??
I have never used logging system

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Read this to get more information about how to set logging level...
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
I checked Tomcat logs; binutils and digester libraries were required. So copied them to my application's WEB-INF\lib directory
action servlet is getting accessed now,
but now following exception is being thrown

From tomcat logs:
-------------------------------------------------
Nov 17, 2009 4:21:40 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.
-------------------------------------------------

struts-config.xml and web.xml files are properly set for the requested URL. Not getting why is this happening.
I have worked with struts some 9 months back, but didn't get such issues.
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
HI all
Thanks for the help

There was an error of '/' in <action> element's path property.

Now no exception is being thrown, but after processing action i m not getting the forward page.
I am seeing only a blank screen.
Nothing found in tomcat logs.
Also System.out.println() is not printing anything on tomcat console window.
These SOP's not printed in logs too.

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

You'll have to show us your configuration files and/or your code for the action. Without that we can't predict what the problem is...
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
I used instructions available on tomcat site for enabling logging and copied new tomcat-juli.jar file. Now tomcat itself is not starting at all. log files of 10MBs are generated (as is mentioned on website). Hence i m using old tomcat-juli.jar file only.

I am not able to see my System.out.println() calls anywhere in the logs.

Ankit Garg wrote:You'll have to show us your configuration files and/or your code for the action. Without that we can't predict what the problem is...



This is simples registration form with 1 userID and two Password fields. No database connections are made.
I am not including success.html and failure.html; these are simplest html files showing success or failure depending upon whether user entered both passwords same or not respectively.

A part of tomcat.log file is also attached generated by log4j.

Here others are.

web.xml



struts-config.xml


register.jsp


RegisterForm.java



RegisterAction.java



Tomcat log related to my HTTP request

Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
Hiii all

I am getting frustrated for not able to solve this simple problem
Logs also don't say at all, SOP's not working too
Please someone help me out
 
wood burning stoves
 
subject: Servlet action is not available