• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Problem deploying Struts WAR

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a Tomcat 4.1.31 running in a JVM 1.4.2_09 on our server (yes an upgrade is overdue). I've built a Jakarta Struts application and have previously deployed it successfully. However, I have since made some changes to the source code and when trying to deploy the WAR file back to Tomcat I get the following error:

javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml
at org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:780)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:417)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
...

By trial and error, I've found that I can successfully deploy the WAR if I remove all my <action-mappings> declarations from the struts-config.xml which of course leaves me dead in the water.

I have a feeling this has to be a Tomcat issue and not a struts issue since I can delpoy it successfully on my own machine (using the same Tomcat version and JVM environment). I have also tried creating a bare bones struts app with a single action class, but I still get this error (unless I remove the <action-mappings> of course).

So far I've tried placing the struts.jar in the common/lib directory as well as the server/lib directory (which probably isn't necesary). I have also tried downloading the struts-config_1_1.dtd and referencing it directy from the struts-config.xml file rather than through http.

Here is the struts-config.xml file of the bare bones app (it's smaller):

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

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="lookupForm" type="app.LookupForm" />
</form-beans>

<action-mappings>
<action path="/Lookup" type="app.LookupAction" name="lookupForm">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/index.jsp" />
</action>
</action-mappings>
</struts-config>
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your struts-config.xml really getting packaged in your WAR (try looking inside, via "jar -tvf" or winzip to make sure), and is it really getting packaged in your WEB-INF dir. If that all checks out fine, maybe your editor is putting some extended-ASCII characters in the file, possibly invalidating it? What happens if you do an XML validate of "struts-config.xml" (using any XML validation tool you might available, Eclipse, NetBeans, Spy)? Good luck.
-Jim
 
Matthew Snow
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. Unzipping the WAR with PKZIP reveiled that the struts-config.xml is being packaged in the WEB-INF dir. I doubt that the editor I'm using (eclipse 3.2 with packaging done with MyEclipse 5.1) is inserting extended-ASCII characters since I've deployed Struts applications to this Tomcat before without any problems. Also, an xml validate within eclipse 3.2 brings up no errors.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic