db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject JPOX enhancer bug
Date Wed, 10 Aug 2005 17:10:52 GMT
Hi Andy,

I'm investigating JDO-100 ("Insert request failed ... because it would 
have caused a duplicate key value").

The duplicate key exception is thrown because there is an exception in a 
previous run during teardown preventing to delete the instance in the 
datastore.

That exception is a NoSuchMethodError thrown by the enhanced code (see 
below) of a class "PCPointSingleFieldDate" in methods 
"jdoCopyKeyFieldsFromObjectId". I decompiled the code of that class. It 
seems that the JPOX enhancer generates a java.util.Date constructor call 
that does not exist. This is an excerpt of the decompiled code:

     protected void jdoCopyKeyFieldsFromObjectId(Object oid)
     {
         if(!(oid instanceof ObjectIdentity))
         {
             throw new ClassCastException("key class is not 
javax.jdo.identity.ObjectIdentity or null");
         } else
         {
             ObjectIdentity o = (ObjectIdentity)oid;
             id = new Date(o.getKey());
             return;
         }
     }

Regards,
Michael

     [java] 
testSingleFieldIdentityInitializedDate(org.apache.jdo.tck.api.persistencecapable.NewObjectIdInstance)javax
.jdo.JDOFatalException: Exception during tearDown
     [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:281)
     [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:211)
     [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
     [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
     [java] NestedThrowablesStackTrace:
     [java] java.lang.NoSuchMethodError: 
java.util.Date.<init>(Ljava/lang/Object;)V
     [java]      at 
org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldDate.jdoCopyKeyFieldsFromObjectId(PCPoint
SingleFieldDate.java)
     [java]      at 
org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldDate.jdoNewInstance(PCPointSingleFieldDat
e.java)
     [java]      at 
javax.jdo.spi.JDOImplHelper.newInstance(JDOImplHelper.java:199)
     [java]      at 
org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:340)
     [java]      at 
org.jpox.AbstractPersistenceManager.getObjectById(AbstractPersistenceManager.java:2322)
     [java]      at 
org.jpox.AbstractPersistenceManager.getObjectById(AbstractPersistenceManager.java:2230)
     [java]      at 
org.apache.jdo.tck.JDO_Test.deleteTearDownInstances(JDO_Test.java:336)
     [java]      at 
org.apache.jdo.tck.JDO_Test.localTearDown(JDO_Test.java:292)
     [java]      at org.apache.jdo.tck.JDO_Test.tearDown(JDO_Test.java:263)
     [java]      at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:211)
     [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:128)
     [java]      at 
org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:106)
-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message