]
Brian Stansberry updated AS7-4697:
----------------------------------
Assignee: (was: Brian Stansberry)
Fix Version/s: (was: 7.2.0.Alpha1)
I don't see us doing this for the reasons described above. I'm leaving the JIRA
open because it's a reasonable request and one we should keep in mind.
Support general XML Entities in AS boot configuration
-----------------------------------------------------
Key: AS7-4697
URL:
https://issues.jboss.org/browse/AS7-4697
Project: Application Server 7
Issue Type: Feature Request
Components: Domain Management
Affects Versions: 7.1.1.Final
Environment: Fedora 16, plenty of memory, disk, etc; feature is not related to
environment
Reporter: Michael Epley
The parser for the AS7 boot configuration (tested with standalone.xml) does not permit
the use of general XML entities, as it fails [1] on the parsing of the entity declaration
[2]. This appears due to the use of a low level parser enforcing certain expectations in
the XML file layout.
Use of XML external entities is a method that allows the single boot configuration file
to be broken into multiple, independent pieces so that they can be independently
contributed (by different developers/teams), controlled (by different developers/teams),
configuration managed, or use substituted (for different dev/test/stage/prod)
configurations. This is a common business requirement, with larger applications, different
developers or sub teams usually contribute or have ownership over different subsystems, or
that each contribute some portion of a subsystem.
For example, two developers may each use a different JDBC datasource, and a third
deployment engineer may be responsible for controlling the main boot configuration to
ensure application integrity. Use of XML entities would allow the deployment engineer to
write portions of the boot configuration (eg. standalone.xml) such as:
...
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
&developer1datasource;
&developer2datasource;
</datasources>
</subsystem>
...
where &developer1datasource &developer2datasource might be declared as
<!ENTITY developer1datasource SYSTEM "alicesDatasource.xml" >
<!ENTITY developer2datasource SYSTEM "bobsDatasource.xml" >
and the file alicesDatasource.xml is owned/maintained by developer Alice, and the the
file bobsDatasource.xml is owned/maintained by developer Bob.
____________________________________________________________________
[1] For example, on boot, the following is reported:
08:52:51,181 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot:
org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed
to parse configuration
at
org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141)
[jboss-as-controller-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
at org.jboss.as.server.ServerService.boot(ServerService.java:268)
[jboss-as-server-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
at
org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155)
[jboss-as-controller-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[6,4]
Message: found: DTD, expected START_ELEMENT or END_ELEMENT
at
com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.nextTag(XMLStreamReaderImpl.java:1246)
[rt.jar:1.6.0_24]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:67)
[staxmapper-1.1.0.Final-redhat-1.jar:1.1.0.Final-redhat-1]
at
org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133)
[jboss-as-controller-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
... 3 more
08:52:51,185 FATAL [org.jboss.as.server] JBAS015957: Server boot has failed in an
unrecoverable manner; exiting. See previous messages for details.
[2] Tested with the following entity declaration in standalone.xml (and various other
combinations):
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE server [
<!ENTITY datasources SYSTEM "datasources.xml" >
<!ENTITY cacheDefinitions SYSTEM "caches.xml" >
] >
<server xmlns="urn:jboss:domain:1.3">
<extensions>
...
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
&datasources;
</subsystem>
...
<subsystem xmlns="urn:jboss:domain:infinispan:1.3"
default-cache-container="local">
&cacheDefinitions;
</subsystem>
...
</socket-binding-group>
</server>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: