This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts/Tomcat:Cannot find ActionMappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts/Tomcat:Cannot find ActionMappings" Watch "Struts/Tomcat:Cannot find ActionMappings" New topic
Author

Struts/Tomcat:Cannot find ActionMappings

Aaron Roberts
Ranch Hand

Joined: Sep 10, 2002
Posts: 174
I have a web app which compiles fine using Ant. Tomcat 4.1 starts with no problem. When I go to access a jsp, I get:
org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:246)
etc etc
I'm still relatively new to the entire Struts/Tomcat/Java world, but I can learn! My guess is that Tomcat is not finding the Struts classes. My webapp dir looks like this -
myapp/
WEB-INF/
Classes/(struts files, tld, etc)
Lib/struts.jar
Where should I start looking from here? Any help is greatly appreciated!
Regards,
Aaron
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
If you will provide more information what is in your JSP page, and what are you trying to achieve in your WAR file it'll help.
I'll recommend reading up the Users guide from http://jakarta.apache.org/struts and the preview release O'Reilly book from serverside.com (as a guide).
Personally, I'll depend on the apache.org's tutorial more and only read the O'Reilly book as a guide. I don't like the way it extends the Struts controller servlet in its examples.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You might want to take a look at this article and see if you can get Struts working with this simple example:
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
By the way, this is the structure that I use
/WEB-INF/ [struts tlds]
/WEB-INF/classes/[ApplicationResources.properties]
/WEB-INF/lib/[Struts libs]
/WEB-INF/struts-config.xml
Aaron Roberts
Ranch Hand

Joined: Sep 10, 2002
Posts: 174
Thanks for the info. I didn't want to post lines and lines of code before I got more of an idea of where to start looking.
The solution had nothing to do with my configs. It did have everything to do with having all the classes present though! I solved the problem by examining the Tomcat log and discovered a class was throwing an exception. I decided to fix that and then get back to the 'real' problem. It turns out that was my problem. Once I put the required jar file under the shared/lib directory (its a database access class) everything worked fine.
Had I not looked in the log, I would have never found what I thought was a struts error. Live and learn.
Thanks again -
Aaron
 
GeeCON Prague 2014
 
subject: Struts/Tomcat:Cannot find ActionMappings