wood burning stoves*
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


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

majid nakit
Ranch Hand

Joined: Jun 26, 2001
Posts: 164
trying to run an struts example from a book using jakarta-tomcat-5.5.7 , I got this 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.

here is web.xml :



Here is struts-config.xml :



Thank you, your help is appreciated
rizwanyq yousuf
Greenhorn

Joined: Apr 04, 2005
Posts: 6
go to tomcat-home\logs\localhost.log. look in to loog file there must be some description for this error. let us know abt that and we will be able to help u better.


Rizwan Yousuf
majid nakit
Ranch Hand

Joined: Jun 26, 2001
Posts: 164
my tomcat does not have a log .
Rob Manthey
Greenhorn

Joined: Apr 12, 2005
Posts: 2
I may have the same problem, and suspect something may be broken - hopefully my code, as that I can fix!

I am running tomcat 5.5.7 on JDK1.5 plus a second instance of tomcat 5.0.19 on JDK1.4.2 (on another port) on the same Redhat 9 box. The Struts 1.2.4 edition of struts-examples.war works fine on my Tomcat5.0/JDK1.4, however it gets trashed when I drop it into my fairly operational Tomcat 5.5/JDK1.5 server (it runs other JDK1.5 compiled wars fine).

My fault message at the browser when I try to access the url for struts-example (clicked straight off the "manager" console, so it's there and deployed ok):

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/5.5.7

Nothing is written to catalina.out which is logging other apps' errors just fine.

I am running into this fault because I am looking for a solution to a problem with my struts Validator code, which I can't get running in Tomcat 5.5 / JDK 1.5 ... I get the following fault when using the simplest of validations ("required" ... minLength, maxlength respond the same):

ERRORvalidateFieldForRule, reflection: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)
java.lang.NoSuchMethodException: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest)
at java.lang.Class.getMethod(Class.java:1581)
at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:401)

etc

However I have traced the jar containing that class and method .. it's there alright, and in the classpath ok. I'm worried that it might be the reflection which is failing, and possibly because of a JDK1.4 compiled commons-validator trying to reflect into a JDK1.5 compiled class - and hence I'm wasting my time trying to debug my own code.

Anyone got any good news for me?
Mainly can anyone verify that you can indeed run (straight out of the box) struts-example.war and specifically struts-validator on tomcat 5.5 in JDK1.5 with JDK1.5 compiled JSPs and .java user files?

On another note, but possibly with the same underlying problem, I was able to run StrutsTestCase using the Mock version but the Cactus version choked, and I recall thinking that the error message smacked of a JDK1.4 class failing to co-operate with a 1.5 class for some reason. Sorry I don't have the message in window, but I can repeat the test if anyone's really interested. I recall seeing some component deep in the sub-structure like httpunit or something being only JDK1.4 compliant, but that's purely impression, not fact.

A free chokkie bar to anyone who can help. Oh, you have to come to Brisbane, Q, AU to collect!
Rob M
Rob Manthey
Greenhorn

Joined: Apr 12, 2005
Posts: 2
Well, I'll be giving James, my tech lead a chokkie bar. He found a problem with my classpath - I had one set prior to booting Tomcat. Not good. Unset the classpath before ./bin/startup.sh and both the struts-expample and my own code work fine unedited.
So to answer my own question - yes Struts 1.2.4 works so far as the basic tests go in Tomcat 5.5.7 / JDK1.5.0 ... all the samples in the struts-example.war clicked through ok.
Struan Kerr
Greenhorn

Joined: Feb 01, 2005
Posts: 10
I don't have the classpath set and everything works until I try and set up a data source in the struts-config.xml. I've tried setting up a connection to the database in a little test program and the appropriate jar file is in tomcat/shared/lib (also tried it in tomcat/common/lib just in case). Again I get nothing in the log files. Tomcat 5.5.7 jdk1.5.0
Struan Kerr
Greenhorn

Joined: Feb 01, 2005
Posts: 10
Don't know what it is about this thread and people answering their own posts but anyway:

Although I had the jdbc jar in the classpath I didn't have commons-dbcp so the contain was throwng a class not found exception. Note you also need commons-pool and commons-collections (but thats in the struts-blank.war). You can download the missing jars from the apache website.
Alpesh Parekh
Greenhorn

Joined: Aug 05, 2002
Posts: 12
1) In web.xml and struts-config.xml All path are relative

Check it starts with /

Example:
<param-value>/WEB-INF/struts-config.xml</param-value>

2) make sure following jar files are available in application lib directory

commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-validator.jar
i18n.jar
jakarta-oro.jar
struts.jar

The damn thing is working now ...


<b>One life, live it.</b><br /><b>Alpesh</b>
 
GeeCON Prague 2014
 
subject: Servlet action is not available