Failed to link oracle.xdb.XMLTypeFactory using deployed driver jar

Latest response

We are using JBOSS EAP 6.3 and oracle 11g database. We have configured XADataSource in JBOSS configuration file (standalone-full.xml). If we used oracle driver as a module then we are able to fetch XML Message from the database. If we have deployed the oracle ojdbc.jar using JBOSS console, we are not able to get XML message from the database and facing following exception. Working and non working samples are also shared in the below message.
Caused by: java.lang.LinkageError: Failed to link oracle/xdb/XMLTypeFactory (Module "component-service.ear:main" from Service Module Loader)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92)
at org.jboss.modules.Module.loadModuleClass(Module.java:568)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at oracle.jdbc.driver.ClassRef.get(ClassRef.java:92)
at oracle.jdbc.driver.OracleConnection.getClassForType(OracleConnection.java:465)
at oracle.sql.OpaqueDescriptor.getClass(OpaqueDescriptor.java:473)
at oracle.sql.OPAQUE.toJdbc(OPAQUE.java:330)
at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:193)
at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:123)
at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:1108)
at oracle.jdbc.driver.OracleResultSet.getObject(OracleResultSet.java:462)
at org.jboss.jca.adapters.jdbc.WrappedResultSet.getObject(WrappedResultSet.java:1199)
... 104 more
Caused by: java.lang.NoClassDefFoundError: oracle/sql/ORADataFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482)
... 123 more
Caused by: java.lang.ClassNotFoundException: oracle.sql.ORADataFactory from [Module "compnent-service.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
... 127 more

Working configuration sample

<xa-datasource jndi-name="java:jboss/datasources/xxxx" pool-name="xxxDS" enabled="true" use-java-context="true" use-ccm="true">
                    <xa-datasource-property name="URL">
                        jdbc:oracle:thin://@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = port))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = serviceName)))
                    </xa-datasource-property>
                    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
                    <driver>oracle</driver>
                    <xa-pool>
                        <is-same-rm-override>false</is-same-rm-override>
                        <interleaving>false</interleaving>
                        <no-tx-separate-pools>true</no-tx-separate-pools>
                        <pad-xid>false</pad-xid>
                        <wrap-xa-resource>false</wrap-xa-resource>
                    </xa-pool>
                    <security>
                        <user-name>user</user-name>
                        <password>password</password>
                    </security>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>true</background-validation>
                        <background-validation-millis>10000</background-validation-millis>
                        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
                    </validation>
                    <timeout>
                        <set-tx-query-timeout>false</set-tx-query-timeout>
                        <blocking-timeout-millis>0</blocking-timeout-millis>
                        <idle-timeout-minutes>0</idle-timeout-minutes>
                        <query-timeout>0</query-timeout>
                        <use-try-lock>0</use-try-lock>
                        <allocation-retry>0</allocation-retry>
                        <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
                        <xa-resource-timeout>0</xa-resource-timeout>
                    </timeout>
                    <statement>
                        <track-statements>false</track-statements>
                        <share-prepared-statements>false</share-prepared-statements>
                    </statement>
                </xa-datasource>
                <drivers>
                             <driver name="oracle" module="com.oracle">
                        <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
                    </driver>
                </drivers>



Non working code from standalone-full.xml


<datasources>
                <xa-datasource jndi-name="java:jboss/datasources/xxxx" pool-name="xxxDS" enabled="true" use-java-context="true" use-ccm="true">
                    <xa-datasource-property name="URL">
                        jdbc:oracle:thin://@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = port))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = serviceName)))
                    </xa-datasource-property>
                    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
                    <driver>ojdbc6.jar</driver>
                    <xa-pool>
                        <is-same-rm-override>false</is-same-rm-override>
                        <interleaving>false</interleaving>
                        <no-tx-separate-pools>true</no-tx-separate-pools>
                        <pad-xid>false</pad-xid>
                        <wrap-xa-resource>false</wrap-xa-resource>
                    </xa-pool>
                    <security>
                        <user-name>user</user-name>
                        <password>pssword</password>
                    </security>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>true</background-validation>
                        <background-validation-millis>10000</background-validation-millis>
                        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
                    </validation>
                    <timeout>
                        <set-tx-query-timeout>false</set-tx-query-timeout>
                        <blocking-timeout-millis>0</blocking-timeout-millis>
                        <idle-timeout-minutes>0</idle-timeout-minutes>
                        <query-timeout>0</query-timeout>
                        <use-try-lock>0</use-try-lock>
                        <allocation-retry>0</allocation-retry>
                        <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
                        <xa-resource-timeout>0</xa-resource-timeout>
                    </timeout>
                    <statement>
                        <track-statements>false</track-statements>
                        <share-prepared-statements>false</share-prepared-statements>
                    </statement>
                </xa-datasource>
            </datasources>

.
.
.
.
 <deployment name="ojdbc6.jar" runtime-name="ojdbc6.jar">
            <content sha1="8d98e89385dafc7e1b8a2cfc1e016deb21246236"/>
        </deployment>

Appreciate your help and time.

Thanks.

Responses