[jboss-jira] [JBoss JIRA] Commented: (JBAS-7974) Deployment of a WAR application fails, when WEB-INF/jboss-app.xml references non-existing or corrupted dtd

Max Rydahl Andersen (JIRA) jira-events at lists.jboss.org
Thu May 6 04:13:06 EDT 2010


    [ https://jira.jboss.org/jira/browse/JBAS-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12529308#action_12529308 ] 

Max Rydahl Andersen commented on JBAS-7974:
-------------------------------------------

>> I'm inclined to reopen this since I learned that this file is a portal 2.x oddity which shares the same name with jboss-app.xml from AS but actually has its own (for reasons unknown to me) unpublished DTD 

>I don't know the implementation details of portal applications but they must not use jboss-app.xml name for anything else than JBoss-specific EAR deployment descriptor. 

But this is in a WAR not an EAR.

Note, this is bad by portal but it have been done in AS 4 and AS 3 for JBoss Portal as far as I can see.

>> Why (again) is AS 5 forcing validation by default on xml files it has no knowledge about ? 

>The AS does assume that it's a JBoss deployment descriptor and consequently it assumes that it does know what the possible content will be and how it is structured. 

Even though it is not in EAR ?

or does jboss-app.xml also apply for WAR's ?

>> Is this what will happen for *any* xml file with a non-accessible DTD or is it only for those which names overlap with other xml types (in this case jboss-app.xml ?). 

>It will happen to all (or most of the) deployment descriptors. Again, I don't know how portals are deployed. JBoss should never ?>try to connect to a remote host to get to the DTD or XSD. 
>All known schemas/dtds are registered in JBossEntityResolver (common-core project). XSD namespaces or DTD publicId are >mapped to the XSD/DTD files. During parsing when we see which namespace/publicId it is we know which xsd/dtd to use to >validate the xml. If the namespace/dtd is not registered then we use schemaLocation/systemId which may be a remote location. 
>Since there is no mention of JBoss portal schemas/dtd in JBossEntityResolver, it is trying to use the specified systemId. 

ok - but only because the file has the same name as deployment descriptor ? i.e. if I called it jboss-portal-app.xml things *should* be fine or is it for *any* xml file in META-INF ?

Just sounds very harsh rule since I would not expect having to modify my AS instance and put custom dtds/xsd's inside the app server for xml files that it doesn't need to care about for a deployment.

>There is also deployers/metadata-deployer-jboss-beans.xml where we map schemas/dtds to metadata classes. There is also no mention of JBoss portal. So, I don't know how they do it. 

I believe they put the DTD's inside AS 4 somewhere to be picked up.

Again, feels wrong that you have to edit AS internal metadata to allow xml files to exist in the app.

> i.e. even if we fix the reference to be jboss-app_2_6.dtd or even remove the DTD reference JBoss AS 5 still seems to complain about the file. 

> My point is that this situation (missing access to the DTD) should only be a warning, not an hard stop error. 

>IMO, no. Because the AS should know how to parse and validate its descriptors. If the DTD or XSD cannot be determined or found then something went wrong.

Yes, but in this case it is not a file AS should know about and the descriptor is not accessible, similar to what could happen if there is no external network access.

Anyway, sounds like AS 5 think it must do this even though the file is not in an EAR ...not allowing us to have a portal war app that can't be deployed to both AS 4 (JBoss Portal) and AS 5 (GateIn) :(

> Deployment of a WAR application fails, when WEB-INF/jboss-app.xml references non-existing or corrupted dtd
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-7974
>                 URL: https://jira.jboss.org/jira/browse/JBAS-7974
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Deployers
>    Affects Versions: JBossAS-5.1.0.GA
>            Reporter: Dominik Pospisil
>            Assignee: Alexey Loubyansky
>
> Deployment of a WAR application fails, when WEB-INF/jboss-app.xml references non-existing or corrupted dtd. Currentlly, jboss-portlet_2_6.dtd is unavailable for some reason and deployment of portlet applications containg jboss-app.xml fails.
> Example jboss-app.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE jboss-app PUBLIC 
> "-//JBoss Portal//DTD JBoss Web Application 2.6//EN" "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
> <jboss-app>
> 	<app-name>seamPortletApp</app-name>
> </jboss-app>
> Exception thrown when jboss-app.xml references corrupted URL:
> 14:00:48,751 ERROR [AbstractKernelController] Error installing to Parse: name=vfsfile:/home/dpospisi/workspaces/portal/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1272281146968/deploy/WebPrjTest.war/ state=Not Installed mode=Manual requiredState=Parse
> org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/home/dpospisi/workspaces/portal/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1272281146968/deploy/WebPrjTest.war/
> 	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
> 	at org.jboss.deployment.JBossAppParsingDeployer.createMetaData(JBossAppParsingDeployer.java:119)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234)
> 	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
> 	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
> 	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
> 	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
> 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
> 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
> 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
> 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
> 	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
> 	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
> 	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
> 	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> 	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: The markup declarations contained or pointed to by the document type declaration must be well-formed. @ http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd[1,1]
> 	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
> 	at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
> 	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
> 	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
> 	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
> 	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
> 	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
> 	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:348)
> 	... 29 more
> Caused by: org.xml.sax.SAXException: The markup declarations contained or pointed to by the document type declaration must be well-formed. @ http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd[1,1]
> 	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.fatalError(SaxJBossXBParser.java:432)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown Source)
> 	at org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDExternalSubset(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> 	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
> 	... 37 more
> Exception thrown when jboss-app.xml references non-existing URL:
> 13:35:52,455 ERROR [AbstractKernelController] Error installing to Parse: name=vfsfile:/home/dpospisi/workspaces/portal/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1272281146968/deploy/WebPrjTest.war/ state=Not Installed mode=Manual requiredState=Parse
> org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/home/dpospisi/workspaces/portal/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1272281146968/deploy/WebPrjTest.war/
> 	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
> 	at org.jboss.deployment.JBossAppParsingDeployer.createMetaData(JBossAppParsingDeployer.java:119)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234)
> 	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
> 	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
> 	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
> 	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
> 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
> 	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
> 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
> 	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
> 	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
> 	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
> 	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
> 	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
> 	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> 	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: http://www.ian.cz/gghwet
> 	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
> 	at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
> 	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
> 	at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
> 	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
> 	at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
> 	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:256)
> 	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:188)
> 	at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:348)
> 	... 29 more
> Caused by: java.io.FileNotFoundException: http://www.ian.cz/gghwet
> 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1303)
> 	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
> 	at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
> 	at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
> 	at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> 	at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
> 	... 37 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list