Can we use jboss-ds_5_0.xsd files for the DataSource XML file Validation ?

Solution Unverified - Updated -

Issue

  • JBoss does not deploy the DataSource XML file if we use the Name Space Profic as (jboss: or anything else) before the tags, Which causes issues if we generate the DataSource XML files using some XML generator tools like eclipse or XMLSpy based on the Tags mentioned in the DataSource XSD file provided as part of "$JBOSS_HOME/docs/schema/jboss-xa-ds_5_0.xsd" files.

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> 

Environment

  • JBoss Enterprise Application Platform 5.1 x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content