[
https://jira.jboss.org/jira/browse/JBDEPLOY-55?page=com.atlassian.jira.pl...
]
Darryl Miles commented on JBDEPLOY-55:
--------------------------------------
Thank you for your work in looking into this matter.
Just to clarify....
"my objection was not that *-beans.xml was being looked at"
....but that....
"*-beans.xml was being looked at AND the file was syntactically correct AND the file
(clearly) has an XSD schema that does not describe a JBoss descriptor"
With all these conditions being met, JBoss should gracefully handle the fact that the file
is not of the correct type (as in XSD schema) and allow the deployment to continue to a
successful conclusion. I'd have no objection to it emitting a single line log entry
indicating that it looked at the file but found a foreign XSD schema so skipped the file.
The above handles the "grey area" in a way that is flexible and if every
sub-system did the same thing would result in co-operation (rather than conflict) mainly
through the use of the XSD schema to dictate the true owner/user of the file.
I am also more than happy that JBoss may own all the content it sees inside the files
"*/*jboss-beans.xml" meaning that JBoss may bail-out of the deployment if files
of that name contain syntactically incorrect data OR have no supported JBoss XSD schema OR
are invalid XML for the default DTD (when no XSD is being used).
Your other points in relation to JBoss's use of Xerces and the cryptic messages.
I really don't know what you mean by I didn't post the full message. There was no
other message or information, infact this is part of my concern here is in
"JBoss's use of Xerces" resulting in this unusable and cryptic error message
being emitted. Why would I need/want to "turn off Xerces validation?" if
Xerces was truly validating that file it would find no error, the file was syntactically
correct for the XSD type "http://www.springframework.org/schema/beans".
It is my belief that the error message:
vfsfile:/data/opt/jboss-5.0.0.CR1/server/default/deploy/MyApplication.war/ ->
org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 1:55 White spaces are required between
publicId and systemId.
Was made more cryptic by "JBoss's use of Xerces" by not furnishing Xerces
with all the correct information to be able to correctly report a more useful version of
that message to include the exact file from vfsfile it was looking at, also the line
number, column number information. The first obvious thing missing is the file it was
working on from inside the WAR, this is often reported in Java like:
vfsfile:/data/opt/jboss-5.0.0.CR1/server/default/deploy/MyApplication.war!/WEB-INF/spring-beans.xml
Maybe this can be extended for vfsfile cases like:
vfsfile:/data/opt/jboss-5.0.0.CR1/server/default/deploy/MyApplication.war!/WEB-INF/lib/MyJar.jar!/com/foobar/spring-beans.xml
As you can imagine when you are trying to resolve why your deployment simply isn't
working knowing the exact file the Xerces parser is working on when it bailed out with an
error is extremely important. I guess this is a VFS issue more than a deployment issue.
The MC parsing deployer should only accept *jboss-beans.xml in
META-INF/WEB-INF
-------------------------------------------------------------------------------
Key: JBDEPLOY-55
URL:
https://jira.jboss.org/jira/browse/JBDEPLOY-55
Project: JBoss Deployers
Issue Type: Bug
Components: parsing
Affects Versions: JBDEPLOY-2.0.0.Beta18
Environment: JBoss 5.0.0.CR1 (JDK6)
Reporter: Darryl Miles
Fix For: JBDEPLOY-2.0.0.Beta20
I hope I have the correct component.
When deploying a WAR to JBoss AS 5.0.0.CR1 I have a file: /WEB-INF/spring-beans.xml
(which works perfectly outside of JBoss) which has the following outer element :
<?xml version="1.0" encoding="UTF-8" ?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:flow="http://www.springframework.org/schema/webflow-config"
xmlns:seam="http://jboss.com/products/seam/spring-seam"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-confi...
http://jboss.com/products/seam/spring
http://jboss.com/products/seam/spring-seam-2.0.xsd">
But JBoss deployer signals an error:
vfsfile:/data/opt/jboss-5.0.0.CR1/server/default/deploy/MyApplication.war/ ->
org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 1:55 White spaces are required between
publicId and systemId.
at
org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:676)
at
org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
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:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
I have run the debugging on
Like it is trying to process it (as a DTD document).
There are 4 points I'd like to make here:
1) Despite the name of the file (ending with "-beans.xml") the XML content of
the file _CLEARLY_ and _UNAMBIGUOUSLY_ describes the format of the file content and the
component/sub-system that owns the configuration. That being the namespace
"http://www.springframework.org/schema/beans". Whatever JBoss deployer is
picking up the "-beans.xml" file should immediately see that it doesn't own
the file, nor have any prior rights to the file.
2) The file clearly using XSD notation (not DTD notation) so the parser should have
detected this situation, not accidentally parsed it as XML XSD.
3) The exception does not describe the file is was working on at the time, sure it tells
you what the problem is, but not where is it (which file it was processing).
4) I'm of the opinion that WAR files should (by default) work perfectly well inside
JBoss as they do outside JBoss, so in the situation like this where JBoss is attempting to
be helpful it should do its best to detect that this not what the user had intended. If
JBoss specific descriptors are to be included inside other deployable units (i.e. a WAR)
then either the XML file must have the correct JBoss specific schema/namespace at the top
of the file, or the filename must be ear marked thru configuration or filename prefix like
"jboss-" as being inspectable by the App Server (as opposed to the Servlet
Container)
--
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