You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Richards <gr...@cyber4.org> on 2001/02/15 15:41:23 UTC

Help with Exception

Sorry about not cuttng out the previous messages, but the
discussion is sort-of relevant to what I'm having problems with.
I'm getting

	javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection

I can run the example, and I can run a test page with nothing but
a few tags (eg: <html:html>) but no forms/beans/etc. And I get the
above error. I've checked struts-config.xml.

I can only think I've missed something.

<!-- ========== Form Bean Definitions =================================== -->
  <form-beans>

    <!-- Logon form bean -->
    <form-bean      name="logonForm"
                    type="au.com.cyberlancers.share.forms.LogonForm"/>

  </form-beans>

  <!-- ========== Action Mapping Definitions ============================== -->
  <action-mappings>

    <!-- Logon action -->
    <action    path="/logon"
               type="au.com.cyberlancers.share.actions.LogonAction"
               name="logonForm"
               scope="request"
               validate="false">
      <forward name="false"              path="/index.jsp"/>
    </action>

and the jsp file (which is an include) has:

	<html:form action="/logon.do" focus="username">

	    <bean:message key="prompt.username"/>
	    <html:text property="username" size="16" maxlength="16"/><br>

	    <bean:message key="prompt.password"/>
	    <html:password property="password" size="16" maxlength="16"/><br>

	    <html:hidden property="type" value="employee"/>

	    <html:submit property="submit" value="prompt.submit"/>
	    <html:reset/>

	</html:form>



At 10:16 AM 9/02/01 -0800, Craig R. McClanahan wrote:
>Toby wrote:
>
>> The actions class in struts set the MAPPINGS_KEY to
>> "org.apache.struts.action.MAPPINGS" along with a MESSAGES_KEY, LOCALE_KEY,
>> FORWARDS_KEY and ERROR_KEY.  I cannot find the "mappings.properties" file
>> anywhere in the jakarta-tomcat or struts directories and assumed this is why I
>> am getting this error message.  Does anyone know where I could find these
>> files?
>>
>Have you defined your ActionServlet instance to be <load-on-startup> in the
>web.xml file?  If you haven't, and then try to access a JSP page first, the
>controller servlet will not have been initialized, and the context attributes it
>needs will not have been created yet.
>
>Craig
>
>
>>
>> Toby wrote:
>>
>> > I am able to run the struts-test example and the hello-world example from
>> > Bluestone, but nothing else.  I will take a closer look at the
>> > struts-config.xml file.
>> >
>> > Ted Husted wrote:
>> >
>> > > Are you able to run the Struts applications provided in the
>> > > distribution?
>> > >
>> > > The action mappings are provided through the struts-config.xml in the
>> > > application's WEB-INF folder.
>> > >
>> > > *********** REPLY SEPARATOR  ***********
>> > >
>> > > On 2/5/2001 at 8:21 PM Toby wrote:
>> > >
>> > > >Hi,
>> > > >I'm new to Tomcat and Struts.  I can get the basic hello world struts
>> > > > examples to run in my environment.  But when I try something more
>> > > > sophisticated, I receive the following error message concerning the
>> > > > ActionMappings.  I believe I have a Context Path problem, but am not
>> > > > sure how to resolve it.  Can anyone help?
>> > > >
>> > > > Error: 500
>> > > > Location: /struts-logon/logon.jsp
>> > > > Internal Servlet Error:
>> > > >
>> > > > javax.servlet.ServletException: Cannot retrieve ActionMappings under
>> > > >key
>> > > > "org.apache.struts.action.MAPPINGS"
>> > > >  at
>
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html

Re: Help with Exception

Posted by Maya Muchnik <mm...@pumatech.com>.
Hi,
Try to take all original *.xml files and ADD your new stuff, do not remove anything. Check if you have
struts.jar file under .../tomcat/webapps/your_new_app/WEB-INF/lib directory and struts*.tld files under
this WEB-INF.
Maya

Jim Richards wrote:

