[Geoserver-users] JNDI configuration of datastores in Websphere

Hi,

I have successfully deployed geoserver with the oracle-ng plugin into websphere and managed to create a jdbc datasource which can be successfully pinged in Websphere also.

I’m struggling though to get it to work with my geoserver config.

Here’s what I have now:

  • A resource-ref section in the web.xml (following the example on the geoserver website)

Oracle datastore test

jdbc/test

javax.sql.DataSource

Container

  • A configured JDBC Provider with a classpath set to ojdbc14.jar of my oracle client installation directory with an implementation classname: oracle.jdbc.pool.OracleConnectionPoolDataSource

  • A datasource configuration

o Name: testJNDI

o JNDI Name: jdbc/testJNDI

o Use this datasource in CMP checked

o Oracle 10g data store helper

o Component-managed authentication alias selected

o And an url like: jdbc:oracle:thin:@(DESCRIPTION= etc)

  • Bound the resource ref to the concrete datasource definition on installing the geoserver war file with the default method for authentication (many-to-one) with the samemanaged authentication as above selected.

  • And in geoserver catalog.xml

After deploying this I cannot see my datastore in the list when I choose to add a new featureType so I configured a featureType manually but when accessing this featureType I get the following error:

Java.io.IOException: Schema ‘http://www.test.nl/JNDITABLENAME’ does not exist.

At org.geotools.data.store.ContentDataStoe.ensureEntry(ContentDataStore.java:555)

Etc.

What am I doing wrong here?

Cheers Kris

Kris Geusebroek ha scritto:

Java.io.IOException: Schema ‘http://www.test.nl/JNDITABLENAME’ does not exist.

At org.geotools.data.store.ContentDataStoe.ensureEntry(ContentDataStore.java:555)

Etc.

Hmmm... difficult to say given just that exception, we may just try to guess.
Oracle datastore for a number of Oracle specific silly reasons requires
the native connection to the database (a Oracle specific object), and
the connection pools are wrapping connections to perform their pooling
work.
Now, we have quite a set of "unwrappers" that can handle the most common
connection pools, including some WebSphere ones, but _it might_ be
there is no unwrapper for the connection pool shipping with that specific version of WebSphere.

Don't you really have anything else in the logs?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

If you can ping the datasource within your websphere admin consoloe, your config is ok. (Provided that the scope of your DS is not pointing to another server, I assume you are using a server called "server1").

1)
Try to use "java:comp/env/jdbc/test" instead of jdbc/test in the geoserver config. I think the logic to add "java:comp/env/" is not in 1.7.5, only on trunk.

2)
Websphere has a default app called UTC. Within this app you can browse your JNDI hierarchy. You can also try the full qualified JNDI path

Kris Geusebroek writes:

Hi,

I have successfully deployed geoserver with the oracle-ng plugin into
websphere and managed to create a jdbc datasource which can be
successfully pinged in Websphere also.

I'm struggling though to get it to work with my geoserver config.

Here's what I have now:

- A resource-ref section in the web.xml (following the example
on the geoserver website)

<resource-ref>

  <description>Oracle datastore test</description>

         <res-ref-name>jdbc/test</res-ref-name>

         <res-type>javax.sql.DataSource</res-type>

         <res-auth>Container</res-auth>

       </resource-ref>

- A configured JDBC Provider with a classpath set to
ojdbc14.jar of my oracle client installation directory with an
implementation classname:
oracle.jdbc.pool.OracleConnectionPoolDataSource

- A datasource configuration

o Name: testJNDI

o JNDI Name: jdbc/testJNDI

o Use this datasource in CMP checked

o Oracle 10g data store helper

o Component-managed authentication alias selected

o And an url like: jdbc:oracle:thin:@(DESCRIPTION= etc)

- Bound the resource ref to the concrete datasource definition
on installing the geoserver war file with the default method for
authentication (many-to-one) with the samemanaged authentication as
above selected.

- And in geoserver catalog.xml

<datastore namespace="testJNDI" enabled="true" id="jndi_test_ds">

       <connectionParams>

                       <parameter value="http://www.test.nl/JNDI&quot;
name="namespace"/>

                       <parameter value="jdbc/test"
name="jndiReferenceName"/>

                       <parameter value="Oracle" name="dbtype"/>

                       <parameter value="USERNAME" name="schema"/>

       </connectionParams>

</datastore>

After deploying this I cannot see my datastore in the list when I choose
to add a new featureType so I configured a featureType manually but when
accessing this featureType I get the following error:

Java.io.IOException: Schema 'http://www.test.nl/JNDITABLENAME’ does not
exist.

At
org.geotools.data.store.ContentDataStoe.ensureEntry(ContentDataStore.jav
a:555)

Etc.

What am I doing wrong here?

Cheers Kris

Kris Geusebroek wrote:

<parameter value=”jdbc/test” name=”jndiReferenceName”/>

Support for short JNDI reference names was only added seven days ago. Unless you are using a very recent build, you will need to use:

     value=”java:comp/env/jdbc/test"

(Both forms are supported the latest builds.)

See the Jira issue::
http://jira.codehaus.org/browse/GEOT-2559

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer, CSIRO Exploration and Mining
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

Hi Andrea,

No nothing else to see in the logs.
I'm now trying to make it work on my tomcat installation with postgis db
but I don't believe there is a jndi version of the postgis jdbc plugin
right?

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, July 07, 2009 4:44 PM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Kris Geusebroek ha scritto:

Java.io.IOException: Schema 'http://www.test.nl/JNDITABLENAME’ does

not

exist.

At

org.geotools.data.store.ContentDataStoe.ensureEntry(ContentDataStore.jav
a:555)

Etc.

Hmmm... difficult to say given just that exception, we may just try to
guess.
Oracle datastore for a number of Oracle specific silly reasons requires
the native connection to the database (a Oracle specific object), and
the connection pools are wrapping connections to perform their pooling
work.
Now, we have quite a set of "unwrappers" that can handle the most common
connection pools, including some WebSphere ones, but _it might_ be
there is no unwrapper for the connection pool shipping with that
specific version of WebSphere.

Don't you really have anything else in the logs?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Kris Geusebroek ha scritto:

Hi Andrea,

No nothing else to see in the logs. I'm now trying to make it work on my tomcat installation with postgis db
but I don't believe there is a jndi version of the postgis jdbc plugin
right?

Not for 1.7.x, there is only one for GeoServer trunk (aka 2.0 series).
The JDNI tutorial (which you already saw, right?) was written for
Oracle:
http://gridlock.openplans.org/geoserver/1.7.x/doc/user/tutorials/tomcat-jndi/tomcat-jndi.html

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi,

Yes i saw the tutorial for oracle, so I have to get some oracle db
running on my laptop to investigate further I guess.

Thanks

Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Wednesday, July 08, 2009 3:03 PM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

No nothing else to see in the logs.
I'm now trying to make it work on my tomcat installation with postgis

db

but I don't believe there is a jndi version of the postgis jdbc plugin
right?

Not for 1.7.x, there is only one for GeoServer trunk (aka 2.0 series).
The JDNI tutorial (which you already saw, right?) was written for
Oracle:
http://gridlock.openplans.org/geoserver/1.7.x/doc/user/tutorials/tomcat-
jndi/tomcat-jndi.html

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Found the solution!!

