0
votes


I'm in the middle of migrating a JavaEE project from Sun Application Server 9.1 to Glassfish 3.1.2. The project has the following structure:

ear
| - /lib/someProject.jar (used by confictEJB and EJB)
| - confictEJB.jar
| - EJB.jar
| - webProj.war

The jars and the ear is build with maven. The thing is, this deploys without errors in SAS 9.1 and in Glassfish 2.1. But in Glassfish 3.2.1 I get this error:

#|2012-04-23T13:44:29.562+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=34;_ThreadName=Thread-2;|WebModule[/ArchiveTool]PWC1396: Servlet /ArchiveTool 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:739)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:715)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:670)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:329)

It looks like the ActionServlet cannot parse/find the struts-config.xml in GF3.2.1. What I did so far:

  • referenced to the local DTD in the DOCTYPE of the struts-config.xml
  • general syntax validation of struts-config.xml -> no errors
  • validate the struts-config.xml against DTD -> no errors
  • deployed the webProj.war standalone to Glassfish -> deploys without errors

The structure of the war project:

webProj.war
| - some stuff (images, css, js, etc)
| - META-INF
| - WEB-INF
    | - lib
        | - struts.jar (an others)
    | - struts-config.xml
    | - struts-config_1_2.dtd
    | - glassfish-web.xml
    | - web.xml

Does anyone have a clue what is missing or where I can check any further configuration? Any help is greatly appreciated! Thank you!

1

1 Answers

0
votes

Okay, this gave me the hint to the solution: Maven - Creating Skinny WARs

I have to put every lib from the wars WEB-INF/lib forlder to the ears lib folder to be found. Meaning - as described in the Maven page - that I have to set the scope of all dependencies used by the war to <scope>provided</scope> and add the dependencies to this jars in the pom.xml, which packs the ear.

So the ear package has to look like this:

ear
| - /lib
    |- someProject.jar (used by confictEJB and EJB)
    |- struts.jar
| - confictEJB.jar
| - EJB.jar
| - webProj.war