Udi -

You're really going to need to post more information than this for anyone to
figure out what is going on.... I understand you don't want to post your
application call stack, what about posting a filtered call stack? That might
be a good starting point.

You say you are enhancing your entities at runtime... is that via the
-javaagent or are you using the subclassing support?

-- 
Thanks,
Rick

On Thu, Jan 14, 2010 at 6:23 AM, Udi <saba...@gmail.com> wrote:

>
> Hey, first of all, I'm sorry for not pasting the stack - I just can't.
> I'm using OpenJPA 1.2.0
> I have 2 classes:
> class A{
> @OneToMany(mappedBy="a")
> Set
> }
> class B{
> @ManyToOne
> A a;
> }
>
> Now, at some point (I can't create a consistent testcase..) I get
> ClassCastException: B cannot be cast to A.
> The stack (typed, so sorry once again...):
> B.pcReplaceField()
> StateManagerImpl.replaceField()
> StateManagerImpl.storeObjectField()
> StateManagerImpl.storeObject()
> RelationFieldStrategy.load()
> FieldMapping.load()
> JDBCStoreManager.load()
>
> I'm enhancing entities at runtime, so I used decompiler to see the
> generated
> class, and in the problematic line it appears like a cast for a field.
>
> Anyone knows how can it happen (and even more interesting - how to solve
> the
> problem? :) )
>
> Thanks,
> Udi
> --
> View this message in context:
> http://n2.nabble.com/ClassCastException-in-pcReplaceField-tp4392185p4392185.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to