After trying to configure tomcat with the same oracle connection (which
didn't work also) I found out that removing the schema from the
datastore configuration did the trick.

Apparently giving the username is sufficient enough.

Cheers Kris

-----Original Message-----
From: Kris Geusebroek [mailto:kgeusebroek@anonymised.com]
Sent: Wednesday, July 08, 2009 3:12 PM
To: Andrea Aime
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Hi,

Yes i saw the tutorial for oracle, so I have to get some oracle db
running on my laptop to investigate further I guess.

Thanks

Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Wednesday, July 08, 2009 3:03 PM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

No nothing else to see in the logs.
I'm now trying to make it work on my tomcat installation with postgis

db

but I don't believe there is a jndi version of the postgis jdbc plugin
right?

Not for 1.7.x, there is only one for GeoServer trunk (aka 2.0 series).
The JDNI tutorial (which you already saw, right?) was written for
Oracle:
http://gridlock.openplans.org/geoserver/1.7.x/doc/user/tutorials/tomcat-
jndi/tomcat-jndi.html

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Kris Geusebroek ha scritto:

Found the solution!!

After trying to configure tomcat with the same oracle connection (which
didn't work also) I found out that removing the schema from the
datastore configuration did the trick.

Apparently giving the username is sufficient enough.

Hmmm... odd. The schema is used to filter up tables so that you don't
see the whole database.
In Oracle the schema is usually the same as the username, but uppercase

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

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?

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?

Cheers Kris
-----Original Message-----
From: Kris Geusebroek [mailto:kgeusebroek@anonymised.com]
Sent: Wednesday, July 08, 2009 4:23 PM
To: Andrea Aime
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Found the solution!!

After trying to configure tomcat with the same oracle connection (which
didn't work also) I found out that removing the schema from the
datastore configuration did the trick.

Apparently giving the username is sufficient enough.

Cheers Kris

-----Original Message-----
From: Kris Geusebroek [mailto:kgeusebroek@anonymised.com]
Sent: Wednesday, July 08, 2009 3:12 PM
To: Andrea Aime
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Hi,

Yes i saw the tutorial for oracle, so I have to get some oracle db
running on my laptop to investigate further I guess.

Thanks

Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Wednesday, July 08, 2009 3:03 PM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

No nothing else to see in the logs.
I'm now trying to make it work on my tomcat installation with postgis

db

but I don't believe there is a jndi version of the postgis jdbc plugin
right?

Not for 1.7.x, there is only one for GeoServer trunk (aka 2.0 series).
The JDNI tutorial (which you already saw, right?) was written for
Oracle:
http://gridlock.openplans.org/geoserver/1.7.x/doc/user/tutorials/tomcat-
jndi/tomcat-jndi.html

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------
------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

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.org
Expert service straight from the developers.

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that's the cause.

I'm using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Friday, July 10, 2009 10:54 AM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

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.org
Expert service straight from the developers.

Kris Geusebroek ha scritto:

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that's the cause.

I'm using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

I have no idea in either case, never used WebSphere

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi Kris, since I think I am the Websphere "expert" of the geotools/geoserver developers, I could check your problem.

The bad luck is that I am on holidays and I can resume work in the 4.th week of July. Perhaps it is possible in the 3rd week, I dont know at the moment.

If your problem is urgent, sorry I cannot help. If you can wait 2-3 weeks, we will find a solution.

Christian

Kris Geusebroek writes:

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that's the cause.

I'm using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com] Sent: Friday, July 10, 2009 10:54 AM
To: Kris Geusebroek
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

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.org
Expert service straight from the developers.

Problem Solved!!

Reason for this strange behaviour was not that the websphere specific classes were not found on the classpath eventually.
Problem was that in the SpringUnWrapper class all extractors were tried and the Jdbc4NativeJdbcExtractor was throwing a NoSuchMethodError (it tries to unwrap the connection using a jdk6 specific method called 'unwrap' on the connection class.)

This prevents the SpringUnwrapper class to try the other configured extractors.
So my dirty workaround solution for now is I changed the SpringUnwrapper class to catch a Throwable instead of the Exception so the unwrapper can continue it's work.

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Friday, July 10, 2009 1:12 PM
To: Kris Geusebroek
Cc: Christian Müller; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that's the cause.

I'm using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

I have no idea in either case, never used WebSphere

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hello all,

I want to post a new featuretype in geoserver using rest, I’ve already tryied to delete one with rest, it’s ok.

So, with curl I’ve made a GET of a featuretype, just changed some attribute insinde and posted the new content with:

curl -u admin:geoserver -v -XPOST -T ViveLaVie.xml -H “Content-type: text/xml”

Ok, whatever the file I’ve posted, I receive this error:

2009-07-16 16:41:29,453 INFO [org.geoserver] - Loaded feature type ‘ViveLaVie’, enabled
2009-07-16 16:41:29,470 ERROR [geoserver.global] - Could not load feature type easySDIPublishNamespace:ViveLaVie
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at org.vfny.geoserver.global.FeatureTypeInfo.isCachingEnabled(FeatureTypeInfo.java:1677)
at org.vfny.geoserver.global.FeatureTypeInfo.toDTO(FeatureTypeInfo.java:528)

IsCatchingEnabled fails because it tryies to convert a String to Boolean… In! my file,
i’ve defined this property this way:

null **false** false _essai_sdi_plop4_Type gml:AbstractFeatureType best_guess easySDIPublishDatastore_HalloVelo 15

When i remove the false tag, it goes further and a next error appears for another Boolean…

Do someone has a clue why this error occurs?!

Hi, this is a known issue:

http://jira.codehaus.org/browse/GEOS-3148

On trunk this has been fixed however on 1.7.x it is still a problem.

Other devs:

We could backport the metadata map stuff back to 1.7.x Or alternatively just replace code that does:

Boolean cachingEnabled = (Boolean) featureType.getMetadata().get( "cachingEnabled" );

with:

Boolean cachingEnabled = Converters.convert( featureType.getMetadata().get( "cachingEnabled" ), Boolean.class);

I could go either way... backporting the metadata map means mucking with the catalog apis on 1.7.x which i am not crazy about, i think i prefer the brute force approach. But could go either way.

Thoughts?

web wrote:

Hello all,

I want to post a new featuretype in geoserver using rest, I've already tryied to delete one with rest, it's ok.

So, with curl I've made a GET of a featuretype, just changed some attribute insinde and posted the new content with:

curl -u admin:geoserver -v -XPOST -T ViveLaVie.xml -H "Content-type: text/xml"

Ok, whatever the file I've posted, I receive this error:

2009-07-16 16:41:29,453 INFO [org.geoserver] - Loaded feature type 'ViveLaVie', enabled
2009-07-16 16:41:29,470 ERROR [geoserver.global] - Could not load feature type easySDIPublishNamespace:ViveLaVie
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at org.vfny.geoserver.global.FeatureTypeInfo.isCachingEnabled(FeatureTypeInfo.java:1677)
at org.vfny.geoserver.global.FeatureTypeInfo.toDTO(FeatureTypeInfo.java:528)

IsCatchingEnabled fails because it tryies to convert a String to Boolean... In! my file,
i've defined this property this way:

<metadata>
    <kml.regionateAttribute>null</kml.regionateAttribute>
  * <indexingEnabled>false</indexingEnabled>*
    <cacheAgeMax></cacheAgeMax>
    <cachingEnabled>false</cachingEnabled>
    <gml.schemaSchema>_essai_sdi_plop4_Type</gml.schemaSchema>
    <gml.schemaBase>gml:AbstractFeatureType</gml.schemaBase>
    <kml.regionateStrategy>best_guess</kml.regionateStrategy>
    <dirName>easySDIPublishDatastore_HalloVelo</dirName>
    <kml.regionateFeatureLimit>15</kml.regionateFeatureLimit>
  </metadata>

When i remove the * <indexingEnabled>false</indexingEnabled> *tag, it goes further and a next error appears for another Boolean...

Do someone has a clue why this error occurs?!

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

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Apologies for resurrecting this old thread, but I am seeing this issue, and wondered whether this dirty workaround had made its way into Geoserver 2.0.0 or whether it was fixed as a one off?

I am trying to get Geoserver to reuse existing (hence, proven to work) Data Sources in WAS, but I am seeing the following error messages

[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 WARN [org.geotools.data.jdbc] - Could not test org.geoserver.data.jdbc.
SpringUnWrapper@anonymised.com for unwrapping abilities agaist com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@anonymised.com
java.lang.NoSuchMethodError: java/sql/Connection.unwrap(Ljava/lang/Class;)Ljava/lang/Object;
at org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor.doGetNativeConnection(Jdbc4NativeJdbcExtractor.java:44)
at org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter.getNativeConnection(NativeJdbcExtractorAdapter.java:99)
at org.geoserver.data.jdbc.SpringUnWrapper.unwrapInternal(SpringUnWrapper.java:95)
at org.geoserver.data.jdbc.SpringUnWrapper.canUnwrap(SpringUnWrapper.java:76)
at org.geotools.data.jdbc.datasource.DataSourceFinder.getUnWrapper(DataSourceFinder.java:125)
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:446)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR [org.geotools.rendering] - java.io.IOException
java.lang.RuntimeException: java.io.IOException
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
Caused by: java.io.IOException
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
… 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
… 74 more
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.rendering] - Style cache hit ratio: NaN , hits 0, requests 0
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.renderer.shape] - Style cache hit ratio: NaN , hits 0, requests 0
[19/03/10 16:25:13:304 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR [org.geoserver.ows] -
org.vfny.geoserver.wms.WmsException: org.vfny.geoserver.wms.WmsException: Rendering process failed
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:442)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:213)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
Caused by: org.vfny.geoserver.wms.WmsException: Rendering process failed
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:409)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
… 62 more
Caused by: java.lang.Exception: Exception rendering layer FeatureCollectionMapLayer[ roadds, VISIBLE, UNSELECTED, style=StyleImpl[ name=roadareas], data=org.vfny.geoserver.global.GeoServerFeatureLocking@anonymised.com, query=Query:
feature type: roadds
filter: [Filter.INCLUDE AND Filter.INCLUDE]
[properties: ALL ]]
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:679)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
… 63 more
Caused by: java.lang.RuntimeException: java.io.IOException
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
… 67 more
Caused by: java.io.IOException
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
… 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
… 74 more
[19/03/10 16:25:13:509 GMT] 0000001d LocalTranCoor W WLTC0033W: Resource jdbc/OSM01DS rolled back in cleanup of LocalTransactionContainment.
[19/03/10 16:25:13:517 GMT] 0000001d LocalTranCoor W WLTC0032W: One or more local transaction resources were rolled back during the cleanup of a LocalTransactionContainment.