> > > Sorry about not cutting out the previous messages, but the
> > > discussion is sort-of relevant to what I'm having problems with.
> > > I'm getting
> > >
> > >         javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
> > >
> > > I can run the example, and I can run a test page with nothing but
> > > a few tags (eg: <html:html>) but no forms/beans/etc. And I get the
> > > above error. I've checked struts-config.xml.
> > >
> > > I can only think I've missed something.
> > >
> >
> > Have you configured the controller servlet to be <load-on-startup>?  If you do not do this, none of
> > the servlet context attributes created by the controller servlet (including the two mentioned in the
> > exception) will have been created if the first request you submit is to a JSP page.
> >
> > If that's not the issue, what servlet container are you running on.  Some have problems with
> > load-on-startup -- check the installation documentation for platform specific details.
>
> Yes, sorry. I'm using Tomcat 3.2.1 on Solaris, with J2SE 1.3. I have load-on-startup
> set to 1 (and my database container set to 2). I get an odd error when Tomcat starts
> in that it says (and this is from memory, don't have the extact message here) it
> can't load servlet: action. Now I assume this is the action servlet that is the
> struts one in the web.xml. But, it was a cut and paste job with modifications
> from the example web.xml, so I'd expect it to work. The servlet mapping seems
> correct.


Re: Help with Exception

Posted by Jim Richards <gr...@cyber4.org>.
> > Sorry about not cutting out the previous messages, but the
> > discussion is sort-of relevant to what I'm having problems with.
> > I'm getting
> >
> >         javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
> >
> > I can run the example, and I can run a test page with nothing but
> > a few tags (eg: <html:html>) but no forms/beans/etc. And I get the
> > above error. I've checked struts-config.xml.
> >
> > I can only think I've missed something.
> >
> 
> Have you configured the controller servlet to be <load-on-startup>?  If you do not do this, none of
> the servlet context attributes created by the controller servlet (including the two mentioned in the
> exception) will have been created if the first request you submit is to a JSP page.
> 
> If that's not the issue, what servlet container are you running on.  Some have problems with
> load-on-startup -- check the installation documentation for platform specific details.

Yes, sorry. I'm using Tomcat 3.2.1 on Solaris, with J2SE 1.3. I have load-on-startup
set to 1 (and my database container set to 2). I get an odd error when Tomcat starts
in that it says (and this is from memory, don't have the extact message here) it
can't load servlet: action. Now I assume this is the action servlet that is the
struts one in the web.xml. But, it was a cut and paste job with modifications
from the example web.xml, so I'd expect it to work. The servlet mapping seems
correct.

Re: Help with Exception

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Jim Richards wrote:

> Sorry about not cuttng out the previous messages, but the
> discussion is sort-of relevant to what I'm having problems with.
> I'm getting
>
>         javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
>
> I can run the example, and I can run a test page with nothing but
> a few tags (eg: <html:html>) but no forms/beans/etc. And I get the
> above error. I've checked struts-config.xml.
>
> I can only think I've missed something.
>

Have you configured the controller servlet to be <load-on-startup>?  If you do not do this, none of
the servlet context attributes created by the controller servlet (including the two mentioned in the
exception) will have been created if the first request you submit is to a JSP page.

If that's not the issue, what servlet container are you running on.  Some have problems with
load-on-startup -- check the installation documentation for platform specific details.

Craig


>
> <!-- ========== Form Bean Definitions =================================== -->
>   <form-beans>
>
>     <!-- Logon form bean -->
>     <form-bean      name="logonForm"
>                     type="au.com.cyberlancers.share.forms.LogonForm"/>
>
>   </form-beans>
>
>   <!-- ========== Action Mapping Definitions ============================== -->
>   <action-mappings>
>
>     <!-- Logon action -->
>     <action    path="/logon"
>                type="au.com.cyberlancers.share.actions.LogonAction"
>                name="logonForm"
>                scope="request"
>                validate="false">
>       <forward name="false"              path="/index.jsp"/>
>     </action>
>
> and the jsp file (which is an include) has:
>
>         <html:form action="/logon.do" focus="username">
>
>             <bean:message key="prompt.username"/>
>             <html:text property="username" size="16" maxlength="16"/><br>
>
>             <bean:message key="prompt.password"/>
>             <html:password property="password" size="16" maxlength="16"/><br>
>
>             <html:hidden property="type" value="employee"/>
>
>             <html:submit property="submit" value="prompt.submit"/>
>             <html:reset/>
>
>         </html:form>
>
> At 10:16 AM 9/02/01 -0800, Craig R. McClanahan wrote:
> >Toby wrote:
> >
> >> The actions class in struts set the MAPPINGS_KEY to
> >> "org.apache.struts.action.MAPPINGS" along with a MESSAGES_KEY, LOCALE_KEY,
> >> FORWARDS_KEY and ERROR_KEY.  I cannot find the "mappings.properties" file
> >> anywhere in the jakarta-tomcat or struts directories and assumed this is why I
> >> am getting this error message.  Does anyone know where I could find these
> >> files?
> >>
> >Have you defined your ActionServlet instance to be <load-on-startup> in the
> >web.xml file?  If you haven't, and then try to access a JSP page first, the
> >controller servlet will not have been initialized, and the context attributes it
> >needs will not have been created yet.
> >
> >Craig
> >
> >
> >>
> >> Toby wrote:
> >>
> >> > I am able to run the struts-test example and the hello-world example from
> >> > Bluestone, but nothing else.  I will take a closer look at the
> >> > struts-config.xml file.
> >> >
> >> > Ted Husted wrote:
> >> >
> >> > > Are you able to run the Struts applications provided in the
> >> > > distribution?
> >> > >
> >> > > The action mappings are provided through the struts-config.xml in the
> >> > > application's WEB-INF folder.
> >> > >
> >> > > *********** REPLY SEPARATOR  ***********
> >> > >
> >> > > On 2/5/2001 at 8:21 PM Toby wrote:
> >> > >
> >> > > >Hi,
> >> > > >I'm new to Tomcat and Struts.  I can get the basic hello world struts
> >> > > > examples to run in my environment.  But when I try something more
> >> > > > sophisticated, I receive the following error message concerning the
> >> > > > ActionMappings.  I believe I have a Context Path problem, but am not
> >> > > > sure how to resolve it.  Can anyone help?
> >> > > >
> >> > > > Error: 500
> >> > > > Location: /struts-logon/logon.jsp
> >> > > > Internal Servlet Error:
> >> > > >
> >> > > > javax.servlet.ServletException: Cannot retrieve ActionMappings under
> >> > > >key
> >> > > > "org.apache.struts.action.MAPPINGS"
> >> > > >  at
> >
> --
> Kumera - a new Open Source Content Management System
> for small to medium web sites written in Perl and using XML
> http://www.cyber4.org/kumera/index.html