Grails

Deployment fails on Weblogic due to duplicate web.xml entry.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Duplicate
  • Affects Version/s: 1.2 final
  • Fix Version/s: 1.2.1
  • Component/s: Configuration
  • Labels:
    None
  • Environment:
    Weblogic 9.2

Description

I am currently seeing the following problem when deploying a Grails 1.2.0 application to weblogic 9.2:

[HTTP:101064][WebAppModule(simple-app:simple-app.war)] Error parsing
descriptor in Web appplication
"C:\SrvApps\wlsdomains\wls920\INT-WLS920_01\.\applications\simple-app.war"
.
.
.
Bean already exists:
"weblogic.j2ee.descriptor.ErrorPageBeanImpl@fa126(/ErrorPages[500])"

This is new since 1.2.0 - 1.1.2 works fine.

I believe this is due to a duplicate <error-page> tag in the web.xml that Weblogic is fussier than Tomcat about.

Unfortunately, this part of the web.xml is not in the template, so there is no simple workaround at present using templates.

Issue Links

Activity

Hide
Wolfgang Schell added a comment -

If this error you see is actually caused by the duplicate error-page element, than this issue is a duplicate of GRAILS-5642

Show
Wolfgang Schell added a comment - If this error you see is actually caused by the duplicate error-page element, than this issue is a duplicate of GRAILS-5642
Hide
Steve Dalton added a comment -

My apologies... you are quite right... duplicate.

Show
Steve Dalton added a comment - My apologies... you are quite right... duplicate.
Hide
Steve Dalton added a comment - - edited

This is my current work around for scripts/_Events.groovy if it's of any use to anyone... I'm sure there's prettier ways to do it - but it works

scripts/_Events.groovy
import groovy.xml.StreamingMarkupBuilder
import groovy.util.slurpersupport.GPathResult

eventWebXmlEnd = {String webXml ->
    GPathResult root
    webXmlFile.withInputStream {inStr ->
        root = new XmlSlurper().parse(inStr);
    }
    
    def errorPage = root.'error-page'

    // If there are more than 1 error page entries - delete all but the first
    errorPage.eachWithIndex {item, i ->
        if (i != 0) item.replaceNode {}
    }

    webXmlFile.text = new StreamingMarkupBuilder().bind {
        mkp.declareNamespace("": "http://java.sun.com/xml/ns/j2ee")
        mkp.yield(root)
    }
}
Show
Steve Dalton added a comment - - edited This is my current work around for scripts/_Events.groovy if it's of any use to anyone... I'm sure there's prettier ways to do it - but it works
scripts/_Events.groovy
import groovy.xml.StreamingMarkupBuilder
import groovy.util.slurpersupport.GPathResult

eventWebXmlEnd = {String webXml ->
    GPathResult root
    webXmlFile.withInputStream {inStr ->
        root = new XmlSlurper().parse(inStr);
    }
    
    def errorPage = root.'error-page'

    // If there are more than 1 error page entries - delete all but the first
    errorPage.eachWithIndex {item, i ->
        if (i != 0) item.replaceNode {}
    }

    webXmlFile.text = new StreamingMarkupBuilder().bind {
        mkp.declareNamespace("": "http://java.sun.com/xml/ns/j2ee")
        mkp.yield(root)
    }
}
Hide
Mike Brevoort added a comment - - edited

fyi happens on Weblogic 10.3 as well and workaround does in fact allow deployment

Show
Mike Brevoort added a comment - - edited fyi happens on Weblogic 10.3 as well and workaround does in fact allow deployment
Hide
Graeme Rocher added a comment -

duplicates GRAILS-5642

Show
Graeme Rocher added a comment - duplicates GRAILS-5642

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: