Oracle JNDI connection with JBOSS-EAP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Oracle JNDI connection with JBOSS-EAP

Ian Turton
I'm getting a strange error when trying to connect to an Oracle DB using JNDI inside a JBOSS-EAP server. 

2013-11-25 13:33:54,046 DEBUG [org.geotools.factory] - Factory implementations for category UnWrapper:
  org.geoserver.data.jdbc.SpringUnWrapper
  org.geotools.data.jdbc.datasource.DBCPUnWrapper
  org.geotools.jdbc.LifecycleConnectionUnWrapper
2013-11-25 13:33:54,054 WARN [org.geotools.jdbc] - Failed to use SDO_TUNE.EXTENT_OF, falling back on envelope aggregation
java.sql.SQLException: Could not obtain native oracle connection for class org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:565)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:502)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:492)
at org.geotools.data.oracle.OracleDialect.getOptimizedBounds(OracleDialect.java:754)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1141)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:501)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:189)

The rest of the log is attached. 

Interestingly the connection works fine if I use the normal Oracle Datastore (with the same jar - which is an updated version for 11.2 rather than the one that ships with GeoServer).

Has anyone seen anything similar or got any hints as to how I can go about debugging further?

cheers

Ian

--
Ian Turton

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

ian.txt (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Oracle JNDI connection with JBOSS-EAP

geowolf
On Mon, Nov 25, 2013 at 2:58 PM, Ian Turton <[hidden email]> wrote:
I'm getting a strange error when trying to connect to an Oracle DB using JNDI inside a JBOSS-EAP server. 

2013-11-25 13:33:54,046 DEBUG [org.geotools.factory] - Factory implementations for category UnWrapper:
  org.geoserver.data.jdbc.SpringUnWrapper
  org.geotools.data.jdbc.datasource.DBCPUnWrapper
  org.geotools.jdbc.LifecycleConnectionUnWrapper
2013-11-25 13:33:54,054 WARN [org.geotools.jdbc] - Failed to use SDO_TUNE.EXTENT_OF, falling back on envelope aggregation
java.sql.SQLException: Could not obtain native oracle connection for class org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:565)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:502)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:492)
at org.geotools.data.oracle.OracleDialect.getOptimizedBounds(OracleDialect.java:754)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1141)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:501)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:189)

The rest of the log is attached. 

Interestingly the connection works fine if I use the normal Oracle Datastore (with the same jar - which is an updated version for 11.2 rather than the one that ships with GeoServer).

Has anyone seen anything similar or got any hints as to how I can go about debugging further?

In order to read Oracle geometries we need to original Oracle connection.
All connection pools wrap the native connections with some pooling wrapper, and we have a list
of objects implementing org.geotools.data.jdbc.datasource.UnWrapper that know how to unwrap
specific pooled connections. 
I guess we don't have one for the JBOSS pools.
Mind, if you want to add one, make sure you're using reflection to avoid the code to be dependent on the
JBoss jars.

Cheers
Andrea


--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549


-------------------------------------------------------

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Oracle JNDI connection with JBOSS-EAP

geowolf
By the way, we get a number of these un-wrappers from Spring, maybe upgrading to a more
recent version of Spring will help (we do have an unwrapper for JBoss already, but I guess it's too old for your JBoss version?):

Which is something I've been thinking about lately, that is, upgrading trunk to Spring 3.2.
Maybe you have a look at how hard the upgrade is?

Cheers
Andrea



On Mon, Nov 25, 2013 at 3:12 PM, Andrea Aime <[hidden email]> wrote:
On Mon, Nov 25, 2013 at 2:58 PM, Ian Turton <[hidden email]> wrote:
I'm getting a strange error when trying to connect to an Oracle DB using JNDI inside a JBOSS-EAP server. 

2013-11-25 13:33:54,046 DEBUG [org.geotools.factory] - Factory implementations for category UnWrapper:
  org.geoserver.data.jdbc.SpringUnWrapper
  org.geotools.data.jdbc.datasource.DBCPUnWrapper
  org.geotools.jdbc.LifecycleConnectionUnWrapper
2013-11-25 13:33:54,054 WARN [org.geotools.jdbc] - Failed to use SDO_TUNE.EXTENT_OF, falling back on envelope aggregation
java.sql.SQLException: Could not obtain native oracle connection for class org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:565)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:502)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:492)
at org.geotools.data.oracle.OracleDialect.getOptimizedBounds(OracleDialect.java:754)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1141)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:501)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:189)

The rest of the log is attached. 

Interestingly the connection works fine if I use the normal Oracle Datastore (with the same jar - which is an updated version for 11.2 rather than the one that ships with GeoServer).

Has anyone seen anything similar or got any hints as to how I can go about debugging further?

