jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes error in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "error in struts" Watch "error in struts" New topic
Author

error in struts

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
This is my jsp

<%@ taglib uri="http://struts.apache.org/tags-bean"
prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html"
prefix="html" %>
<html>
<head>
<Title> Login </title>
</head>
<body>
<Center>
<html:form action="/messageLogin">
<bean:message key="firstName" /> :
<html:text property="firstName"/><br>
<bean:message key="lastName" /> :
<html:text property="lastName"/><br>
<bean:message key="emailID" /> :
<html:text property="emailID"/><br>
<html:submit>
Submit
</html:submit>
</html:form>
</center>
</body>
</html>

this is what i get when i type the following address
http://localhost:8080/test/message.jsp

Mar 6, 2007 12:49:43 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException: Module 'null' not found.
at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)
at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:723)
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:742)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:417)
at org.apache.jsp.message_jsp._jspx_meth_html_005fform_005f0(message_jsp.java:102)
at org.apache.jsp.message_jsp._jspService(message_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Unknown Source)


have a great day,
krishna prasad
Milan Jagatiya
Ranch Hand

Joined: Jan 01, 2007
Posts: 164
are you using separate files for each module for your application???..if so...can you post your web.xml and struts congig files....


Milan.<br />I can because I think I can...
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This error is most likely caused by one of the following:
  • You faled to speciffy <load-on-startup>2</load-on-startup> for the Struts ActionServlet in your web.xml file
  • You did specify the above, but the Struts ActionServlet didn't initialize properly because of an error. Check the log file entries for the time period when the Server first starts up to see if it initialized properly.


  • Merrill
    Consultant, Sima Solutions
    krishna prasad gunasekaran
    Ranch Hand

    Joined: Jul 25, 2006
    Posts: 158
    here is my struts-config.xml

    <form-beans>
    <form-bean
    name="messageFormBean"
    type="test.MessageFormBean"/>
    </form-beans>

    <action
    path="/messageLogin"
    type="test.MessageActionClass"
    name="messageFormBean"
    scope="request">
    <forward name="success"
    path="/WEB-INF/view/messageSuccess.jsp"/>
    </action>

    <message-resources parameter="TestMessageResources1"
    null="true"/>

    Here is my web.xml

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>
    <display-name>Struts Blank Application</display-name>

    <!-- Standard Action Servlet Configuration -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>


    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>


    <!-- The Usual Welcome File List -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    </web-app>

    here are the log files
    1. localhost.2007-03-08.log

    Mar 8, 2007 11:42:53 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Mar 8, 2007 11:42:53 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Mar 8, 2007 11:42:55 AM org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet action as unavailable
    Mar 8, 2007 11:42:55 AM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /test threw load() exception
    javax.servlet.UnavailableException: Parsing error processing resource path jndi:/localhost/test/WEB-INF/struts-config.xml
    at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:774)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:749)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:686)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:353)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:451)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Mar 8, 2007 11:43:10 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException: Module 'null' not found.
    at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)
    at org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:723)
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:742)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:417)
    at org.apache.jsp.message_jsp._jspx_meth_html_005fform_005f0(message_jsp.java:102)
    at org.apache.jsp.message_jsp._jspService(message_jsp.java:74)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Unknown Source)
    Mar 8, 2007 11:43:32 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextDestroyed()
    Mar 8, 2007 11:43:32 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextDestroyed()

    2.catalina.2007-03-08.log

    Mar 8, 2007 11:42:52 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\dhamu\kicha\Tomcat6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\
    Mar 8, 2007 11:42:52 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Mar 8, 2007 11:42:52 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 687 ms
    Mar 8, 2007 11:42:52 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Mar 8, 2007 11:42:52 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.2
    Mar 8, 2007 11:42:52 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Mar 8, 2007 11:42:52 AM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deploying web application archive struts-blank.war
    Mar 8, 2007 11:42:52 AM org.apache.struts.action.ActionServlet initChain
    INFO: Loading chain catalog from jar:file:/E:/dhamu/kicha/Tomcat6.0/webapps/struts-blank/WEB-INF/lib/struts-core-1.3.5.jar!/org/apache/struts/chain/chain-config.xml
    Mar 8, 2007 11:42:53 AM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/org/apache/struts/validator/validator-rules.xml'
    Mar 8, 2007 11:42:53 AM org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    Mar 8, 2007 11:42:55 AM org.apache.struts.action.ActionServlet initChain
    INFO: Loading chain catalog from jar:file:/E:/dhamu/kicha/Tomcat6.0/webapps/test/WEB-INF/lib/struts-core-1.3.5.jar!/org/apache/struts/chain/chain-config.xml
    Mar 8, 2007 11:42:55 AM org.apache.commons.digester.Digester fatalError
    SEVERE: Parse Fatal Error at line 2 column 6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1572)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:745)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:686)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:353)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:451)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Mar 8, 2007 11:42:55 AM org.apache.struts.util.PropertyMessageResources loadLocale
    WARNING: Resource org/apache/struts/action/ActionResources_en_US.properties Not Found.
    Mar 8, 2007 11:42:55 AM org.apache.struts.util.PropertyMessageResources loadLocale
    WARNING: Resource org/apache/struts/action/ActionResources_en.properties Not Found.
    Mar 8, 2007 11:42:55 AM org.apache.struts.action.ActionServlet handleConfigException
    SEVERE: Parsing error processing resource path jndi:/localhost/test/WEB-INF/struts-config.xml
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1572)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:745)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:686)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:353)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:451)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Mar 8, 2007 11:42:55 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Mar 8, 2007 11:42:55 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Mar 8, 2007 11:42:55 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/125 config=null
    Mar 8, 2007 11:42:55 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3516 ms
    Mar 8, 2007 11:43:30 AM org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-8080
    Mar 8, 2007 11:43:32 AM org.apache.catalina.core.StandardService stop
    INFO: Stopping service Catalina
    Mar 8, 2007 11:43:32 AM org.apache.coyote.http11.Http11Protocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-8080
    Mar 8, 2007 11:43:32 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: Failed shutdown of Apache Portable Runtime
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    If you look closely at the stack trace, it's telling you very specifically what's wrong: Struts can't parse the XML in your struts-config.xml file

    Is what you posted the entire contents of your struts-config.xml file? If so, it's pretty clear why Struts can't parse it: It doesn't follow the format required by the DTD.

    It's really better if you don't try to build your struts-config.xml file from scratch. I'd recommend starting from the template provided in the struts-blank.war file that comes with the Struts download.

    Here's what I recommend:
  • Rename your current struts-config.xml file to some other name
  • Find the struts-blank.war file that came with the download
  • Unzip the file into a directory on your disk somewhere
  • Copy the sample struts-config.xml file in the WEB-INF directory to the same directory in your application
  • Copy and paste the <form-beans> and <action> stanzas from your old renamed file into the new struts-config.xml file and delete the sample ones that are already there
  • There's one problem you need to make sure gets corrected in the new version of the config file: All <action> stanzas must be enclosed in a single <action-mappings> stanza
  • Redeploy the application and retest

  • [ March 08, 2007: Message edited by: Merrill Higginson ]
    krishna prasad gunasekaran
    Ranch Hand

    Joined: Jul 25, 2006
    Posts: 158
    what about Action servlet. Is it one of the reasons that error has occured.
    Because I could see everything goes fine until the action servlet is encountered, in the log file. for your information, in the log file
    localhost.2007-03-08.log, we can see this piece of errror message,

    INFO: Marking servlet action as unavailable
    Mar 8, 2007 11:42:55 AM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /test threw load() exception


    and in catalina.2007-03-08.log ,

    Mar 8, 2007 11:42:55 AM org.apache.struts.action.ActionServlet initChain
    INFO: Loading chain catalog from jar:file:/E:/dhamu/kicha/Tomcat6.0/webapps/test/WEB-INF/lib/struts-core-1.3.5.jar!/org/apache/struts/chain/chain-config.xml
    Mar 8, 2007 11:42:55 AM org.apache.commons.digester.Digester fatalError
    SEVERE: Parse Fatal Error at line 2 column 6: The processing instruction target matching "[xX][mM][lL]" is not allowed


    so does Action servlet had something to do with the error?
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    The reason the ActionServlet is unavailable is that it didn't initialize properly when the server started up. In order to become active, the ActionServlet must perform its initialization logic, part of which is to read and parse the struts-config.xml file. The following part of the stack trace tells you very specifically that the ActionServlet was trying to perform it's init method, but ran into an error when it tried to parse the struts-config.xml file.

     
    GeeCON Prague 2014
     
    subject: error in struts