Ryan Moquin a écrit :
> Hi, I have a bit of an issue that has popped up since I started running
> my application in a tomcat environment.  I have been sporadically
> getting ClassCastException errors with Geotools during the scanning of
> plugins... I haven't changed any geotools dependencies or upgrading any
> of our other dependencies, it seems like it's something triggered with
> Tomcat.  I've seen this error on my laptop with a MathTransform geotools
> class, then it mysterious went away.  I deployed the same deployment of
> our application with tomcat onto another machine using the same Java
> version, and the error resurfaced but with a different geotools class. 

I do not master Tomcat management of JAR dependencies, but it seems to me that
if the same class is loaded twice by two different ClassLoaders in Tomcat, they
are considered as two different classes. So casting a Foo to a Foo (yes, really
the same fully qualified name) raise a ClassCastException if the two Foo happen
to have been loaded by different ClassLoaders.

I would suggest to make sure that no GeoTools JAR appears twice in the Tomcat
classpath. Even if they are totally identical copy of the exact same JAR, this
duplication doesn't hurt in normal Java environment but leads to problems with
Tomcat, because its uses of different ClassLoaders.

        Martin

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to