Details
-
Bug
-
Resolution: Done
-
Major
-
EAP_EWP 5.1.0
-
None
-
JBoss EAP 5.1
-
Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration
-
Medium
-
The XML Schema Declaration "jboss-xa-ds.xml" has been removed. All data source deployments in EAP 5.1.x should use the jboss-ds_5_1.dtd instead.
-
Documented as Resolved Issue
-
NEW
Description
JBoss EAP 5.1 does not deploy a DataSource XML file if we use a valid Schema. Also if we use a valid Schema provided as part of JBoss EAP 5.1 "jboss-ds_5_0.xsd" with different namespace prefix or using "jboss" (as default prefix) then it ignores the DataSource configuration.
So either remove the XSD (jboss-ds_5_0.xsd) from the EAP installation or need to provide the Validation mechanism of Data Source configuration against the Schema so that the JBoss EAP can deploy the DataSource configuration as mentioned in the following XMLs:
If we create 3 DataSources for example:
NON-WORKING Scenario-1). The Jboss does not detect the DataSource file is placed inside the "deploy" directory or not hence the we don;t see anything binded in the JBoss Console output. Note here every DataSource tag is prefixed by "jboss:" prefix
oracle-xa-ds.xml
===================
<?xml version="1.0" encoding="UTF-8"?>
<jboss:datasources xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee">
<jboss:xa-datasource>
<jboss:jndi-name>testOne</jboss:jndi-name>
<jboss:xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</jboss:xa-datasource-class>
</jboss:xa-datasource>
</jboss:datasources>
NON-WORKING Scenario-2). The Jboss does not detect the DataSource file is placed inside the "deploy" directory or not, hence the we don't see anything binded in the JBoss Console output. Note Here the line which is changed is
[xmlns:jboss="http://www.jboss.com/xml/ns/javaee"] which is replaced by [xmlns="http://www.jboss.com/xml/ns/javaee"] means "jboss" prefix is removed.
oracle-xa-ds.xml
===================
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee">
<xa-datasource>
<jndi-name>testThree</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</xa-datasource>
</datasources>
WORKING Scenario-3). The Following works with Charm.... and as soon as we place the following XML data source file inside the "$PROFILE/deploy" directory ... Now as soon as we deploy it we can see the following kind of output immediately in JBoss Console output:
14:18:50,660 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=testTwo' to JNDI name 'java:testTwo'
oracle-xa-ds.xml
===================
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee">
<xa-datasource>
<jndi-name>testTwo</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</xa-datasource>
</datasources>
=========================================
Validation is also required for DataSource configuration files against the Schema because it does not throw any exception if we use an Invalid XML Tag inside the dataSource file:
Example: Following XML file gets deployed on JBoss even if it has an invalid Tag "background-validation-ABC"
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jboss="http://www.jboss.com/xml/ns/javaee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/j2ee/schema/jboss-ds_5_0.xsd http://www.jboss.com/xml/ns/javaee">
<xa-datasource>
<jndi-name>testXYZ</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<background-validation-ABC>100</background-validation-ABC>
</xa-datasource>
</datasources>