In order to read Oracle geometries we need to original Oracle connection.
All connection pools wrap the native connections with some pooling wrapper, and we have a list
of objects implementing org.geotools.data.jdbc.datasource.UnWrapper that know how to unwrap
specific pooled connections. 
I guess we don't have one for the JBOSS pools.
Mind, if you want to add one, make sure you're using reflection to avoid the code to be dependent on the
JBoss jars.

Cheers
Andrea


--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313
fax: <a href="tel:%2B39%200584%201660272" value="+3905841660272" target="_blank">+39 0584 1660272
mob: <a href="tel:%2B39%20%C2%A0339%208844549" value="+393398844549" target="_blank">+39  339 8844549


-------------------------------------------------------



--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549


-------------------------------------------------------

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Oracle JNDI connection with JBOSS-EAP

Ian Turton
Thanks for that - a whole chunk of spring I had no idea existed. Allegedly the unwrapper geoserver ships with should work with my version of JBoss so I've kicked it back over the fence to the red Hat guys to see if they can fix it.

Ian


On 25 November 2013 14:16, Andrea Aime <[hidden email]> wrote:
By the way, we get a number of these un-wrappers from Spring, maybe upgrading to a more
recent version of Spring will help (we do have an unwrapper for JBoss already, but I guess it's too old for your JBoss version?):

Which is something I've been thinking about lately, that is, upgrading trunk to Spring 3.2.
Maybe you have a look at how hard the upgrade is?

Cheers
Andrea



On Mon, Nov 25, 2013 at 3:12 PM, Andrea Aime <[hidden email]> wrote:
On Mon, Nov 25, 2013 at 2:58 PM, Ian Turton <[hidden email]> wrote:
I'm getting a strange error when trying to connect to an Oracle DB using JNDI inside a JBOSS-EAP server. 

2013-11-25 13:33:54,046 DEBUG [org.geotools.factory] - Factory implementations for category UnWrapper:
  org.geoserver.data.jdbc.SpringUnWrapper
  org.geotools.data.jdbc.datasource.DBCPUnWrapper
  org.geotools.jdbc.LifecycleConnectionUnWrapper
2013-11-25 13:33:54,054 WARN [org.geotools.jdbc] - Failed to use SDO_TUNE.EXTENT_OF, falling back on envelope aggregation
java.sql.SQLException: Could not obtain native oracle connection for class org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:565)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:502)
at org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:492)
at org.geotools.data.oracle.OracleDialect.getOptimizedBounds(OracleDialect.java:754)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1141)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:501)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:189)

The rest of the log is attached. 

Interestingly the connection works fine if I use the normal Oracle Datastore (with the same jar - which is an updated version for 11.2 rather than the one that ships with GeoServer).

Has anyone seen anything similar or got any hints as to how I can go about debugging further?

In order to read Oracle geometries we need to original Oracle connection.
All connection pools wrap the native connections with some pooling wrapper, and we have a list
of objects implementing org.geotools.data.jdbc.datasource.UnWrapper that know how to unwrap
specific pooled connections. 
I guess we don't have one for the JBOSS pools.
Mind, if you want to add one, make sure you're using reflection to avoid the code to be dependent on the
JBoss jars.

Cheers
Andrea


--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313
fax: <a href="tel:%2B39%200584%201660272" value="+3905841660272" target="_blank">+39 0584 1660272
mob: <a href="tel:%2B39%20%C2%A0339%208844549" value="+393398844549" target="_blank">+39  339 8844549


-------------------------------------------------------



--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
==

Ing. Andrea Aime 
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313
fax: <a href="tel:%2B39%200584%201660272" value="+3905841660272" target="_blank">+39 0584 1660272
mob: <a href="tel:%2B39%20%C2%A0339%208844549" value="+393398844549" target="_blank">+39  339 8844549


-------------------------------------------------------



--
Ian Turton

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Oracle JNDI connection with JBOSS-EAP

Carlos Lacerda
Ian,

Just for reference of another thread  that I opened that maybe be duplicated:Oracle NG (JNDI) Driver with JBoss connection pool problem


Using the last Oracle Driver in JBoss 6.4 module, removing the same from geoserver.war and explicit included dependency of driver in jboss-deployment-descriptor.xml included in geoserver.war JNDI works fine. Below my jboss-deployment-descriptor.xml used in geoserver.war:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <deployment>
                <dependencies>
                        <module name="com.oracle.jdbc" />
                </dependencies>
                <local-last value="true" />
        </deployment>
</jboss-deployment-structure>

The problem was solved, now I can use JNDI and non JNDI Oracle Stores in GeoServer with JBoss EAP 6.4 DataSource.

Thank you.