views:

40

answers:

1

I am trying to deploy my war to GlassFish (works fine in JBoss). GlassFish fails to deploy with this message.

[#|2010-09-23T15:49:00.609-0400|SEVERE|glassfish3.0.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=24;_ThreadName=Thread-1;|DPL8015: Invalid Deployment Descriptors in Deployment descriptor file WEB-INF/web.xml in archive [erdas-apollo.war]. Line 247 Column 16 -- cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"http://java.sun.com/xml/ns/j2ee":dispatcher}' is expected.|#]

[#|2010-09-23T15:49:00.609-0400|SEVERE|glassfish3.0.1|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=24;_ThreadName=Thread-1;|DPL8005: Deployment Descriptor parsing failure : cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"http://java.sun.com/xml/ns/j2ee":dispatcher}' is expected.|#]

[#|2010-09-23T15:49:00.610-0400|SEVERE|glassfish3.0.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=24;_ThreadName=Thread-1;|Exception while deploying the app java.io.IOException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"http://java.sun.com/xml/ns/j2ee":dispatcher}' is expected. at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170) at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79) at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612) at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"http://java.sun.com/xml/ns/j2ee":dispatcher}' is expected. at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:304) at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:225) at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:614) at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:366) at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:238) at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:247) at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:208) at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:148) at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:162) ... 31 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'. One of '{"http://java.sun.com/xml/ns/j2ee":dispatcher}' is expected. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1805) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:298) ... 39 more |#]

I've combed through the xml schema definition, and am unclear what it is choking on.

I've stripped out all of the url-patterns from the document:

163: <url-pattern>/ws/security/authserver</url-pattern>
169: <url-pattern>/vtor/*</url-pattern>
173: <url-pattern>/ap/*</url-pattern>
177: <url-pattern>/cover/*</url-pattern>
181: <url-pattern>/proc/*</url-pattern>
185: <url-pattern>/em/proxy</url-pattern>
189: <url-pattern>/ctent/*</url-pattern>
193: <url-pattern>/sces/*</url-pattern>
197: <url-pattern>/cat/services/*</url-pattern>
201: <url-pattern>/cat/wrs/*</url-pattern>
207: <url-pattern>/em/czs/*</url-pattern>
212: <url-pattern>/em/quartz/*</url-pattern>
217: <url-pattern>/em/masking</url-pattern>
222: <url-pattern>/min/*</url-pattern>
246: <url-pattern>/min/*</url-pattern>
247: <url-pattern>/sces/rpc</url-pattern>
256: <url-pattern>/cover/E/*</url-pattern>
257: <url-pattern>/cat/csw</url-pattern>
262: <url-pattern>/cover/E_PUBLIC</url-pattern>
314: <url-pattern>/cat/*</url-pattern>
318: <url-pattern>/ctent/*</url-pattern>
331: <url-pattern>/cat/csw/*</url-pattern>
335: <url-pattern>/cat/content/*</url-pattern>
339: <url-pattern>/cat/*</url-pattern>
348: <url-pattern>/min/*</url-pattern>
A: 

It looks like you may have an entry in the web.xml file that is invalid.

Do you have a filter definition that has something like:

<filter-name>Foo</filter-name>
<servlet-name>FooServlet</servlet-name>
<url-pattern>BLAHBLAHBLAH</url-pattern>
<dispatcher>FORWARD</dispatcher>

That would be an illegal entry which could generate an error that reads like the one you are seeing.

vkraemer
I've stripped out all of the url-patterns in the document. These patterns work fine with JBoss.
Drew
@Drew... are you still stuck? Have you changed the focus of your question from "help me get past this SAXParseException" to "why did my original app work when deployed onto JBoss"
vkraemer
Not really, since there is no information about why an app would work in JBoss but not GlassFish. Chasing down web.xml errors appears to be more useful, and possibly leads to coding errors that JBoss is gracefully failing on.
Drew
If I remove <url-pattern>/services/rpc</url-pattern> it stops complaining about url-pattern and about <servlet-name>. Anything wrong with that name?
Drew
@Drew... I think the schema says that you can have a servlet-name OR and url-pattern in the filter element. So, the name was not not an issue.
vkraemer