Jose Antonio created GEOT-4106:
----------------------------------
Summary: Could not obtain native oracle connection
Key: GEOT-4106
URL: https://jira.codehaus.org/browse/GEOT-4106
Project: GeoTools
Issue Type: Bug
Components: jdbc-oracle plugin
Affects Versions: 2.7.4
Environment: OS Windows 7 x64, Oracle 11.2.0.2.0, jdk1.6.0_27,
apache-tomcat-6.0.35
Reporter: Jose Antonio
Assignee: Andrea Aime
I'm using GeoTools 2.7.4, a oracle 11g DB, ojdbc14.jar, and a simple java code
on a Tomcat 6 like this:
{code}
Map map = new HashMap();
map.put( "dbtype", "oracle");
map.put( "jndiReferenceName", "java:comp/env/jdbc/GisDS");
OracleNGJNDIDataStoreFactory factory = new OracleNGJNDIDataStoreFactory();
log.info("Can process? "+ factory.canProcess(map));
store = factory.createDataStore(map);
SimpleFeatureSource featureSource = store.getFeatureSource(viewName);
log.info(featureSource.getFeatures().getBounds().toString());
{code}
And my context.xml:
{code}
<Resource name="jdbc/GisDS" auth="Container" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
accessToUnderlyingConnectionAllowed="true"
username="***" password="***"
url="***"
maxActive="25" maxIdle="8" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
poolPreparedStatements="true" maxOpenPreparedStatements="100"
validationQuery="SELECT SYSDATE FROM DUAL"/>
{code}
And I always get the "Could not obtain native oracle connection" error:
{code}
java.lang.RuntimeException: java.io.IOException: Error occured calculating
bounds
at
org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:485)
at
org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:179)
at
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:370)
at
org.geotools.data.store.ContentFeatureCollection.getBounds(ContentFeatureCollection.java:274)
at ***.GisServlet.doGet(GisServlet.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Error occured calculating bounds
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1137)
at
org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:478)
... 19 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection for
class org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper
at
org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:490)
at
org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:434)
at
org.geotools.data.oracle.OracleDialect.readGeometry(OracleDialect.java:424)
at
org.geotools.data.oracle.OracleDialect.decodeGeometryEnvelope(OracleDialect.java:371)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1123)
... 20 more
{code}
I've tried to connect to a 10g DB, I've tried using the ojdbc6, and I always
end with the same result.
The strange is, the featureSource.getFeatures().size() works.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel