Kris Geusebroek ha scritto:
> Hi all,
>
> Cheered too soon i think.
> After removing the schema definition form the catalog.xml completely
> (emptying the value was not enough)
>
> It seems websphere is able to get the tables form the db but when
> creating a feature type I get the error:
>
> Could not obtain native oracle connection for class
> com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
> Andrea mentioned the unwrappers that were needed.
> Is this the case in my configuration?
Yes. It seems we don't have an unwrapper for that connection pool,
or that the ones we have do not work for some reason.
Yet many operations related to geometries in Oracle do not work
unless you get your hands on the native connection.
> I found someone reporting the use of
>
> ds = (DataSource) ctx.lookup("java:comp/env/" + dataSource);
>
> WSJdbcConnection conn = (WSJdbcConnection) ds.getConnection();
> con = (OracleConnection)
> WSJdbcUtil.getNativ-eConnection((WSJdbcC-onnection) conn);
>
> to fix this but I don't know if that is used in geoserver code
>
> Is there a configuration change I can make to fix this or do I need java
> code?
It needs java code, and it's not trivial to integrate with GeoServer
since it depends on WebSphere specific jars (with the dependency
and redistribution issues that go along with them). Usually
reflection is used to be able and compile those without actually
having the pool specific classes in the classpath.
Actually GeoServer 1.7.5 should ship with all the Spring unwrappers,
and there is one dedicated to WebSphere, the javadocs inside
of it talk about WebSphere 5, but it seems the API calls are
the one you mentioned above (just harder to read because of
reflection):
---------------------------------------------------------------
private static final String JDBC_ADAPTER_CONNECTION_NAME_5 =
"com.ibm.ws.rsadapter.jdbc.WSJdbcConnection";
private static final String JDBC_ADAPTER_UTIL_NAME_5 =
"com.ibm.ws.rsadapter.jdbc.WSJdbcUtil";
private Class webSphere5ConnectionClass;
private Method webSphere5NativeConnectionMethod;
/**
* This constructor retrieves WebSphere JDBC adapter classes,
* so we can get the underlying vendor connection using reflection.
*/
public WebSphereNativeJdbcExtractor() {
try {
this.webSphere5ConnectionClass =
getClass().getClassLoader().loadClass(JDBC_ADAPTER_CONNECTION_NAME_5);
Class jdbcAdapterUtilClass =
getClass().getClassLoader().loadClass(JDBC_ADAPTER_UTIL_NAME_5);
this.webSphere5NativeConnectionMethod =
jdbcAdapterUtilClass.getMethod("getNativeConnection", new Class[]
{this.webSphere5ConnectionClass});
}
catch (Exception ex) {
throw new IllegalStateException(
"Could not initialize WebSphereNativeJdbcExtractor because
WebSphere API classes are not available: " + ex);
}
}
---------------------------------------------------------------
The spring unwrappers are actually the ones that make the Tomcat
JNDI example work, since Tomcat has its own modified version of
DBCP that only those can handle.
So... I don't know why they are not working in your case.
I'll add a jira to get better logging out of the Spring unwrappers,
at the moment they silently skip all of the unwrappers that do
fail to load.
A shot in the dark: are you sure GeoServer is allowed to see
the com.ibm.ws.rsadapter.jdbc.WSJdbcUtil class? Maybe some
classloader magic is needed?
Cheers
Andrea
--
Andrea Aime
OpenGeo -
http://opengeo.orgExpert service straight from the developers.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at:
http://p.sf.net/sfu/Challenge_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users