-
1. Re: Exception while storing data in Oracle XMLType column
jaysensharma Jan 21, 2016 12:12 PM (in response to jboss234)1 of 1 people found this helpfulThe same JBoss 4 based code will not run as it is in WildFly because some of the legacy classes are changed. Like "org.jboss.resource.adapter.jdbc.WrappedConnection" class does not exist anymore in WildFly.
So you should try something like following:
java.sql.Connection conn = dataSource.getConnection(); if (conn.isWrapperFor(OracleConnection.class)) { OracleConnection oracleConn = conn.unwrap(OracleConnection.class); XMLType xml = XMLType.createXML(oracleConn, dataAsInputStream); ... } else { // Your own logic as the connection is not Oracle connection. }
OR as an alternate approach you may try.
java.sql.Connection conn = dataSource.getConnection(); if (conn instanceof org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7) { org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7 wrappedConn = (org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7) conn; OracleConnection oracleConn = (OracleConnection) wrappedConn.getUnderlyingConnection(); XMLType xml = XMLType.createXML(oracleConn, dataAsInputStream); }
Regards
Jay SenSharma
-
2. Re: Exception while storing data in Oracle XMLType column
jboss234 Jan 22, 2016 5:37 PM (in response to jaysensharma)I am getting java.lang.ClassNotFoundException: org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7.
Looks like WrappedConnectionJDK7 class is not visible to EJB jar file.
Application structure,
EAR
l
l---- WAR
l---- EJB JAR
How to make the dependency JARs loaded by module visible to classes of EJB jar file within EAR.
Thanks,
-
3. Re: Exception while storing data in Oracle XMLType column
jaysensharma Jan 22, 2016 9:30 PM (in response to jboss234)1 of 1 people found this helpfulYou will need to add the "jboss-deployment-structure.xml" file something like following inside your "$EAR/META-INF" directory :
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.jboss.ironjacamar.jdbcadapters" slot="main" export="true"/>
<module name="com.oracle" export="true" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Regards
Jay SenSharma