#14 IllegalStateException in JDBCCommand

v2.3 (unstable)
closed-works-for-me
JBossCMP (436)
5
2001-07-05
2001-04-20
No

I am getting the problem at very rare occasion that
getPkFieldValue() from JDBCommand generate an
IllegalStateException.

I can only reproduce the problem if I make a fBPK on a
CMP bean then directly remove it.
The problem disappear if I use another method (than
remove()) on the remote interface.
The workaround is so to run a get() method on the RI
before calling remove().

More details :
--------------
Here is the method

protected Object getPkFieldValue(Object pk,
PkFieldMetaData pkFieldMetaData)
throws IllegalAccessException
{
Field field = pkFieldMetaData.getPkField();
try{
System.out.println("In "+field+" we have to
found "+pk);
System.out.println(pkFieldMetaData.getName()+"--
"+field.getDeclaringClass()+"--"+pk.getClass());
if (field.getDeclaringClass()!=pk.getClass()){
System.out.println("Wooooooooooooooooooooooow");
System.out.println(pk.getClass().getClassLoader());
System.out.println(field.getDeclaringClass
().getClassLoader());
}
return field.get(pk);
}

In fact in this rare occasion, field.get(Object o) is
called with field.getDeclarringClass() having a
different classloader than the object o.
So even if the classes are the same, the field.get()
will throw the IllegalStateException exception.

What I can not understand is why there are 2
classloaders : my entity bean is in one jar so linked
to one classloader.

I repeat : it only happens with
1. remote=home.fBPK()
2. remote.remove()
It works fine if
1. remote=home.fBPK()
2. remote.getdata()
3. remote.remove()

I am using JBoss 2.3 Beta JVM 1.3.0_02, win2k.

I am not (yet I hope :) ) at this level of JBoss
undertanding to figure out what is happening. I can
provide help to any CMP gurus if needed (just send me
test corrections, I apply them, test and give feed
back)

Discussion

  • Vincent Harcq

    Vincent Harcq - 2001-07-05
    • assigned_to: nobody --> vharcq
    • status: open --> closed-works-for-me
     
  • Vincent Harcq

    Vincent Harcq - 2001-07-05

    Logged In: YES
    user_id=125677

    Add a toString() method to the PK class of entity bean and
    the world become beautiful.
    <not-sure-about-explanation>
    The cache of entity beans activate a second instance of one
    entity bean. Then JBoss works with a new instance and a
    lot breaks.
    See mailing list 05 jul 2001.
    </not-sure-about-explanation>

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks