]
Brian Stansberry commented on AS7-4697:
---------------------------------------
This could only be supported for a file we read at boot and then ignore thereafter (which
is a feature I'm considering for 7.2). We're not going to try and support writing
back to various locations when post-boot changes are made via the management APIs.
And even for that, supporting it for the core document would be distinct from supporting
it within a subsystem config. Each extension has its own parser. I don't see us
imposing a requirement to support this on extensions external to the AS codebase. And as a
practical matter supporting it in all the extensions inside the AS codebase would be a
fairly low priority.
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
Assignee: Brian Stansberry
Fix For: 7.2.0.Alpha1
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: