Re: ArrayIndexOutOfBoundsException - OJB 1.0
I got rid of the factory and the extended class, and the stuff works now. Thanks for your help, -Martin Martin Marinschek wrote: Armin Waibel wrote: Martin Marinschek wrote: I am not using anonymous keys at all, afaik every object in my system has its id and exposes it also in the source-code. ok, similar to my local test Here is my class-descriptor for the class being serialized and loaded back; I realized that I am using the factory-properties to create a customized class ('CustomizedOfferLineImpl', this class has just an additional get-method to summarize some properties) - maybe this is what is causing the problems? (e.g. OJB does not find a class-descriptor for 'CustomizedOfferLineImpl' and does not check if 'CustomizedOfferLineImpl' is of base class 'OfferLineImpl' and using this one?) hmm, never tried this. But if 'CustomizedOfferLineImpl' is not declared in metadata, you will at the latest get problems when storing these objects. Do you get any other error logging before the ArrayIndexOutOfBoundException occurs? In my local test I do: - store an Project class object with a collection of SubProject objects (1:n Project to SubProject) - clear cache and query the created Project - get the Project with proxied SubProject reference (not materialized) - serialize/deserialize Project - get the first SubProject object from Project (materialization done without problems) Is this test similar to yours? regards, Armin Yes, very much the same... I believe that it might be the factory and extension class thing that is causing the problems, but I will retry in a different setting. thanks, -Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ArrayIndexOutOfBoundsException - OJB 1.0
Armin Waibel wrote: Martin Marinschek wrote: I am not using anonymous keys at all, afaik every object in my system has its id and exposes it also in the source-code. ok, similar to my local test Here is my class-descriptor for the class being serialized and loaded back; I realized that I am using the factory-properties to create a customized class ('CustomizedOfferLineImpl', this class has just an additional get-method to summarize some properties) - maybe this is what is causing the problems? (e.g. OJB does not find a class-descriptor for 'CustomizedOfferLineImpl' and does not check if 'CustomizedOfferLineImpl' is of base class 'OfferLineImpl' and using this one?) hmm, never tried this. But if 'CustomizedOfferLineImpl' is not declared in metadata, you will at the latest get problems when storing these objects. Do you get any other error logging before the ArrayIndexOutOfBoundException occurs? In my local test I do: - store an Project class object with a collection of SubProject objects (1:n Project to SubProject) - clear cache and query the created Project - get the Project with proxied SubProject reference (not materialized) - serialize/deserialize Project - get the first SubProject object from Project (materialization done without problems) Is this test similar to yours? regards, Armin Yes, very much the same... I believe that it might be the factory and extension class thing that is causing the problems, but I will retry in a different setting. thanks, -Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ArrayIndexOutOfBoundsException - OJB 1.0
Martin Marinschek wrote: I am not using anonymous keys at all, afaik every object in my system has its id and exposes it also in the source-code. ok, similar to my local test Here is my class-descriptor for the class being serialized and loaded back; I realized that I am using the factory-properties to create a customized class ('CustomizedOfferLineImpl', this class has just an additional get-method to summarize some properties) - maybe this is what is causing the problems? (e.g. OJB does not find a class-descriptor for 'CustomizedOfferLineImpl' and does not check if 'CustomizedOfferLineImpl' is of base class 'OfferLineImpl' and using this one?) hmm, never tried this. But if 'CustomizedOfferLineImpl' is not declared in metadata, you will at the latest get problems when storing these objects. Do you get any other error logging before the ArrayIndexOutOfBoundException occurs? In my local test I do: - store an Project class object with a collection of SubProject objects (1:n Project to SubProject) - clear cache and query the created Project - get the Project with proxied SubProject reference (not materialized) - serialize/deserialize Project - get the first SubProject object from Project (materialization done without problems) Is this test similar to yours? regards, Armin -Martin name="id" column="ID" jdbc-type="BIGINT" nullable="false" primarykey="true" autoincrement="true" sequence-name="OFFSINGLE_SEQ" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="comment" column="OFFSINGLE_COMMENT" jdbc-type="VARCHAR" nullable="true" length="255" /> name="modifiedAt" column="MODIFIED_AT" jdbc-type="DATE" nullable="false" length="0" conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion" /> name="modifiedBy" column="MODIFIED_BY" jdbc-type="VARCHAR" nullable="false" length="255" /> name="createdAt" column="CREATED_AT" jdbc-type="DATE" nullable="false" length="0" conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion" /> name="createdBy" column="CREATED_BY" jdbc-type="VARCHAR" nullable="false" length="255" /> name="offerId" column="OFFALL_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="contentId" column="CONT_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="nameSpaceId" column="NSP_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> class-ref="at.oekb.roncalli.metadata.entity.OfferImpl" proxy="true"> class-ref="at.oekb.roncalli.metadata.entity.ContentImpl" proxy="true"> class-ref="at.oekb.roncalli.metadata.entity.NameSpaceImpl" proxy="true"> element-class-ref="at.oekb.roncalli.metadata.entity.OfferLineConditionImpl" proxy="true"> element-class-ref="at.oekb.roncalli.metadata.entity.DataTransferImpl" proxy="true"> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ArrayIndexOutOfBoundsException - OJB 1.0
I am not using anonymous keys at all, afaik every object in my system has its id and exposes it also in the source-code. Here is my class-descriptor for the class being serialized and loaded back; I realized that I am using the factory-properties to create a customized class ('CustomizedOfferLineImpl', this class has just an additional get-method to summarize some properties) - maybe this is what is causing the problems? (e.g. OJB does not find a class-descriptor for 'CustomizedOfferLineImpl' and does not check if 'CustomizedOfferLineImpl' is of base class 'OfferLineImpl' and using this one?) -Martin name="id" column="ID" jdbc-type="BIGINT" nullable="false" primarykey="true" autoincrement="true" sequence-name="OFFSINGLE_SEQ" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="comment" column="OFFSINGLE_COMMENT" jdbc-type="VARCHAR" nullable="true" length="255" /> name="modifiedAt" column="MODIFIED_AT" jdbc-type="DATE" nullable="false" length="0" conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion" /> name="modifiedBy" column="MODIFIED_BY" jdbc-type="VARCHAR" nullable="false" length="255" /> name="createdAt" column="CREATED_AT" jdbc-type="DATE" nullable="false" length="0" conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion" /> name="createdBy" column="CREATED_BY" jdbc-type="VARCHAR" nullable="false" length="255" /> name="offerId" column="OFFALL_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="contentId" column="CONT_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> name="nameSpaceId" column="NSP_ID" jdbc-type="BIGINT" nullable="false" length="20" precision="0" conversion="at.oekb.mda.util.persistence.ojb.conversion.BigDecimal2LongConversion" /> class-ref="at.oekb.roncalli.metadata.entity.OfferImpl" proxy="true"> class-ref="at.oekb.roncalli.metadata.entity.ContentImpl" proxy="true"> class-ref="at.oekb.roncalli.metadata.entity.NameSpaceImpl" proxy="true"> element-class-ref="at.oekb.roncalli.metadata.entity.OfferLineConditionImpl" proxy="true"> element-class-ref="at.oekb.roncalli.metadata.entity.DataTransferImpl" proxy="true"> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ArrayIndexOutOfBoundsException - OJB 1.0
Hi Martin, I try to reproduce your problem without success. Could you please post a test case or detail describe (some pseudo code) what your are doing? By the way, do you use anonymous keys in collection objects? regards, Armin Martin Marinschek wrote: I found out that the problem occurs if the JavaServer Faces framework serializes an object and reloads it afterwards. Is it forbidden to serialize and recreate OJB-created objects with proxies in it? Do I have to mark the lists created by OJB as transient? But if they are transient, on recreation I will surely loose information... Should I write a converter for myself, being able to materialize the proxy-objects before they are serialized and serializing only the materialized objects? best regards, Martin Martin Marinschek wrote: Using OJB (release 1.0) in a web application (JSF, more clearly stated), I get an 'ArrayIndexOutOfBoundsException' when using the collection-proxy-feature. If I debug the situation, I find out that shortly before I call the 'ListProxyDefaultImpl.get(0)' method, the list claims that it has 2 entries, but it nevertheless throws the above mentioned exception... The problem is that this failure occurs not always, but only from time to time and I am not quite sure what to do about it. Anybody of you has a suggestion or a workaround? Or is this a bug? Best regards, Martin Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at net.sourceforge.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:481) ... 74 more Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 at java.util.Vector.get(Vector.java:709) at org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl.get(ListProxyDefaultImpl.java:71) at at.oekb.roncalli.customized.entity.CustomizedOfferLineImpl.getSummarizedCustomerCondition(CustomizedOfferLineImpl.java:36) ... 79 more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ArrayIndexOutOfBoundsException - OJB 1.0
I found out that the problem occurs if the JavaServer Faces framework serializes an object and reloads it afterwards. Is it forbidden to serialize and recreate OJB-created objects with proxies in it? Do I have to mark the lists created by OJB as transient? But if they are transient, on recreation I will surely loose information... Should I write a converter for myself, being able to materialize the proxy-objects before they are serialized and serializing only the materialized objects? best regards, Martin Martin Marinschek wrote: Using OJB (release 1.0) in a web application (JSF, more clearly stated), I get an 'ArrayIndexOutOfBoundsException' when using the collection-proxy-feature. If I debug the situation, I find out that shortly before I call the 'ListProxyDefaultImpl.get(0)' method, the list claims that it has 2 entries, but it nevertheless throws the above mentioned exception... The problem is that this failure occurs not always, but only from time to time and I am not quite sure what to do about it. Anybody of you has a suggestion or a workaround? Or is this a bug? Best regards, Martin Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at net.sourceforge.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:481) ... 74 more Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 at java.util.Vector.get(Vector.java:709) at org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl.get(ListProxyDefaultImpl.java:71) at at.oekb.roncalli.customized.entity.CustomizedOfferLineImpl.getSummarizedCustomerCondition(CustomizedOfferLineImpl.java:36) ... 79 more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]