Any advice gratefully accepted!

Rob

On 16 July 2009 10:59, Kris Geusebroek <kgeusebroek@anonymised.com> wrote:

Problem Solved!!

Reason for this strange behaviour was not that the websphere specific classes were not found on the classpath eventually.
Problem was that in the SpringUnWrapper class all extractors were tried and the Jdbc4NativeJdbcExtractor was throwing a NoSuchMethodError (it tries to unwrap the connection using a jdk6 specific method called ‘unwrap’ on the connection class.)

This prevents the SpringUnwrapper class to try the other configured extractors.
So my dirty workaround solution for now is I changed the SpringUnwrapper class to catch a Throwable instead of the Exception so the unwrapper can continue it’s work.

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com…]

Sent: Friday, July 10, 2009 1:12 PM
To: Kris Geusebroek

Cc: Christian Müller; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that’s the cause.

I’m using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

I have no idea in either case, never used WebSphere

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert 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™ 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@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Rob, AFAIK the Connection.unwrap Method exists since JDBC 4.0.

Maybe your Oracle JDBC Driver included in the Oracle jar files is version 3.0. I think you should update to a jar file containing a version 4.0 Oracle JDBC driver.

Rob writes:

Apologies for resurrecting this old thread, but I am seeing this issue, and
wondered whether this dirty workaround had made its way into Geoserver 2.0.0
or whether it was fixed as a one off?

I am trying to get Geoserver to reuse existing (hence, proven to work) Data
Sources in WAS, but I am seeing the following error messages

[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 WARN
[org.geotools.data.jdbc] - Could not test org.geoserver.data.jdbc.
SpringUnWrapper@anonymised.com for unwrapping abilities agaist
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@anonymised.com
java.lang.NoSuchMethodError:
java/sql/Connection.unwrap(Ljava/lang/Class;)Ljava/lang/Object;
        at
org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor.doGetNativeConnection(Jdbc4NativeJdbcExtractor.java:44)
        at
org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter.getNativeConnection(NativeJdbcExtractorAdapter.java:99)
        at
org.geoserver.data.jdbc.SpringUnWrapper.unwrapInternal(SpringUnWrapper.java:95)
        at
org.geoserver.data.jdbc.SpringUnWrapper.canUnwrap(SpringUnWrapper.java:76)
        at
org.geotools.data.jdbc.datasource.DataSourceFinder.getUnWrapper(DataSourceFinder.java:125)
        at
org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:446)
        at
org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
        at
org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
        at
org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
        at
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
        at
org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
        at
org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
        at
org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
        at
org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
        at
org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
        at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
        at
org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
        at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
        at
org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
        <SNIP>
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG
[org.geotools.jdbc] - CLOSE CONNECTION
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR
[org.geotools.rendering] - java.io.IOException
java.lang.RuntimeException: java.io.IOException
        at
org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
        at
org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
        at
org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
        at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
        at
org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
        at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
        at
org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
        at
org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
<SNIP>
Caused by: java.io.IOException
        at
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
        at
org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
        at
org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
        at
org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
        ... 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection
for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
        at
org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
        at
org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
        at
org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
        at
org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
        at
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
        ... 74 more
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG
[org.geotools.rendering] - Style cache hit ratio: NaN , hits 0, requests 0
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG
[org.geotools.renderer.shape] - Style cache hit ratio: NaN , hits 0,
requests 0
[19/03/10 16:25:13:304 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR
[org.geoserver.ows] -
org.vfny.geoserver.wms.WmsException: org.vfny.geoserver.wms.WmsException:
Rendering process failed
        at
org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:442)
        at
org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
        at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
        at
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:213)
        at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
        at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
        at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
        at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
        at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
<SNIP>
Caused by: org.vfny.geoserver.wms.WmsException: Rendering process failed
        at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:409)
        at
org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
        ... 62 more
Caused by: java.lang.Exception: Exception rendering layer
FeatureCollectionMapLayer[ roadds, VISIBLE, UNSELECTED, style=StyleImpl[
name=roadareas],
data=org.vfny.geoserver.global.GeoServerFeatureLocking@anonymised.com,
query=Query:
   feature type: roadds
   filter: [Filter.INCLUDE AND Filter.INCLUDE]
   [properties: ALL ]]
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:679)
        at
org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
        at
org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
        at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
        ... 63 more
Caused by: java.lang.RuntimeException: java.io.IOException
        at
org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
        at
org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
        at
org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
        at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
        ... 67 more
Caused by: java.io.IOException
        at
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
        at
org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
        at
org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
        at
org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
        ... 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection
for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
        at
org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
        at
org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
        at
org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
        at
org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
        at
org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
        ... 74 more
[19/03/10 16:25:13:509 GMT] 0000001d LocalTranCoor W WLTC0033W: Resource
jdbc/OSM01DS rolled back in cleanup of LocalTransactionContainment.
[19/03/10 16:25:13:517 GMT] 0000001d LocalTranCoor W WLTC0032W: One or
more local transaction resources were rolled back during the cleanup of a
LocalTransactionContainment.

Any advice gratefully accepted!

Rob

On 16 July 2009 10:59, Kris Geusebroek <kgeusebroek@anonymised.com> wrote:

Problem Solved!!

Reason for this strange behaviour was not that the websphere specific
classes were not found on the classpath eventually.
Problem was that in the SpringUnWrapper class all extractors were tried and
the Jdbc4NativeJdbcExtractor was throwing a NoSuchMethodError (it tries to
unwrap the connection using a jdk6 specific method called 'unwrap' on the
connection class.)

This prevents the SpringUnwrapper class to try the other configured
extractors.
So my dirty workaround solution for now is I changed the SpringUnwrapper
class to catch a Throwable instead of the Exception so the unwrapper can
continue it's work.

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Friday, July 10, 2009 1:12 PM
To: Kris Geusebroek
Cc: Christian Müller; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in
Websphere

Kris Geusebroek ha scritto:
> Hi Andrea,
>
> I had a look in the classloader view of the websphere console and could
not find this class.
> So I think that's the cause.
>
> I'm using websphere 6.1.
> I did a bit of searching and I think the class must be available in
rsadaptersspi.jar. Can you confirm that?
> And is it possible to just add it to the websphere lib directory?

I have no idea in either case, never used WebSphere

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Rob,

I can at least confirm this change has made its way into the current trunk. I didn’t have the 2.0.1 source so couldn’t check that version.

The only thing you need to check is if the SpringUnwrapper class has a catch (Throwable) in the public Connection unwrapInternal(Connection conn) method

Cheers Kris

From: Rob [mailto:gis@anonymised.com]
Sent: Friday, March 19, 2010 5:34 PM
To: Kris Geusebroek
Cc: Andrea Aime; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

Apologies for resurrecting this old thread, but I am seeing this issue, and wondered whether this dirty workaround had made its way into Geoserver 2.0.0 or whether it was fixed as a one off?

I am trying to get Geoserver to reuse existing (hence, proven to work) Data Sources in WAS, but I am seeing the following error messages

[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 WARN [org.geotools.data.jdbc] - Could not test org.geoserver.data.jdbc.

SpringUnWrapper@anonymised.com for unwrapping abilities agaist com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@anonymised.com
java.lang.NoSuchMethodError: java/sql/Connection.unwrap(Ljava/lang/Class;)Ljava/lang/Object;
at org.springframework.jdbc.support.nativejdbc.Jdbc4NativeJdbcExtractor.doGetNativeConnection(Jdbc4NativeJdbcExtractor.java:44)
at org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractorAdapter.getNativeConnection(NativeJdbcExtractorAdapter.java:99)
at org.geoserver.data.jdbc.SpringUnWrapper.unwrapInternal(SpringUnWrapper.java:95)
at org.geoserver.data.jdbc.SpringUnWrapper.canUnwrap(SpringUnWrapper.java:76)
at org.geotools.data.jdbc.datasource.DataSourceFinder.getUnWrapper(DataSourceFinder.java:125)
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:446)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[19/03/10 16:25:13:298 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR [org.geotools.rendering] - java.io.IOException
java.lang.RuntimeException: java.io.IOException
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
Caused by: java.io.IOException
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
… 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
… 74 more
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.rendering] - Style cache hit ratio: NaN , hits 0, requests 0
[19/03/10 16:25:13:301 GMT] 0000001d SystemOut O 19 Mar 16:25:13 DEBUG [org.geotools.renderer.shape] - Style cache hit ratio: NaN , hits 0, requests 0
[19/03/10 16:25:13:304 GMT] 0000001d SystemOut O 19 Mar 16:25:13 ERROR [org.geoserver.ows] -
org.vfny.geoserver.wms.WmsException: org.vfny.geoserver.wms.WmsException: Rendering process failed
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:442)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:692)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:213)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
Caused by: org.vfny.geoserver.wms.WmsException: Rendering process failed
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:409)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:421)
… 62 more
Caused by: java.lang.Exception: Exception rendering layer FeatureCollectionMapLayer[ roadds, VISIBLE, UNSELECTED, style=StyleImpl[ name=roadareas], data=org.vfny.geoserver.global.GeoServerFeatureLocking@anonymised.com, query=Query:
feature type: roadds
filter: [Filter.INCLUDE AND Filter.INCLUDE]
[properties: ALL ]]
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:679)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1519)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1367)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:270)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:385)
… 63 more
Caused by: java.lang.RuntimeException: java.io.IOException
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:256)
at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:47)
at org.geotools.renderer.lite.StreamingRenderer.drawOptimized(StreamingRenderer.java:1796)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1730)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:675)
… 67 more
Caused by: java.io.IOException
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:568)
at org.geotools.jdbc.JDBCFeatureStore.getReaderInternal(JDBCFeatureStore.java:209)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:481)
at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:253)
… 71 more
Caused by: java.sql.SQLException: Could not obtain native oracle connection for class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection
at org.geotools.data.oracle.OracleDialect.unwrapConnection(OracleDialect.java:458)
at org.geotools.data.oracle.OracleDialect.setGeometryValue(OracleDialect.java:421)
at org.geotools.jdbc.JDBCDataStore.setPreparedFilterValues(JDBCDataStore.java:2780)
at org.geotools.jdbc.JDBCDataStore.selectSQLPS(JDBCDataStore.java:2758)
at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:555)
… 74 more
[19/03/10 16:25:13:509 GMT] 0000001d LocalTranCoor W WLTC0033W: Resource jdbc/OSM01DS rolled back in cleanup of LocalTransactionContainment.
[19/03/10 16:25:13:517 GMT] 0000001d LocalTranCoor W WLTC0032W: One or more local transaction resources were rolled back during the cleanup of a LocalTransactionContainment.

Any advice gratefully accepted!

Rob

On 16 July 2009 10:59, Kris Geusebroek <kgeusebroek@anonymised.com> wrote:

Problem Solved!!

Reason for this strange behaviour was not that the websphere specific classes were not found on the classpath eventually.
Problem was that in the SpringUnWrapper class all extractors were tried and the Jdbc4NativeJdbcExtractor was throwing a NoSuchMethodError (it tries to unwrap the connection using a jdk6 specific method called ‘unwrap’ on the connection class.)

This prevents the SpringUnwrapper class to try the other configured extractors.
So my dirty workaround solution for now is I changed the SpringUnwrapper class to catch a Throwable instead of the Exception so the unwrapper can continue it’s work.

Cheers Kris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com…]

Sent: Friday, July 10, 2009 1:12 PM
To: Kris Geusebroek

Cc: Christian Müller; geoserver-users@anonymised.com.sourceforge.net
Subject: Re: [Geoserver-users] JNDI configuration of datastores in Websphere

Kris Geusebroek ha scritto:

Hi Andrea,

I had a look in the classloader view of the websphere console and could not find this class.
So I think that’s the cause.

I’m using websphere 6.1.
I did a bit of searching and I think the class must be available in rsadaptersspi.jar. Can you confirm that?
And is it possible to just add it to the websphere lib directory?

I have no idea in either case, never used WebSphere

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert 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™ 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@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users