I was getting the following exception
| java.lang.ClassCastException at
|
org.apache.ojb.broker.metadata.MetadataManager.buildDefaultKey(MetadataManager.java:558)
|
when initailizing OJB in an application deployed on Jboss.
The source code is
| private PBKey buildDefaultKey()
| {
| List descriptors = connectionRepository().getAllDescriptor();
| JdbcConnectionDescriptor descriptor;
| for (Iterator iterator = descriptors.iterator(); iterator.hasNext();)
| {
| descriptor = (JdbcConnectionDescriptor) iterator.next(); <== THIS IS LINE 558
| if (descriptor.isDefaultConnection())
|
Added logs to display the class of iterator.next() and it was in fact the correct
class (JdbcConnectionDescriptor). I then used the code described in
http://www.javaworld.com/javaworld/javaqa/2003-07/01-qa-0711-classsrc.html to find out
where the class were loaded from.
The classes for the objects from the iterator were loaded from:
jboss/server/all/tmp/deploy/tmp2436VideoStore.ear
The class of the descriptor variable was loaded from:
jboss/server/all/tmp/deploy/tmp2604VideoStore.ear
For some reason JBoss was loading code from different versions of the ear file during
the same session. Stopping JBoss to clean the tmp directory fixed the problem. I
don't have an scenario to reproduce the problem, but iit happened after redeploying
the ear file about ten times.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3837114#3837114
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3837114
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development