facebook

[Closed] Struts exceptions

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #226237 Reply

    jonmc21
    Member

    Hi, I’m getting a few exceptions when I try to start up Tomcat with a Struts app. I think that it is having trouble with the <init-param> inside of the web.xml.

    This is the first exception that I get.

    Mar 6, 2005 9:41:25 AM org.apache.struts.action.ActionServlet handleConfigException
    SEVERE: Parsing error processing resource path
    java.net.MalformedURLException: Path WEB-INF/struts-config.xml does not start with a “/” character at org.apache.catalina.core.ApplicationContext.getResource(ApplicationContext.java:468)

    here is the <init-param> from my web.xml

    <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
    

    Here is the next exception. I think that this is being thrown because of the first one.

    INFO: Marking servlet action as unavailable
    Mar 6, 2005 9:41:25 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: Servlet /WebAppTest threw load() exception
    javax.servlet.UnavailableException: Parsing error processing resource path at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)

    Hopefully this gives someone an idea of whats going on.

    Thanks,
    Jon

    #226252 Reply

    Riyad Kalla
    Member

    Jon,
    Right click on your web.xml file and go to Validate, does the file validate correctly? I wonder if you are missing a closing tag somehwere before this line and is screwing up the parsing.

    #241950 Reply

    javadragon
    Participant

    I am getting something similar to this. I have created a web project. I have the strut JAR files under my Tomcat shared/lib folder. In eclispe I have added the struts.jar to my project build path. When I start up eclipse here is what I get:

    2005-11-22 14:06:36 StandardContext[/finance]Marking servlet action as unavailable
    2005-11-22 14:06:36 StandardContext[/finance]Servlet /finance threw load() exception
    javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml
    at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:769)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:745)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
    at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(StandardService.java:480)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

    Why is this happening? The struts library that I am using is 1.2.7. I am using Tomcat 5.0.28 and have this set up to run in debug mode. I have validated my web.xml, struts-config.xml, validation.xml and validator-rules.xml and they are all fine. These files are under my project WEB-INF folder.

    #241952 Reply

    Riyad Kalla
    Member

    Is this a web project with Struts capabilities added to it? How are you deploying it? If you are using the MyEclipse deployment tool, go select your deployment in the tool view and click Browse, now go into the WEB-INF dir, do you see a struts-config.xml file?

    In your web.xml file, what does the init parm look like that you are passing the struts-config.xml file argument to the ActionServlet?

    #241954 Reply

    javadragon
    Participant

    This is a web project and I have tried this with and without adding the struts capabilities. I am deploying it using the MyEclipse deployment tool to Tomcat as an exploded archive. After clicking the browse on the deployment screen I see struts-config.xml under the WEB-INF folder.

    I have the struts JAR files under TOMCAT_HOME/shared/lib because I have multiple projects that use struts and I did not want to have to include the same library files for each of the projects as this just made the WAR files larger and I wanted to globally control the version of struts being used.

    I do not have any other eclipse plugins installed other than EPIC Perl.

    #241956 Reply

    Riyad Kalla
    Member

    What about my web.xml question? The reason I think it might be something with that is the error:

    javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml

    #241966 Reply

    javadragon
    Participant

    <!– 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>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

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

    #241980 Reply

    Riyad Kalla
    Member

    If you drop the Struts libraries back into your WEB-INF/lib directory and redeploy, does it work? This really looks like a minor misconfig of libraries here, nothing too daunting.

    #242031 Reply

    javadragon
    Participant

    Downloaded and installed 1.2.8 files to see if 1.2.7 had some issue but that was not the case. So, I recreated my struts-config.xml with the same tages, etc and this worked. Must have been some sort of hidden character in the file that was the issue.

    #242033 Reply

    Riyad Kalla
    Member

    Very strange, none the less I”m glad to hear it is working.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: [Closed] Struts exceptions

You must be logged in to post in the forum log in