-
1. Re: Problem referencing class in Postgresql jdbc driver
wdfink Mar 14, 2014 9:16 AM (in response to darylfoster)1 of 1 people found this helpfulMostly this ClassCast problems are related to the classloaders.
If you run different applications, i.e. EAR files, and package the driver to each app you might run into that.
Because if EAR1 put the class into the List which is hold global and EAR2 read it the org.postgresql.geometric.PGpath is loaded by different CL and Java identify the class by it's full-name and the CL.
If you use former AS versions you might add the driver.jar to the lib directory.
Since AS7 you need to add it as module and set a dependency to this module.
-
2. Re: Problem referencing class in Postgresql jdbc driver
darylfoster Mar 14, 2014 10:04 AM (in response to wdfink)I'm rather new to JBoss and to Java in general, so some of my questions may be very basic.
As further clarification I have two copies of the driver.jar file. One copy is in a subdirectory of $JBOSS_HOME/modules. The other is in the lib directory of the EAR file that I am deploying. I'm only deploying one EAR file.
I am using JBoss Enterprise Application Platform v 6.1.0. Is it possible for me to remove the driver.jar from the EAR file and set a dependency to the module using this version of JBoss?
-
3. Re: Problem referencing class in Postgresql jdbc driver
wdfink Mar 14, 2014 10:15 AM (in response to darylfoster)It looks like that you put/get from the List with different classloaders.
You should remove the driver from your EAR and set a dependency, see Class Loading in AS7.
See "Dependencies : Manifest Entries" or use the jboss-structure file to set a dependency to your driver module if needed.