Hi Geir, On Jan 29, 2008, at 8:57 AM, Geir Magnusson Jr. wrote:
On Jan 29, 2008, at 4:35 PM, Craig L Russell wrote:Hi Geir,No insights except for the possibility that the enhancement is out of sync with the class definition or mapping.How can that happen? We don't do any "external" mapping via XML - it's all via annotations in the code.We do the enhancement at build time, so the jar that anyone uses is already enhanced. And I'm *pretty* sure that there's only one jar per webapp.
So the AbstractControlledListItem is a @MappedSuperclass? And the LanguageCode is @Entity?
The only thing I can think of is that the class was enhanced wrong. Can you post a javap -c dump of the enhanced classes with the extraneous stuff removed (I assume it's proprietary). There might be a clue where the mismatch occurred.
Craig
The stack trace says you're doing a query and populating the results of the query into the persistent instances. There is a field that the runtime thinks is a String but the instance is enhanced so the field is not a String.Here's the class w/ irrelevant/transient stuff removed : @DataTransferObjectpublic class LanguageCode extends AbstractControlledListItem implements Serializable {@RemoteProperty private String rfc4646tag; @Column(name = "rfc4646tag", nullable = false, length = 11) public String getRfc4646tag() { return rfc4646tag; } public void setRfc4646tag(String rfc4646tag) { this.rfc4646tag = rfc4646tag; } } and the base class :public abstract class AbstractControlledListItem implements ControlledListItem {@RemoteProperty private int code; @RemoteProperty protected String comment; /** Unknown code */ public static final int Unknown = 1; /** No code */ public static final int None = 2; protected AbstractControlledListItem() {} public AbstractControlledListItem(int code) { this.code = code; } @Id public int getCode() { return code; } public void setCode(int code) { this.code = code; } @Column(name = "comment_") public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } }Do you always enhance dynamically?No - we enhance at build time.Is there a chance the field type has changed? Did you change a superclass and not enhance the subclass again? (Actually, if this is the case, please file a bug; you should be able to enhance subclasses and superclasses separately).We're pretty primitive in how we do this - we enhance as part of the build, so I can't see how we can get any "separation" between things...thx geirCraig On Jan 29, 2008, at 8:09 AM, Geir Magnusson Jr. wrote:As a followup to yesterday...We're still having problems. The bug seems to move around depending on data. We see it in 1.0.0 and we don't see it 1.0.1, but because it's a random, intermittent thing that seems to be data dependent, I'm hoping that the following gives someone an "aha!" and you can assure me that you know what it is, and that it's fixed in 1.0.1 :)Thanks. stacktrace follows : Caused by: java.lang.IllegalArgumentExceptionat com.joost.model.codes.LanguageCode.pcReplaceField(LanguageCode.java) at org .apache .openjpa .kernel.StateManagerImpl.replaceField(StateManagerImpl.java:2971) at org .apache .openjpa .kernel.StateManagerImpl.storeStringField(StateManagerImpl.java: 2455) at org .apache .openjpa.kernel.StateManagerImpl.storeString(StateManagerImpl.java: 2446) at org .apache .openjpa .jdbc .meta.strats.StringFieldStrategy.load(StringFieldStrategy.java:155) at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java: 789) at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 833) at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 785) at org .apache .openjpa .jdbc .kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:336) at org .apache .openjpa .jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255) at org .apache .openjpa .kernel .DelegatingStoreManager.initialize(DelegatingStoreManager.java:111) at org .apache .openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:843)at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:801) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:723)at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 776) at org .apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java: 257) at org.apache.openjpa.jdbc.sql.SelectImpl $SelectResult.load(SelectImpl.java:2168) at org .apache .openjpa .jdbc .meta .strats .RelationFieldStrategy.loadEagerJoin(RelationFieldStrategy.java:508) at org .apache .openjpa.jdbc.meta.FieldMapping.loadEagerJoin(FieldMapping.java:783) at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 825) at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 785) at org .apache .openjpa .jdbc .kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:336) at org .apache .openjpa .jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255) at org .apache .openjpa .kernel .DelegatingStoreManager.initialize(DelegatingStoreManager.java:111) at org .apache .openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:843)at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:801) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:723)at org .apache .openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java: 776) at org .apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java: 257) at org.apache.openjpa.jdbc.sql.SelectImpl $SelectResult.load(SelectImpl.java:2168) at org .apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java: 251) at org .apache .openjpa .jdbc .kernel .InstanceResultObjectProvider .getResultObject(InstanceResultObjectProvider.java:59) at org .apache .openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java: 1223)at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:799) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769)at org .apache .openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:533) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:235) at org .apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java: 277)at com.joost.util.ListRange.query(ListRange.java:104) at com.joost.util.ListRange.query(ListRange.java:127)at com .joost .service .impl .AbstractROAssetManager .loadByDamNotDeleted(AbstractROAssetManager.java:94) at com .theveniceproject .cow .shipper .server .ShipperProtocolHandlerImpl .listVideos(ShipperProtocolHandlerImpl.java:128)at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)at org .springframework .aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java: 296) at org .springframework .aop .framework .ReflectiveMethodInvocation .invokeJoinpoint(ReflectiveMethodInvocation.java:177) at org .springframework .aop .framework .ReflectiveMethodInvocation .proceed(ReflectiveMethodInvocation.java:144) at org .springframework .transaction .interceptor .TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org .springframework .aop .framework .ReflectiveMethodInvocation .proceed(ReflectiveMethodInvocation.java:166) at org .springframework .aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java: 204)Craig RussellArchitect, Sun Java Enterprise System http://java.sun.com/products/ jdo408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
