You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Patrick Coskren <pc...@unitedmedia.com> on 2001/07/26 20:13:50 UTC
Can't load action classes
Hi, all.
I'm new to Struts (though not to Java development), and at this
point I'm just trying to get a very simple page up and running. The
page itself displays fine; its main feature is an <html:link> tag that
points to the action "/add.do". When I click the link, the browser
comes back with:
Error 500
Location JspAdder/add.do
No action instance for path /add could be created
Looking at servlet.log, it turns out that the right class is recognized
(um.AdderPageAddAction), but ActionServlet can't load it. Here's the
stack trace:
> 2001-07-26 02:06:48 - path="/JspAdder" :action: Mapping for servlet
> 'action' = '*.d\
> o'
> 2001-07-26 02:06:52 - path="/JspAdder" :action: Processing a GET for
> /add
> 2001-07-26 02:07:39 - path="/JspAdder" :action: Setting locale 'english'
> 2001-07-26 02:07:39 - path="/JspAdder" :action: Looking for Action
> instance for cl\
> ass um.comicsmail.AdderPageAddAction
> 2001-07-26 02:07:39 - path="/JspAdder" :action: Double checking for
> Action instan\
> ce already there
> 2001-07-26 02:07:39 - path="/JspAdder" :action: Creating new Action
> instance
> 2001-07-26 02:07:39 - path="/JspAdder" :action: Error creating Action
> instance for \
> path '/add', class name 'um.AdderPageAddAction' -
> java.lang.ClassNotFoun\
> dException: um.AdderPageAddAction
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:120)
> at
> org.apache.struts.action.ActionServlet.processActionCreate
> (ActionServlet.jav\
> a:1630)
It's as though the class loader doesn't have my action class in its
classpath. But according to the jasper.log, the classpath is correct:
> 2001-07-26 02:06:47 - Scratch dir for the JSP engine is:
> /Applications/tomcat/work/\
> localhost%2FJspAdder
> 2001-07-26 02:06:47 - IMPORTANT: Do not modify the generated servlets
> 2001-07-26 02:10:42 - JspEngine --> /index.jsp
> 2001-07-26 02:10:42 - ServletPath: /index.jsp
> 2001-07-26 02:10:42 - PathInfo: null
> 2001-07-26 02:10:42 - RealPath:
> /Users/patrick/Documents/Development/Comi\
> csMail/FigureStudies/JspAdder/index.jsp
> 2001-07-26 02:10:42 - RequestURI: /JspAdder/index.jsp
> 2001-07-26 02:10:42 - QueryString: null
> 2001-07-26 02:10:42 - Request Params:
> 2001-07-26 02:10:42 - Classpath according to the Servlet Engine is:
> /Users/patrick/\
> Documents/Development/ComicsMail/FigureStudies/JspAdder/WEB-INF/classes
And the file its looking for is in that classes directory, which is
readable. Does anyone have any ideas what I'm missing here? I'm using
Java 1.3 on Mac OS X.
Thanks for any pointers,
-Patrick