You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Clay Graham <cl...@newobjectivity.com> on 2002/07/10 23:46:50 UTC

cannot find action mapping

STRUTS people,

this is bizzare, but I have come to expect this in my travels. so any hints 
as to what the problem may be would be great!

I am using tomcat 4.1.3

I have a struts application in $CATALINA_HOME/webapps/test, it has the 
following stuff in it...

>test
	home.jsp
	index.jsp
	register.jsp
	>WEB-INF
		struts-bean.tld
		struts-form.tld
		struts-logic.tld
		struts.tld
		struts-config.xml
		struts-html.tld
		struts-template.tld
		web.xml
		>lib
			mm.mysql-2.0.14-bin.jar
			struts.jar
		>classes
		   >com
		     >noi
                               >webapp
                                 >test
                                   	>action
			  RegisterAction.class
			>display
			  UserData.class
			>form
			  RegisterForm.class

my struts-config.xml file looks like:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">


<struts-config>
<!-- ========== data source Definitions ============================== -->
  <data-sources>
      <data-source>
          <set-property property="autoCommit" value="false" />
          <set-property property="description" value="The Test Datasource" 
/>
          <set-property property="driverClass" 
value="org.gjt.mm.mysql.Driver" />
          <set-property property="maxCount" value="4" />
          <set-property property="minCount" value="2" />
          <set-property property="password" value="" />
          <set-property property="url" value="jdbc:mysql://localhost/test" 
/>
          <set-property property="user" value="root" />
      </data-source>
  </data-sources>

<!-- ========== form Definitions ============================== -->
   <form-beans>
        <form-bean name="registerForm" 
type="com.noi.webapp.test.form.RegisterForm"/>
   </form-beans>

<!-- ========== Global Forward Definitions ============================== 
-->
  <global-forwards>
    <forward   name="registerform"         path="/register.jsp"/>
  </global-forwards>

<!-- ========== action Definitions ============================== -->
   <action-mappings>
     <action path="/register"
        type="com.noi.webapp.test.action.RegisterAction"
        name="registerForm">
        <forward name="home" path="/home.jsp"/>
    </action>
  </action-mappings>
</struts-config>
				

this is coming out of the catalina.out log when tomcat starts up...

register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 
'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str  
uts.jar!/org/apache/struts/resources/struts-config_1_0.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 
'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str  
uts.jar!/org/apache/struts/resources/web-app_2_2.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 
'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str  
uts.jar!/org/apache/struts/resources/web-app_2_3.dtd'
resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 
1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
 Resolving to alternate DTD 
'jar:file:/home/tomcat/jakarta-tomcat-4.1.3/webapps/test/WEB-INF/lib/str  
uts.jar!/org/apache/struts/resources/struts-config_1_0.dtd'
New org.apache.struts.util.GenericDataSource
Set org.apache.struts.util.GenericDataSource properties
Call 
org.apache.struts.action.ActionServlet.addDataSource(org.apache.struts.a  
ction.DATA_SOURCE, GenericDataSource[activeCount=0, autoCommit=true, 
closed=false, driverClass=null, loginTimeout=0, maxCount=2, minCount=1, 
password=null, readOnly=false, url=null, useCount=0, user=null])
Set org.apache.struts.util.GenericDataSource property autoCommit to false
Set org.apache.struts.util.GenericDataSource property description to The 
Test Datasource
Set org.apache.struts.util.GenericDataSource property driverClass to 
org.gjt.mm.mysql.Driver
Set org.apache.struts.util.GenericDataSource property maxCount to 4
Set org.apache.struts.util.GenericDataSource property minCount to 2
Set org.apache.struts.util.GenericDataSource property password to
Set org.apache.struts.util.GenericDataSource property url to 
jdbc:mysql://localhost/test
Set org.apache.struts.util.GenericDataSource property user to root
Pop org.apache.struts.util.GenericDataSource
New org.apache.struts.action.ActionFormBean
Set org.apache.struts.action.ActionFormBean properties
Call 
org.apache.struts.action.ActionServlet.addFormBean(ActionFormBean[regist  
erForm])
Pop org.apache.struts.action.ActionFormBean
New org.apache.struts.action.ActionForward
Set org.apache.struts.action.ActionForward properties
Call 
org.apache.struts.action.ActionServlet.addForward(ActionForward[register  
form])
Pop org.apache.struts.action.ActionForward
New org.apache.struts.action.ActionMapping
Set org.apache.struts.action.ActionMapping properties
New org.apache.struts.action.ActionForward
Set org.apache.struts.action.ActionForward properties
Call org.apache.struts.action.ActionMapping.addForward(ActionForward[home])
Pop org.apache.struts.action.ActionForward
Call 
org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=/re  
gister, type=com.noi.webapp.test.action.RegisterAction])
Pop org.apache.struts.action.ActionMapping
Jul 10, 2002 5:30:02 PM org.apache.commons.logging.impl.Jdk14Logger info
INFO: Starting Coyote HTTP/1.1 on port 8080

so, I know that my struts-config file is doing its job, or else all the 
loadup would not do report these mappings.

when I try to use tags that use action mappings such as:

<html:link forward="registerform">register form</html:link>

I get a page error such as:

type Exception report

message

description The server encountered an internal error () that prevented it 
from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot create rewrite URL: 
java.net.MalformedURLException: Cannot retrieve ActionForwards collection
	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja  
va:232)
	at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica  
tionFilterChain.java:247)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt  
erChain.java:193)

root cause

javax.servlet.ServletException: Cannot create rewrite URL: 
java.net.MalformedURLException: Cannot retrieve ActionForwards collection
	at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex  
tImpl.java:479)
	at org.apache.jsp.index$jsp._jspService(Unknown Source)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)

any ideas are welcome.....

clay





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>