You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "Leonardo K. Shikida" <sh...@gmail.com> on 2013/09/17 18:14:55 UTC

org.apache.openjpa.persistence.PersistenceException: null

Hi

I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to run
from windows, it gives me the following error message (see stacktrace)

My doubts are

- what does it mean :-)
- why only in windows
- is there any way to deal with this?

My feeling it that it's somehow related to the OpenJPA enhancement process,
but I really don't have a clue here.

TIA

Leo

Exception in thread "main" javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
    <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
    at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

    at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

    at (...)    at
(...)
Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
    at
org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)

    at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)

    at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)

    at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)

    at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)

    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)

    at
org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)

    at
org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)

 (...)
Caused by: java.lang.VerifyError
    at sun.instrument.InstrumentationImpl.retransformClasses0(Native
Method)
    at
sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

    ... 52 more

[]

Leo

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Rick Curtis <cu...@gmail.com>.
Also, what properties do you have set in your persistence.xml?


On Tue, Sep 17, 2013 at 3:44 PM, Rick Curtis <cu...@gmail.com> wrote:

> What are the versions of JDK that you used on Windows / Linux... and what
> JDK did you use to build the application?
>
>
> On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> Hi
>>
>> I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
>> run
>> from windows, it gives me the following error message (see stacktrace)
>>
>> My doubts are
>>
>> - what does it mean :-)
>> - why only in windows
>> - is there any way to deal with this?
>>
>> My feeling it that it's somehow related to the OpenJPA enhancement
>> process,
>> but I really don't have a clue here.
>>
>> TIA
>>
>> Leo
>>
>> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
>> non-application exception; nested exception is:
>>     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> org.apache.openjpa.persistence.PersistenceException: null
>>     at
>>
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>>
>>     at
>>
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>>
>>     at (...)    at
>> (...)
>> Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>> org.apache.openjpa.persistence.PersistenceException: null
>>     at
>>
>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>>
>>     at
>>
>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>>
>>     at
>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>>
>>     at
>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>>
>>     at
>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>>
>>     at
>>
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>>
>>     at
>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>
>>     at
>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>
>>     at
>>
>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>>
>>     at
>>
>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>>
>>     at
>>
>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>>
>>  (...)
>> Caused by: java.lang.VerifyError
>>     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
>> Method)
>>     at
>>
>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>>
>>     ... 52 more
>>
>
>
>
> --
> *Rick Curtis*
>



-- 
*Rick Curtis*

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Kevin Sutter <kw...@gmail.com>.
You would think so, but the call stack doesn't lie...  :-)


On Tue, Sep 17, 2013 at 4:18 PM, Rick Curtis <cu...@gmail.com> wrote:

> Since he is using tomee and OpenEJB shouldn't the container wire the
> enhancer in?
>
>
> On Tue, Sep 17, 2013 at 3:50 PM, Kevin Sutter <kw...@gmail.com> wrote:
>
> > What method of enhancement is being used?  From the call stack, it looks
> > like you might be using the RuntimeUnenhancedClasses support which is
> not a
> > recommended practice [1].
> >
> >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >
> > [1]  http://openjpa.apache.org/entity-enhancement.html
> >
> >
> > On Tue, Sep 17, 2013 at 3:44 PM, Rick Curtis <cu...@gmail.com> wrote:
> >
> > > What are the versions of JDK that you used on Windows / Linux... and
> what
> > > JDK did you use to build the application?
> > >
> > >
> > > On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <
> shikida@gmail.com
> > > >wrote:
> > >
> > > > Hi
> > > >
> > > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try
> to
> > > run
> > > > from windows, it gives me the following error message (see
> stacktrace)
> > > >
> > > > My doubts are
> > > >
> > > > - what does it mean :-)
> > > > - why only in windows
> > > > - is there any way to deal with this?
> > > >
> > > > My feeling it that it's somehow related to the OpenJPA enhancement
> > > process,
> > > > but I really don't have a clue here.
> > > >
> > > > TIA
> > > >
> > > > Leo
> > > >
> > > > Exception in thread "main" javax.ejb.EJBException: The bean
> > encountered a
> > > > non-application exception; nested exception is:
> > > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > > > org.apache.openjpa.persistence.PersistenceException: null
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> > > >
> > > >     at (...)    at
> > > > (...)
> > > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > > > org.apache.openjpa.persistence.PersistenceException: null
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> > > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> > > >
> > > >  (...)
> > > > Caused by: java.lang.VerifyError
> > > >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > > > Method)
> > > >     at
> > > >
> > > >
> > >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> > > >
> > > >     ... 52 more
> > > >
> > >
> > >
> > >
> > > --
> > > *Rick Curtis*
> > >
> >
>
>
>
> --
> *Rick Curtis*
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Rick Curtis <cu...@gmail.com>.
Since he is using tomee and OpenEJB shouldn't the container wire the
enhancer in?


On Tue, Sep 17, 2013 at 3:50 PM, Kevin Sutter <kw...@gmail.com> wrote:

> What method of enhancement is being used?  From the call stack, it looks
> like you might be using the RuntimeUnenhancedClasses support which is not a
> recommended practice [1].
>
>
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>
> [1]  http://openjpa.apache.org/entity-enhancement.html
>
>
> On Tue, Sep 17, 2013 at 3:44 PM, Rick Curtis <cu...@gmail.com> wrote:
>
> > What are the versions of JDK that you used on Windows / Linux... and what
> > JDK did you use to build the application?
> >
> >
> > On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <shikida@gmail.com
> > >wrote:
> >
> > > Hi
> > >
> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
> > run
> > > from windows, it gives me the following error message (see stacktrace)
> > >
> > > My doubts are
> > >
> > > - what does it mean :-)
> > > - why only in windows
> > > - is there any way to deal with this?
> > >
> > > My feeling it that it's somehow related to the OpenJPA enhancement
> > process,
> > > but I really don't have a clue here.
> > >
> > > TIA
> > >
> > > Leo
> > >
> > > Exception in thread "main" javax.ejb.EJBException: The bean
> encountered a
> > > non-application exception; nested exception is:
> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > > org.apache.openjpa.persistence.PersistenceException: null
> > >     at
> > >
> > >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> > >
> > >     at (...)    at
> > > (...)
> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > > org.apache.openjpa.persistence.PersistenceException: null
> > >     at
> > >
> > >
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> > >
> > >     at
> > >
> > >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> > >
> > >  (...)
> > > Caused by: java.lang.VerifyError
> > >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > > Method)
> > >     at
> > >
> > >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> > >
> > >     ... 52 more
> > >
> >
> >
> >
> > --
> > *Rick Curtis*
> >
>



-- 
*Rick Curtis*

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Kevin Sutter <kw...@gmail.com>.
What method of enhancement is being used?  From the call stack, it looks
like you might be using the RuntimeUnenhancedClasses support which is not a
recommended practice [1].

org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)

[1]  http://openjpa.apache.org/entity-enhancement.html


On Tue, Sep 17, 2013 at 3:44 PM, Rick Curtis <cu...@gmail.com> wrote:

> What are the versions of JDK that you used on Windows / Linux... and what
> JDK did you use to build the application?
>
>
> On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <shikida@gmail.com
> >wrote:
>
> > Hi
> >
> > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
> run
> > from windows, it gives me the following error message (see stacktrace)
> >
> > My doubts are
> >
> > - what does it mean :-)
> > - why only in windows
> > - is there any way to deal with this?
> >
> > My feeling it that it's somehow related to the OpenJPA enhancement
> process,
> > but I really don't have a clue here.
> >
> > TIA
> >
> > Leo
> >
> > Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> > non-application exception; nested exception is:
> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >
> >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >
> >     at (...)    at
> > (...)
> > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> >     at
> >
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> >
> >     at
> >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> >
> >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >
> >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >
> >     at
> >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> >
> >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> >
> >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> >
> >  (...)
> > Caused by: java.lang.VerifyError
> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > Method)
> >     at
> >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >
> >     ... 52 more
> >
>
>
>
> --
> *Rick Curtis*
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
So

It seems that if I use IBM JVM (J9) in both windows and linux, it works.

If I use oracle's, then I get the error.

This code I am running in an embedded TomEE+

So I run it from a regular main() method just like this

        p = getMysqlDatasource();
        ejbContainer = EJBContainer.createEJBContainer(p);
        context = ejbContainer.getContext();
        authEJB = (AuthEJB)
context.lookup("java:global/XYZ/"+AuthEJB.class.getSimpleName());
...

My persistence.xml does not have

 <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>

And I get the warning

WARNING: Creating subclass for "[...]".
This means that your application will be
less efficient and will consume more memory
than it would if you ran the OpenJPA enhancer.

Additionally, lazy loading will not be
available for one-to-one and many-to-one
persistent attributes in types using field
access; they will be loaded eagerly instead.

TIA

Leo







[]

Leo


On Tue, Sep 17, 2013 at 8:27 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> BTW, it was Oracle JDK 1.7.0_25
>
> It seems there's 1.7.0_40 already
>
> Let me give a try
>
> TIA
>
> Leo
>
> []
>
> Leo
>
>
> On Tue, Sep 17, 2013 at 8:10 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> Hi Rick
>>
>> your tip seems to be in the right track.
>>
>> my linux version was working with IBM JVM, but since I've switched to
>> Oracle's (the same I was using in windows) now I can reproduce the error in
>> linux too...
>>
>> I'll do my homework here
>>
>> Thanks
>>
>> []
>>
>> Leo
>>
>>
>> On Tue, Sep 17, 2013 at 5:44 PM, Rick Curtis <cu...@gmail.com> wrote:
>>
>>> What are the versions of JDK that you used on Windows / Linux... and what
>>> JDK did you use to build the application?
>>>
>>>
>>> On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <shikida@gmail.com
>>> >wrote:
>>>
>>> > Hi
>>> >
>>> > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try
>>> to run
>>> > from windows, it gives me the following error message (see stacktrace)
>>> >
>>> > My doubts are
>>> >
>>> > - what does it mean :-)
>>> > - why only in windows
>>> > - is there any way to deal with this?
>>> >
>>> > My feeling it that it's somehow related to the OpenJPA enhancement
>>> process,
>>> > but I really don't have a clue here.
>>> >
>>> > TIA
>>> >
>>> > Leo
>>> >
>>> > Exception in thread "main" javax.ejb.EJBException: The bean
>>> encountered a
>>> > non-application exception; nested exception is:
>>> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> > org.apache.openjpa.persistence.PersistenceException: null
>>> >     at
>>> >
>>> >
>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>>> >
>>> >     at (...)    at
>>> > (...)
>>> > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> > org.apache.openjpa.persistence.PersistenceException: null
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>>> >
>>> >     at
>>> >
>>> >
>>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>>> >
>>> >  (...)
>>> > Caused by: java.lang.VerifyError
>>> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
>>> > Method)
>>> >     at
>>> >
>>> >
>>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>>> >
>>> >     ... 52 more
>>> >
>>>
>>>
>>>
>>> --
>>> *Rick Curtis*
>>>
>>
>>
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
BTW, it was Oracle JDK 1.7.0_25

It seems there's 1.7.0_40 already

Let me give a try

TIA

Leo

[]

Leo


On Tue, Sep 17, 2013 at 8:10 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> Hi Rick
>
> your tip seems to be in the right track.
>
> my linux version was working with IBM JVM, but since I've switched to
> Oracle's (the same I was using in windows) now I can reproduce the error in
> linux too...
>
> I'll do my homework here
>
> Thanks
>
> []
>
> Leo
>
>
> On Tue, Sep 17, 2013 at 5:44 PM, Rick Curtis <cu...@gmail.com> wrote:
>
>> What are the versions of JDK that you used on Windows / Linux... and what
>> JDK did you use to build the application?
>>
>>
>> On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <shikida@gmail.com
>> >wrote:
>>
>> > Hi
>> >
>> > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
>> run
>> > from windows, it gives me the following error message (see stacktrace)
>> >
>> > My doubts are
>> >
>> > - what does it mean :-)
>> > - why only in windows
>> > - is there any way to deal with this?
>> >
>> > My feeling it that it's somehow related to the OpenJPA enhancement
>> process,
>> > but I really don't have a clue here.
>> >
>> > TIA
>> >
>> > Leo
>> >
>> > Exception in thread "main" javax.ejb.EJBException: The bean encountered
>> a
>> > non-application exception; nested exception is:
>> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > org.apache.openjpa.persistence.PersistenceException: null
>> >     at
>> >
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>> >
>> >     at
>> >
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>> >
>> >     at (...)    at
>> > (...)
>> > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > org.apache.openjpa.persistence.PersistenceException: null
>> >     at
>> >
>> >
>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>> >
>> >     at
>> >
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>> >
>> >     at
>> >
>> >
>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>> >
>> >     at
>> >
>> >
>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>> >
>> >     at
>> >
>> >
>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>> >
>> >  (...)
>> > Caused by: java.lang.VerifyError
>> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
>> > Method)
>> >     at
>> >
>> >
>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>> >
>> >     ... 52 more
>> >
>>
>>
>>
>> --
>> *Rick Curtis*
>>
>
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi Rick

your tip seems to be in the right track.

my linux version was working with IBM JVM, but since I've switched to
Oracle's (the same I was using in windows) now I can reproduce the error in
linux too...

I'll do my homework here

Thanks

[]

Leo


On Tue, Sep 17, 2013 at 5:44 PM, Rick Curtis <cu...@gmail.com> wrote:

> What are the versions of JDK that you used on Windows / Linux... and what
> JDK did you use to build the application?
>
>
> On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <shikida@gmail.com
> >wrote:
>
> > Hi
> >
> > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
> run
> > from windows, it gives me the following error message (see stacktrace)
> >
> > My doubts are
> >
> > - what does it mean :-)
> > - why only in windows
> > - is there any way to deal with this?
> >
> > My feeling it that it's somehow related to the OpenJPA enhancement
> process,
> > but I really don't have a clue here.
> >
> > TIA
> >
> > Leo
> >
> > Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> > non-application exception; nested exception is:
> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >
> >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >
> >     at (...)    at
> > (...)
> > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> >     at
> >
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> >
> >     at
> >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >
> >     at
> >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> >
> >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >
> >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >
> >     at
> >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> >
> >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> >
> >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> >
> >  (...)
> > Caused by: java.lang.VerifyError
> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > Method)
> >     at
> >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >
> >     ... 52 more
> >
>
>
>
> --
> *Rick Curtis*
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Rick Curtis <cu...@gmail.com>.
What are the versions of JDK that you used on Windows / Linux... and what
JDK did you use to build the application?


On Tue, Sep 17, 2013 at 3:14 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> Hi
>
> I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to run
> from windows, it gives me the following error message (see stacktrace)
>
> My doubts are
>
> - what does it mean :-)
> - why only in windows
> - is there any way to deal with this?
>
> My feeling it that it's somehow related to the OpenJPA enhancement process,
> but I really don't have a clue here.
>
> TIA
>
> Leo
>
> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> non-application exception; nested exception is:
>     <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
>     at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>
>     at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>
>     at (...)    at
> (...)
> Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
>     at
>
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>
>     at
>
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>
>     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>
>     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>
>     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>
>     at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>
>     at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>
>     at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>
>     at
>
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>
>     at
>
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>
>     at
>
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>
>  (...)
> Caused by: java.lang.VerifyError
>     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> Method)
>     at
>
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>
>     ... 52 more
>



-- 
*Rick Curtis*

Fwd: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi

I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to run
from windows, it gives me the following error message (see stacktrace)

My doubts are

- what does it mean :-)
- why only in windows
- is there any way to deal with this?

My feeling it that it's somehow related to the OpenJPA enhancement process,
but I really don't have a clue here.

TIA

Leo

Exception in thread "main" javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
    <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
    at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)

    at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)

    at (...)    at
(...)
Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
    at
org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)

    at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)

    at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)

    at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)

    at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)

    at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)

    at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)

    at
org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)

    at
org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)

 (...)
Caused by: java.lang.VerifyError
    at sun.instrument.InstrumentationImpl.retransformClasses0(Native
Method)
    at
sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)

    ... 52 more

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
thanks, I'll give it a try

[]

Leo


On Wed, Sep 18, 2013 at 12:50 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> A real project pom doing it:
> https://github.com/rmannibucau/JeBlog/blob/master/pom.xml
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> > So,
> >
> > what seems to work for me now was to enhance the classes before using
> them.
> >
> > thanks Rick and Romain
> >
> > It sounds a little wrong for me that I have to add an annotation
> processor
> > to generate classes for criteria (openjpa.metamodel=true) and another
> step
> > to post-process classes before using the classes. Isn't java source code
> > good enough? :-)
> >
> > And since I am too lazy to add an eclipse plugin that renders in a way
> that
> > I can't read the last checkbox, neither I want to change my eclipse
> project
> > structure to use an ant builder, and neither I want to move from 1.5.2 to
> > 1.6.0 right now, I decided to post-process my class manually with this
> > snippet.
> >
> >     public static void main(String[] args) {
> >         String baseClassDir = "/path/to/classes/";
> >         Collection<File> files = FileUtils.listFiles(new
> > File(baseClassDir), null, true);
> >         for(File file:files){
> >             String[] a = new String[3];
> >             a[0] = "-d";
> >             a[1] = baseClassDir;
> >             a[2] = file.getAbsolutePath();
> >             org.apache.openjpa.enhance.PCEnhancer.main(a);
> >         }
> >     }
> >
> > Maybe this can help someone, I hope :-)
> >
> > TIA
> >
> > Leo
> >
> > []
> >
> > Leo
> >
> >
> > On Wed, Sep 18, 2013 at 11:58 AM, Leonardo K. Shikida <shikida@gmail.com
> >wrote:
> >
> >> Also, it seems somehow consistent about the JDK. Both IBM 7 JDKs for
> >> windows and linux work, and both Oracle JDK for oracle 7 (u40) don't.
> >>
> >> TIA
> >>
> >> Leo
> >>
> >> []
> >>
> >> Leo
> >>
> >>
> >> On Wed, Sep 18, 2013 at 11:52 AM, Leonardo K. Shikida <
> shikida@gmail.com>wrote:
> >>
> >>> Hi Rick
> >>>
> >>> here what happens
> >>>
> >>> when I run from eclipse, using IBM JDK 7 on linux, I defaults to
> subclass
> >>>
> >>>
> >>> WARNING: Creating subclass for "[...]". This means that your
> application
> >>> will be less efficient and will consume more memory than it would if
> you
> >>> ran the OpenJPA enhancer. Additionally, lazy loading will not be
> available
> >>> for one-to-one and many-to-one persistent attributes in types using
> field
> >>> access; they will be loaded eagerly instead.
> >>>
> >>> but it works.
> >>>
> >>> now, the same thing but using the javaagent in eclipse run
> configurations
> >>>
> >>> -javaagent:/path/to/openejb-javaagent.jar
> >>>
> >>> then I get
> >>>
> >>> INFO: Creating subclass and redefining methods for "[...]". This means
> >>> that your application will be less efficient than it would if you ran
> the
> >>> OpenJPA enhancer.
> >>>
> >>> Exception in thread "main" javax.ejb.EJBException: The bean
> encountered a
> >>> non-application exception; nested exception is:
> >>>     <openjpa-2.2.0-r422266:1244990 fatal general error>
> >>> org.apache.openjpa.persistence.PersistenceException: null
> >>>
> >>> which is pretty the same error I get if I use Oracle JVM and no
> javaagent
> >>>
> >>> TIA
> >>>
> >>> Leo
> >>>
> >>>
> >>> []
> >>>
> >>> Leo
> >>>
> >>>
> >>> On Wed, Sep 18, 2013 at 11:35 AM, Rick Curtis <cu...@gmail.com>
> wrote:
> >>>
> >>>> The waters are getting pretty muddy here.... but I'll try my best to
> >>>> clear
> >>>> things up.
> >>>>
> >>>> I'm not certain, but I suspect that when running on the IBM JVM, the
> >>>> openjpa.DynamicEnhancementAgent was kicking in an your Entities were
> >>>> getting enhanced automagically. For whatever reason it sounds like
> that
> >>>> wasn't working on the Windows Oracle JVM and it was falling back to
> >>>> subclassing. I know you mentioned that you don't have
> >>>> openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
> >>>> trace that you posted indicates otherwise.
> >>>>
> >>>> The root issue here is that your entities weren't being enhanced. It
> >>>> sounds
> >>>> like now that you have the latest version of the tomEE agent hooked
> up,
> >>>> everything is working? If you prefer to not go the agent path, you
> could
> >>>> always use build time enhancement and not have to mess with any of
> this
> >>>> business.
> >>>>
> >>>> HTH,
> >>>> Rick
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
> >>>> <rm...@gmail.com>wrote:
> >>>>
> >>>> > the javaagent was broken (fixed on trunk) so i fear you need to
> >>>> > enhance classes in your build
> >>>> > Romain Manni-Bucau
> >>>> > Twitter: @rmannibucau
> >>>> > Blog: http://rmannibucau.wordpress.com/
> >>>> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >>>> > Github: https://github.com/rmannibucau
> >>>> >
> >>>> >
> >>>> >
> >>>> > 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> >>>> > > Hi Romain
> >>>> > >
> >>>> > > thanks
> >>>> > >
> >>>> > > I am running some code using tomEE embedded in a main() method,
> using
> >>>> > > eclipse.
> >>>> > >
> >>>> > > So I've added to the run configurations->java application->my
> >>>> class->VM
> >>>> > > arguments
> >>>> > >
> >>>> > > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
> >>>> > >
> >>>> > > As suggested in (I guess)
> >>>> > >
> >>>> > >
> >>>> >
> >>>>
> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
> >>>> > >
> >>>> > > But I still get an error such as
> >>>> > >
> >>>> > > INFO: Creating subclass and redefining methods for "[class xyz]".
> >>>> This
> >>>> > > means that your application will be less efficient than it would
> if
> >>>> you
> >>>> > ran
> >>>> > > the OpenJPA enhancer.
> >>>> > > Exception in thread "main" javax.ejb.EJBException: The bean
> >>>> encountered a
> >>>> > > non-application exception; nested exception is:
> >>>> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> >>>> > > org.apache.openjpa.persistence.PersistenceException: null
> >>>> > >
> >>>> > > Am I missing something here?
> >>>> > >
> >>>> > > Your posts below talks about some system properties, is it enough
> to
> >>>> just
> >>>> > > drop them into properties.xml for tomee 1.5.2?
> >>>> > >
> >>>> > >
> >>>> >
> >>>>
> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
> >>>> > >
> >>>> > > TIA
> >>>> > >
> >>>> > > Leo
> >>>> > >
> >>>> > >
> >>>> > >
> >>>> > >
> >>>> > >
> >>>> > > []
> >>>> > >
> >>>> > > Leo
> >>>> > >
> >>>> > >
> >>>> > > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
> >>>> > > <rm...@gmail.com>wrote:
> >>>> > >
> >>>> > >> Hi
> >>>> > >>
> >>>> > >> Note: In tomee on trunk if you list your classes in
> >>>> persistence-unit it
> >>>> > is
> >>>> > >> automatically done if the persistence.xml is in
> >>>> meta-inf/persistence.xml
> >>>> > >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> >>>> > écrit
> >>>> > >> :
> >>>> > >>
> >>>> > >> > So just answering myself (openJPA list brought the solution)
> >>>> > >> >
> >>>> > >> > It seems that if I use IBM JVM (J9) in both windows and linux,
> it
> >>>> > works.
> >>>> > >> >
> >>>> > >> > If I use oracle's, then I get the error.
> >>>> > >> >
> >>>> > >> > My persistence.xml does not have
> >>>> > >> >
> >>>> > >> >  <property name="openjpa.RuntimeUnenhancedClasses"
> >>>> > value="unsupported"/>
> >>>> > >> >
> >>>> > >> > And I get the warning
> >>>> > >> >
> >>>> > >> > WARNING: Creating subclass for "[...]".
> >>>> > >> > This means that your application will be
> >>>> > >> > less efficient and will consume more memory
> >>>> > >> > than it would if you ran the OpenJPA enhancer.
> >>>> > >> >
> >>>> > >> > Additionally, lazy loading will not be
> >>>> > >> > available for one-to-one and many-to-one
> >>>> > >> > persistent attributes in types using field
> >>>> > >> > access; they will be loaded eagerly instead.
> >>>> > >> >
> >>>> > >> > And this procedure is not recommended as stated at
> >>>> > >> > http://openjpa.apache.org/entity-enhancement.html
> >>>> > >> >
> >>>> > >> > "The use of OpenJPA's subclassing support is not recommended,
> and
> >>>> is
> >>>> > >> > disabled by default in OpenJPA 2.0 and beyond."
> >>>> > >> >
> >>>> > >> > TIA
> >>>> > >> >
> >>>> > >> >
> >>>> > >> > Leo
> >>>> > >> >
> >>>> > >> >
> >>>> > >> >
> >>>> > >> > []
> >>>> > >> >
> >>>> > >> > Leo
> >>>> > >> >
> >>>> > >> >
> >>>> > >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
> >>>> > shikida@gmail.com>
> >>>> > >> > wrote:
> >>>> > >> > >
> >>>> > >> > > Hi
> >>>> > >> > >
> >>>> > >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but
> when I
> >>>> > try to
> >>>> > >> > run from windows, it gives me the following error message (see
> >>>> > >> stacktrace)
> >>>> > >> > >
> >>>> > >> > > My doubts are
> >>>> > >> > >
> >>>> > >> > > - what does it mean :-)
> >>>> > >> > > - why only in windows
> >>>> > >> > > - is there any way to deal with this?
> >>>> > >> > >
> >>>> > >> > > My feeling it that it's somehow related to the OpenJPA
> >>>> enhancement
> >>>> > >> > process, but I really don't have a clue here.
> >>>> > >> > >
> >>>> > >> > > TIA
> >>>> > >> > >
> >>>> > >> > > Leo
> >>>> > >> > >
> >>>> > >> > > Exception in thread "main" javax.ejb.EJBException: The bean
> >>>> > >> encountered a
> >>>> > >> > non-application exception; nested exception is:
> >>>> > >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> >>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >>>> > >> > >     at (...)    at
> >>>> > >> > > (...)
> >>>> > >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general
> error>
> >>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> >>>> > >> > >  (...)
> >>>> > >> > > Caused by: java.lang.VerifyError
> >>>> > >> > >     at
> >>>> sun.instrument.InstrumentationImpl.retransformClasses0(Native
> >>>> > >> > Method)
> >>>> > >> > >     at
> >>>> > >> >
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >>>> > >> > >     ... 52 more
> >>>> > >> > >
> >>>> > >> > > []
> >>>> > >> > >
> >>>> > >> > > Leo
> >>>> > >> >
> >>>> > >>
> >>>> >
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> *Rick Curtis*
> >>>>
> >>>
> >>>
> >>
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Romain Manni-Bucau <rm...@gmail.com>.
A real project pom doing it:
https://github.com/rmannibucau/JeBlog/blob/master/pom.xml
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> So,
>
> what seems to work for me now was to enhance the classes before using them.
>
> thanks Rick and Romain
>
> It sounds a little wrong for me that I have to add an annotation processor
> to generate classes for criteria (openjpa.metamodel=true) and another step
> to post-process classes before using the classes. Isn't java source code
> good enough? :-)
>
> And since I am too lazy to add an eclipse plugin that renders in a way that
> I can't read the last checkbox, neither I want to change my eclipse project
> structure to use an ant builder, and neither I want to move from 1.5.2 to
> 1.6.0 right now, I decided to post-process my class manually with this
> snippet.
>
>     public static void main(String[] args) {
>         String baseClassDir = "/path/to/classes/";
>         Collection<File> files = FileUtils.listFiles(new
> File(baseClassDir), null, true);
>         for(File file:files){
>             String[] a = new String[3];
>             a[0] = "-d";
>             a[1] = baseClassDir;
>             a[2] = file.getAbsolutePath();
>             org.apache.openjpa.enhance.PCEnhancer.main(a);
>         }
>     }
>
> Maybe this can help someone, I hope :-)
>
> TIA
>
> Leo
>
> []
>
> Leo
>
>
> On Wed, Sep 18, 2013 at 11:58 AM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> Also, it seems somehow consistent about the JDK. Both IBM 7 JDKs for
>> windows and linux work, and both Oracle JDK for oracle 7 (u40) don't.
>>
>> TIA
>>
>> Leo
>>
>> []
>>
>> Leo
>>
>>
>> On Wed, Sep 18, 2013 at 11:52 AM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>>
>>> Hi Rick
>>>
>>> here what happens
>>>
>>> when I run from eclipse, using IBM JDK 7 on linux, I defaults to subclass
>>>
>>>
>>> WARNING: Creating subclass for "[...]". This means that your application
>>> will be less efficient and will consume more memory than it would if you
>>> ran the OpenJPA enhancer. Additionally, lazy loading will not be available
>>> for one-to-one and many-to-one persistent attributes in types using field
>>> access; they will be loaded eagerly instead.
>>>
>>> but it works.
>>>
>>> now, the same thing but using the javaagent in eclipse run configurations
>>>
>>> -javaagent:/path/to/openejb-javaagent.jar
>>>
>>> then I get
>>>
>>> INFO: Creating subclass and redefining methods for "[...]". This means
>>> that your application will be less efficient than it would if you ran the
>>> OpenJPA enhancer.
>>>
>>> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
>>> non-application exception; nested exception is:
>>>     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> org.apache.openjpa.persistence.PersistenceException: null
>>>
>>> which is pretty the same error I get if I use Oracle JVM and no javaagent
>>>
>>> TIA
>>>
>>> Leo
>>>
>>>
>>> []
>>>
>>> Leo
>>>
>>>
>>> On Wed, Sep 18, 2013 at 11:35 AM, Rick Curtis <cu...@gmail.com> wrote:
>>>
>>>> The waters are getting pretty muddy here.... but I'll try my best to
>>>> clear
>>>> things up.
>>>>
>>>> I'm not certain, but I suspect that when running on the IBM JVM, the
>>>> openjpa.DynamicEnhancementAgent was kicking in an your Entities were
>>>> getting enhanced automagically. For whatever reason it sounds like that
>>>> wasn't working on the Windows Oracle JVM and it was falling back to
>>>> subclassing. I know you mentioned that you don't have
>>>> openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
>>>> trace that you posted indicates otherwise.
>>>>
>>>> The root issue here is that your entities weren't being enhanced. It
>>>> sounds
>>>> like now that you have the latest version of the tomEE agent hooked up,
>>>> everything is working? If you prefer to not go the agent path, you could
>>>> always use build time enhancement and not have to mess with any of this
>>>> business.
>>>>
>>>> HTH,
>>>> Rick
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
>>>> <rm...@gmail.com>wrote:
>>>>
>>>> > the javaagent was broken (fixed on trunk) so i fear you need to
>>>> > enhance classes in your build
>>>> > Romain Manni-Bucau
>>>> > Twitter: @rmannibucau
>>>> > Blog: http://rmannibucau.wordpress.com/
>>>> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
>>>> > Github: https://github.com/rmannibucau
>>>> >
>>>> >
>>>> >
>>>> > 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
>>>> > > Hi Romain
>>>> > >
>>>> > > thanks
>>>> > >
>>>> > > I am running some code using tomEE embedded in a main() method, using
>>>> > > eclipse.
>>>> > >
>>>> > > So I've added to the run configurations->java application->my
>>>> class->VM
>>>> > > arguments
>>>> > >
>>>> > > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
>>>> > >
>>>> > > As suggested in (I guess)
>>>> > >
>>>> > >
>>>> >
>>>> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
>>>> > >
>>>> > > But I still get an error such as
>>>> > >
>>>> > > INFO: Creating subclass and redefining methods for "[class xyz]".
>>>> This
>>>> > > means that your application will be less efficient than it would if
>>>> you
>>>> > ran
>>>> > > the OpenJPA enhancer.
>>>> > > Exception in thread "main" javax.ejb.EJBException: The bean
>>>> encountered a
>>>> > > non-application exception; nested exception is:
>>>> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>>> > > org.apache.openjpa.persistence.PersistenceException: null
>>>> > >
>>>> > > Am I missing something here?
>>>> > >
>>>> > > Your posts below talks about some system properties, is it enough to
>>>> just
>>>> > > drop them into properties.xml for tomee 1.5.2?
>>>> > >
>>>> > >
>>>> >
>>>> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
>>>> > >
>>>> > > TIA
>>>> > >
>>>> > > Leo
>>>> > >
>>>> > >
>>>> > >
>>>> > >
>>>> > >
>>>> > > []
>>>> > >
>>>> > > Leo
>>>> > >
>>>> > >
>>>> > > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
>>>> > > <rm...@gmail.com>wrote:
>>>> > >
>>>> > >> Hi
>>>> > >>
>>>> > >> Note: In tomee on trunk if you list your classes in
>>>> persistence-unit it
>>>> > is
>>>> > >> automatically done if the persistence.xml is in
>>>> meta-inf/persistence.xml
>>>> > >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a
>>>> > écrit
>>>> > >> :
>>>> > >>
>>>> > >> > So just answering myself (openJPA list brought the solution)
>>>> > >> >
>>>> > >> > It seems that if I use IBM JVM (J9) in both windows and linux, it
>>>> > works.
>>>> > >> >
>>>> > >> > If I use oracle's, then I get the error.
>>>> > >> >
>>>> > >> > My persistence.xml does not have
>>>> > >> >
>>>> > >> >  <property name="openjpa.RuntimeUnenhancedClasses"
>>>> > value="unsupported"/>
>>>> > >> >
>>>> > >> > And I get the warning
>>>> > >> >
>>>> > >> > WARNING: Creating subclass for "[...]".
>>>> > >> > This means that your application will be
>>>> > >> > less efficient and will consume more memory
>>>> > >> > than it would if you ran the OpenJPA enhancer.
>>>> > >> >
>>>> > >> > Additionally, lazy loading will not be
>>>> > >> > available for one-to-one and many-to-one
>>>> > >> > persistent attributes in types using field
>>>> > >> > access; they will be loaded eagerly instead.
>>>> > >> >
>>>> > >> > And this procedure is not recommended as stated at
>>>> > >> > http://openjpa.apache.org/entity-enhancement.html
>>>> > >> >
>>>> > >> > "The use of OpenJPA's subclassing support is not recommended, and
>>>> is
>>>> > >> > disabled by default in OpenJPA 2.0 and beyond."
>>>> > >> >
>>>> > >> > TIA
>>>> > >> >
>>>> > >> >
>>>> > >> > Leo
>>>> > >> >
>>>> > >> >
>>>> > >> >
>>>> > >> > []
>>>> > >> >
>>>> > >> > Leo
>>>> > >> >
>>>> > >> >
>>>> > >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
>>>> > shikida@gmail.com>
>>>> > >> > wrote:
>>>> > >> > >
>>>> > >> > > Hi
>>>> > >> > >
>>>> > >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I
>>>> > try to
>>>> > >> > run from windows, it gives me the following error message (see
>>>> > >> stacktrace)
>>>> > >> > >
>>>> > >> > > My doubts are
>>>> > >> > >
>>>> > >> > > - what does it mean :-)
>>>> > >> > > - why only in windows
>>>> > >> > > - is there any way to deal with this?
>>>> > >> > >
>>>> > >> > > My feeling it that it's somehow related to the OpenJPA
>>>> enhancement
>>>> > >> > process, but I really don't have a clue here.
>>>> > >> > >
>>>> > >> > > TIA
>>>> > >> > >
>>>> > >> > > Leo
>>>> > >> > >
>>>> > >> > > Exception in thread "main" javax.ejb.EJBException: The bean
>>>> > >> encountered a
>>>> > >> > non-application exception; nested exception is:
>>>> > >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>>>> > >> > >     at (...)    at
>>>> > >> > > (...)
>>>> > >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>>>> > >> > >  (...)
>>>> > >> > > Caused by: java.lang.VerifyError
>>>> > >> > >     at
>>>> sun.instrument.InstrumentationImpl.retransformClasses0(Native
>>>> > >> > Method)
>>>> > >> > >     at
>>>> > >> >
>>>> > >> >
>>>> > >>
>>>> >
>>>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>>>> > >> > >     ... 52 more
>>>> > >> > >
>>>> > >> > > []
>>>> > >> > >
>>>> > >> > > Leo
>>>> > >> >
>>>> > >>
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> *Rick Curtis*
>>>>
>>>
>>>
>>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
So,

what seems to work for me now was to enhance the classes before using them.

thanks Rick and Romain

It sounds a little wrong for me that I have to add an annotation processor
to generate classes for criteria (openjpa.metamodel=true) and another step
to post-process classes before using the classes. Isn't java source code
good enough? :-)

And since I am too lazy to add an eclipse plugin that renders in a way that
I can't read the last checkbox, neither I want to change my eclipse project
structure to use an ant builder, and neither I want to move from 1.5.2 to
1.6.0 right now, I decided to post-process my class manually with this
snippet.

    public static void main(String[] args) {
        String baseClassDir = "/path/to/classes/";
        Collection<File> files = FileUtils.listFiles(new
File(baseClassDir), null, true);
        for(File file:files){
            String[] a = new String[3];
            a[0] = "-d";
            a[1] = baseClassDir;
            a[2] = file.getAbsolutePath();
            org.apache.openjpa.enhance.PCEnhancer.main(a);
        }
    }

Maybe this can help someone, I hope :-)

TIA

Leo

[]

Leo


On Wed, Sep 18, 2013 at 11:58 AM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> Also, it seems somehow consistent about the JDK. Both IBM 7 JDKs for
> windows and linux work, and both Oracle JDK for oracle 7 (u40) don't.
>
> TIA
>
> Leo
>
> []
>
> Leo
>
>
> On Wed, Sep 18, 2013 at 11:52 AM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> Hi Rick
>>
>> here what happens
>>
>> when I run from eclipse, using IBM JDK 7 on linux, I defaults to subclass
>>
>>
>> WARNING: Creating subclass for "[...]". This means that your application
>> will be less efficient and will consume more memory than it would if you
>> ran the OpenJPA enhancer. Additionally, lazy loading will not be available
>> for one-to-one and many-to-one persistent attributes in types using field
>> access; they will be loaded eagerly instead.
>>
>> but it works.
>>
>> now, the same thing but using the javaagent in eclipse run configurations
>>
>> -javaagent:/path/to/openejb-javaagent.jar
>>
>> then I get
>>
>> INFO: Creating subclass and redefining methods for "[...]". This means
>> that your application will be less efficient than it would if you ran the
>> OpenJPA enhancer.
>>
>> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
>> non-application exception; nested exception is:
>>     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> org.apache.openjpa.persistence.PersistenceException: null
>>
>> which is pretty the same error I get if I use Oracle JVM and no javaagent
>>
>> TIA
>>
>> Leo
>>
>>
>> []
>>
>> Leo
>>
>>
>> On Wed, Sep 18, 2013 at 11:35 AM, Rick Curtis <cu...@gmail.com> wrote:
>>
>>> The waters are getting pretty muddy here.... but I'll try my best to
>>> clear
>>> things up.
>>>
>>> I'm not certain, but I suspect that when running on the IBM JVM, the
>>> openjpa.DynamicEnhancementAgent was kicking in an your Entities were
>>> getting enhanced automagically. For whatever reason it sounds like that
>>> wasn't working on the Windows Oracle JVM and it was falling back to
>>> subclassing. I know you mentioned that you don't have
>>> openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
>>> trace that you posted indicates otherwise.
>>>
>>> The root issue here is that your entities weren't being enhanced. It
>>> sounds
>>> like now that you have the latest version of the tomEE agent hooked up,
>>> everything is working? If you prefer to not go the agent path, you could
>>> always use build time enhancement and not have to mess with any of this
>>> business.
>>>
>>> HTH,
>>> Rick
>>>
>>>
>>>
>>>
>>> On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
>>> <rm...@gmail.com>wrote:
>>>
>>> > the javaagent was broken (fixed on trunk) so i fear you need to
>>> > enhance classes in your build
>>> > Romain Manni-Bucau
>>> > Twitter: @rmannibucau
>>> > Blog: http://rmannibucau.wordpress.com/
>>> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
>>> > Github: https://github.com/rmannibucau
>>> >
>>> >
>>> >
>>> > 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
>>> > > Hi Romain
>>> > >
>>> > > thanks
>>> > >
>>> > > I am running some code using tomEE embedded in a main() method, using
>>> > > eclipse.
>>> > >
>>> > > So I've added to the run configurations->java application->my
>>> class->VM
>>> > > arguments
>>> > >
>>> > > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
>>> > >
>>> > > As suggested in (I guess)
>>> > >
>>> > >
>>> >
>>> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
>>> > >
>>> > > But I still get an error such as
>>> > >
>>> > > INFO: Creating subclass and redefining methods for "[class xyz]".
>>> This
>>> > > means that your application will be less efficient than it would if
>>> you
>>> > ran
>>> > > the OpenJPA enhancer.
>>> > > Exception in thread "main" javax.ejb.EJBException: The bean
>>> encountered a
>>> > > non-application exception; nested exception is:
>>> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> > > org.apache.openjpa.persistence.PersistenceException: null
>>> > >
>>> > > Am I missing something here?
>>> > >
>>> > > Your posts below talks about some system properties, is it enough to
>>> just
>>> > > drop them into properties.xml for tomee 1.5.2?
>>> > >
>>> > >
>>> >
>>> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
>>> > >
>>> > > TIA
>>> > >
>>> > > Leo
>>> > >
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > []
>>> > >
>>> > > Leo
>>> > >
>>> > >
>>> > > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
>>> > > <rm...@gmail.com>wrote:
>>> > >
>>> > >> Hi
>>> > >>
>>> > >> Note: In tomee on trunk if you list your classes in
>>> persistence-unit it
>>> > is
>>> > >> automatically done if the persistence.xml is in
>>> meta-inf/persistence.xml
>>> > >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> > écrit
>>> > >> :
>>> > >>
>>> > >> > So just answering myself (openJPA list brought the solution)
>>> > >> >
>>> > >> > It seems that if I use IBM JVM (J9) in both windows and linux, it
>>> > works.
>>> > >> >
>>> > >> > If I use oracle's, then I get the error.
>>> > >> >
>>> > >> > My persistence.xml does not have
>>> > >> >
>>> > >> >  <property name="openjpa.RuntimeUnenhancedClasses"
>>> > value="unsupported"/>
>>> > >> >
>>> > >> > And I get the warning
>>> > >> >
>>> > >> > WARNING: Creating subclass for "[...]".
>>> > >> > This means that your application will be
>>> > >> > less efficient and will consume more memory
>>> > >> > than it would if you ran the OpenJPA enhancer.
>>> > >> >
>>> > >> > Additionally, lazy loading will not be
>>> > >> > available for one-to-one and many-to-one
>>> > >> > persistent attributes in types using field
>>> > >> > access; they will be loaded eagerly instead.
>>> > >> >
>>> > >> > And this procedure is not recommended as stated at
>>> > >> > http://openjpa.apache.org/entity-enhancement.html
>>> > >> >
>>> > >> > "The use of OpenJPA's subclassing support is not recommended, and
>>> is
>>> > >> > disabled by default in OpenJPA 2.0 and beyond."
>>> > >> >
>>> > >> > TIA
>>> > >> >
>>> > >> >
>>> > >> > Leo
>>> > >> >
>>> > >> >
>>> > >> >
>>> > >> > []
>>> > >> >
>>> > >> > Leo
>>> > >> >
>>> > >> >
>>> > >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
>>> > shikida@gmail.com>
>>> > >> > wrote:
>>> > >> > >
>>> > >> > > Hi
>>> > >> > >
>>> > >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I
>>> > try to
>>> > >> > run from windows, it gives me the following error message (see
>>> > >> stacktrace)
>>> > >> > >
>>> > >> > > My doubts are
>>> > >> > >
>>> > >> > > - what does it mean :-)
>>> > >> > > - why only in windows
>>> > >> > > - is there any way to deal with this?
>>> > >> > >
>>> > >> > > My feeling it that it's somehow related to the OpenJPA
>>> enhancement
>>> > >> > process, but I really don't have a clue here.
>>> > >> > >
>>> > >> > > TIA
>>> > >> > >
>>> > >> > > Leo
>>> > >> > >
>>> > >> > > Exception in thread "main" javax.ejb.EJBException: The bean
>>> > >> encountered a
>>> > >> > non-application exception; nested exception is:
>>> > >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>>> > >> > >     at (...)    at
>>> > >> > > (...)
>>> > >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>>> > >> > >  (...)
>>> > >> > > Caused by: java.lang.VerifyError
>>> > >> > >     at
>>> sun.instrument.InstrumentationImpl.retransformClasses0(Native
>>> > >> > Method)
>>> > >> > >     at
>>> > >> >
>>> > >> >
>>> > >>
>>> >
>>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>>> > >> > >     ... 52 more
>>> > >> > >
>>> > >> > > []
>>> > >> > >
>>> > >> > > Leo
>>> > >> >
>>> > >>
>>> >
>>>
>>>
>>>
>>> --
>>> *Rick Curtis*
>>>
>>
>>
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Also, it seems somehow consistent about the JDK. Both IBM 7 JDKs for
windows and linux work, and both Oracle JDK for oracle 7 (u40) don't.

TIA

Leo

[]

Leo


On Wed, Sep 18, 2013 at 11:52 AM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> Hi Rick
>
> here what happens
>
> when I run from eclipse, using IBM JDK 7 on linux, I defaults to subclass
>
>
> WARNING: Creating subclass for "[...]". This means that your application
> will be less efficient and will consume more memory than it would if you
> ran the OpenJPA enhancer. Additionally, lazy loading will not be available
> for one-to-one and many-to-one persistent attributes in types using field
> access; they will be loaded eagerly instead.
>
> but it works.
>
> now, the same thing but using the javaagent in eclipse run configurations
>
> -javaagent:/path/to/openejb-javaagent.jar
>
> then I get
>
> INFO: Creating subclass and redefining methods for "[...]". This means
> that your application will be less efficient than it would if you ran the
> OpenJPA enhancer.
>
> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> non-application exception; nested exception is:
>     <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
>
> which is pretty the same error I get if I use Oracle JVM and no javaagent
>
> TIA
>
> Leo
>
>
> []
>
> Leo
>
>
> On Wed, Sep 18, 2013 at 11:35 AM, Rick Curtis <cu...@gmail.com> wrote:
>
>> The waters are getting pretty muddy here.... but I'll try my best to clear
>> things up.
>>
>> I'm not certain, but I suspect that when running on the IBM JVM, the
>> openjpa.DynamicEnhancementAgent was kicking in an your Entities were
>> getting enhanced automagically. For whatever reason it sounds like that
>> wasn't working on the Windows Oracle JVM and it was falling back to
>> subclassing. I know you mentioned that you don't have
>> openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
>> trace that you posted indicates otherwise.
>>
>> The root issue here is that your entities weren't being enhanced. It
>> sounds
>> like now that you have the latest version of the tomEE agent hooked up,
>> everything is working? If you prefer to not go the agent path, you could
>> always use build time enhancement and not have to mess with any of this
>> business.
>>
>> HTH,
>> Rick
>>
>>
>>
>>
>> On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
>> <rm...@gmail.com>wrote:
>>
>> > the javaagent was broken (fixed on trunk) so i fear you need to
>> > enhance classes in your build
>> > Romain Manni-Bucau
>> > Twitter: @rmannibucau
>> > Blog: http://rmannibucau.wordpress.com/
>> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> > Github: https://github.com/rmannibucau
>> >
>> >
>> >
>> > 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
>> > > Hi Romain
>> > >
>> > > thanks
>> > >
>> > > I am running some code using tomEE embedded in a main() method, using
>> > > eclipse.
>> > >
>> > > So I've added to the run configurations->java application->my
>> class->VM
>> > > arguments
>> > >
>> > > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
>> > >
>> > > As suggested in (I guess)
>> > >
>> > >
>> >
>> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
>> > >
>> > > But I still get an error such as
>> > >
>> > > INFO: Creating subclass and redefining methods for "[class xyz]". This
>> > > means that your application will be less efficient than it would if
>> you
>> > ran
>> > > the OpenJPA enhancer.
>> > > Exception in thread "main" javax.ejb.EJBException: The bean
>> encountered a
>> > > non-application exception; nested exception is:
>> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > > org.apache.openjpa.persistence.PersistenceException: null
>> > >
>> > > Am I missing something here?
>> > >
>> > > Your posts below talks about some system properties, is it enough to
>> just
>> > > drop them into properties.xml for tomee 1.5.2?
>> > >
>> > >
>> >
>> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
>> > >
>> > > TIA
>> > >
>> > > Leo
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > []
>> > >
>> > > Leo
>> > >
>> > >
>> > > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
>> > > <rm...@gmail.com>wrote:
>> > >
>> > >> Hi
>> > >>
>> > >> Note: In tomee on trunk if you list your classes in persistence-unit
>> it
>> > is
>> > >> automatically done if the persistence.xml is in
>> meta-inf/persistence.xml
>> > >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a
>> > écrit
>> > >> :
>> > >>
>> > >> > So just answering myself (openJPA list brought the solution)
>> > >> >
>> > >> > It seems that if I use IBM JVM (J9) in both windows and linux, it
>> > works.
>> > >> >
>> > >> > If I use oracle's, then I get the error.
>> > >> >
>> > >> > My persistence.xml does not have
>> > >> >
>> > >> >  <property name="openjpa.RuntimeUnenhancedClasses"
>> > value="unsupported"/>
>> > >> >
>> > >> > And I get the warning
>> > >> >
>> > >> > WARNING: Creating subclass for "[...]".
>> > >> > This means that your application will be
>> > >> > less efficient and will consume more memory
>> > >> > than it would if you ran the OpenJPA enhancer.
>> > >> >
>> > >> > Additionally, lazy loading will not be
>> > >> > available for one-to-one and many-to-one
>> > >> > persistent attributes in types using field
>> > >> > access; they will be loaded eagerly instead.
>> > >> >
>> > >> > And this procedure is not recommended as stated at
>> > >> > http://openjpa.apache.org/entity-enhancement.html
>> > >> >
>> > >> > "The use of OpenJPA's subclassing support is not recommended, and
>> is
>> > >> > disabled by default in OpenJPA 2.0 and beyond."
>> > >> >
>> > >> > TIA
>> > >> >
>> > >> >
>> > >> > Leo
>> > >> >
>> > >> >
>> > >> >
>> > >> > []
>> > >> >
>> > >> > Leo
>> > >> >
>> > >> >
>> > >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
>> > shikida@gmail.com>
>> > >> > wrote:
>> > >> > >
>> > >> > > Hi
>> > >> > >
>> > >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I
>> > try to
>> > >> > run from windows, it gives me the following error message (see
>> > >> stacktrace)
>> > >> > >
>> > >> > > My doubts are
>> > >> > >
>> > >> > > - what does it mean :-)
>> > >> > > - why only in windows
>> > >> > > - is there any way to deal with this?
>> > >> > >
>> > >> > > My feeling it that it's somehow related to the OpenJPA
>> enhancement
>> > >> > process, but I really don't have a clue here.
>> > >> > >
>> > >> > > TIA
>> > >> > >
>> > >> > > Leo
>> > >> > >
>> > >> > > Exception in thread "main" javax.ejb.EJBException: The bean
>> > >> encountered a
>> > >> > non-application exception; nested exception is:
>> > >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>> > >> > >     at (...)    at
>> > >> > > (...)
>> > >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > >> > org.apache.openjpa.persistence.PersistenceException: null
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>> > >> > >  (...)
>> > >> > > Caused by: java.lang.VerifyError
>> > >> > >     at
>> sun.instrument.InstrumentationImpl.retransformClasses0(Native
>> > >> > Method)
>> > >> > >     at
>> > >> >
>> > >> >
>> > >>
>> >
>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>> > >> > >     ... 52 more
>> > >> > >
>> > >> > > []
>> > >> > >
>> > >> > > Leo
>> > >> >
>> > >>
>> >
>>
>>
>>
>> --
>> *Rick Curtis*
>>
>
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi Rick

here what happens

when I run from eclipse, using IBM JDK 7 on linux, I defaults to subclass

WARNING: Creating subclass for "[...]". This means that your application
will be less efficient and will consume more memory than it would if you
ran the OpenJPA enhancer. Additionally, lazy loading will not be available
for one-to-one and many-to-one persistent attributes in types using field
access; they will be loaded eagerly instead.

but it works.

now, the same thing but using the javaagent in eclipse run configurations

-javaagent:/path/to/openejb-javaagent.jar

then I get

INFO: Creating subclass and redefining methods for "[...]". This means that
your application will be less efficient than it would if you ran the
OpenJPA enhancer.
Exception in thread "main" javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
    <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null

which is pretty the same error I get if I use Oracle JVM and no javaagent

TIA

Leo


[]

Leo


On Wed, Sep 18, 2013 at 11:35 AM, Rick Curtis <cu...@gmail.com> wrote:

> The waters are getting pretty muddy here.... but I'll try my best to clear
> things up.
>
> I'm not certain, but I suspect that when running on the IBM JVM, the
> openjpa.DynamicEnhancementAgent was kicking in an your Entities were
> getting enhanced automagically. For whatever reason it sounds like that
> wasn't working on the Windows Oracle JVM and it was falling back to
> subclassing. I know you mentioned that you don't have
> openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
> trace that you posted indicates otherwise.
>
> The root issue here is that your entities weren't being enhanced. It sounds
> like now that you have the latest version of the tomEE agent hooked up,
> everything is working? If you prefer to not go the agent path, you could
> always use build time enhancement and not have to mess with any of this
> business.
>
> HTH,
> Rick
>
>
>
>
> On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
> > the javaagent was broken (fixed on trunk) so i fear you need to
> > enhance classes in your build
> > Romain Manni-Bucau
> > Twitter: @rmannibucau
> > Blog: http://rmannibucau.wordpress.com/
> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > Github: https://github.com/rmannibucau
> >
> >
> >
> > 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> > > Hi Romain
> > >
> > > thanks
> > >
> > > I am running some code using tomEE embedded in a main() method, using
> > > eclipse.
> > >
> > > So I've added to the run configurations->java application->my class->VM
> > > arguments
> > >
> > > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
> > >
> > > As suggested in (I guess)
> > >
> > >
> >
> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
> > >
> > > But I still get an error such as
> > >
> > > INFO: Creating subclass and redefining methods for "[class xyz]". This
> > > means that your application will be less efficient than it would if you
> > ran
> > > the OpenJPA enhancer.
> > > Exception in thread "main" javax.ejb.EJBException: The bean
> encountered a
> > > non-application exception; nested exception is:
> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > > org.apache.openjpa.persistence.PersistenceException: null
> > >
> > > Am I missing something here?
> > >
> > > Your posts below talks about some system properties, is it enough to
> just
> > > drop them into properties.xml for tomee 1.5.2?
> > >
> > >
> >
> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
> > >
> > > TIA
> > >
> > > Leo
> > >
> > >
> > >
> > >
> > >
> > > []
> > >
> > > Leo
> > >
> > >
> > > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
> > > <rm...@gmail.com>wrote:
> > >
> > >> Hi
> > >>
> > >> Note: In tomee on trunk if you list your classes in persistence-unit
> it
> > is
> > >> automatically done if the persistence.xml is in
> meta-inf/persistence.xml
> > >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a
> > écrit
> > >> :
> > >>
> > >> > So just answering myself (openJPA list brought the solution)
> > >> >
> > >> > It seems that if I use IBM JVM (J9) in both windows and linux, it
> > works.
> > >> >
> > >> > If I use oracle's, then I get the error.
> > >> >
> > >> > My persistence.xml does not have
> > >> >
> > >> >  <property name="openjpa.RuntimeUnenhancedClasses"
> > value="unsupported"/>
> > >> >
> > >> > And I get the warning
> > >> >
> > >> > WARNING: Creating subclass for "[...]".
> > >> > This means that your application will be
> > >> > less efficient and will consume more memory
> > >> > than it would if you ran the OpenJPA enhancer.
> > >> >
> > >> > Additionally, lazy loading will not be
> > >> > available for one-to-one and many-to-one
> > >> > persistent attributes in types using field
> > >> > access; they will be loaded eagerly instead.
> > >> >
> > >> > And this procedure is not recommended as stated at
> > >> > http://openjpa.apache.org/entity-enhancement.html
> > >> >
> > >> > "The use of OpenJPA's subclassing support is not recommended, and is
> > >> > disabled by default in OpenJPA 2.0 and beyond."
> > >> >
> > >> > TIA
> > >> >
> > >> >
> > >> > Leo
> > >> >
> > >> >
> > >> >
> > >> > []
> > >> >
> > >> > Leo
> > >> >
> > >> >
> > >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
> > shikida@gmail.com>
> > >> > wrote:
> > >> > >
> > >> > > Hi
> > >> > >
> > >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I
> > try to
> > >> > run from windows, it gives me the following error message (see
> > >> stacktrace)
> > >> > >
> > >> > > My doubts are
> > >> > >
> > >> > > - what does it mean :-)
> > >> > > - why only in windows
> > >> > > - is there any way to deal with this?
> > >> > >
> > >> > > My feeling it that it's somehow related to the OpenJPA enhancement
> > >> > process, but I really don't have a clue here.
> > >> > >
> > >> > > TIA
> > >> > >
> > >> > > Leo
> > >> > >
> > >> > > Exception in thread "main" javax.ejb.EJBException: The bean
> > >> encountered a
> > >> > non-application exception; nested exception is:
> > >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > >> > org.apache.openjpa.persistence.PersistenceException: null
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> > >> > >     at (...)    at
> > >> > > (...)
> > >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > >> > org.apache.openjpa.persistence.PersistenceException: null
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> > >> > >  (...)
> > >> > > Caused by: java.lang.VerifyError
> > >> > >     at
> sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > >> > Method)
> > >> > >     at
> > >> >
> > >> >
> > >>
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> > >> > >     ... 52 more
> > >> > >
> > >> > > []
> > >> > >
> > >> > > Leo
> > >> >
> > >>
> >
>
>
>
> --
> *Rick Curtis*
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Rick Curtis <cu...@gmail.com>.
The waters are getting pretty muddy here.... but I'll try my best to clear
things up.

I'm not certain, but I suspect that when running on the IBM JVM, the
openjpa.DynamicEnhancementAgent was kicking in an your Entities were
getting enhanced automagically. For whatever reason it sounds like that
wasn't working on the Windows Oracle JVM and it was falling back to
subclassing. I know you mentioned that you don't have
openjpa.RuntimeUnenhancedClass set to supported, but the initial stack
trace that you posted indicates otherwise.

The root issue here is that your entities weren't being enhanced. It sounds
like now that you have the latest version of the tomEE agent hooked up,
everything is working? If you prefer to not go the agent path, you could
always use build time enhancement and not have to mess with any of this
business.

HTH,
Rick




On Wed, Sep 18, 2013 at 9:16 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> the javaagent was broken (fixed on trunk) so i fear you need to
> enhance classes in your build
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> > Hi Romain
> >
> > thanks
> >
> > I am running some code using tomEE embedded in a main() method, using
> > eclipse.
> >
> > So I've added to the run configurations->java application->my class->VM
> > arguments
> >
> > -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
> >
> > As suggested in (I guess)
> >
> >
> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
> >
> > But I still get an error such as
> >
> > INFO: Creating subclass and redefining methods for "[class xyz]". This
> > means that your application will be less efficient than it would if you
> ran
> > the OpenJPA enhancer.
> > Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> > non-application exception; nested exception is:
> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> >
> > Am I missing something here?
> >
> > Your posts below talks about some system properties, is it enough to just
> > drop them into properties.xml for tomee 1.5.2?
> >
> >
> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
> >
> > TIA
> >
> > Leo
> >
> >
> >
> >
> >
> > []
> >
> > Leo
> >
> >
> > On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
> > <rm...@gmail.com>wrote:
> >
> >> Hi
> >>
> >> Note: In tomee on trunk if you list your classes in persistence-unit it
> is
> >> automatically done if the persistence.xml is in meta-inf/persistence.xml
> >> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit
> >> :
> >>
> >> > So just answering myself (openJPA list brought the solution)
> >> >
> >> > It seems that if I use IBM JVM (J9) in both windows and linux, it
> works.
> >> >
> >> > If I use oracle's, then I get the error.
> >> >
> >> > My persistence.xml does not have
> >> >
> >> >  <property name="openjpa.RuntimeUnenhancedClasses"
> value="unsupported"/>
> >> >
> >> > And I get the warning
> >> >
> >> > WARNING: Creating subclass for "[...]".
> >> > This means that your application will be
> >> > less efficient and will consume more memory
> >> > than it would if you ran the OpenJPA enhancer.
> >> >
> >> > Additionally, lazy loading will not be
> >> > available for one-to-one and many-to-one
> >> > persistent attributes in types using field
> >> > access; they will be loaded eagerly instead.
> >> >
> >> > And this procedure is not recommended as stated at
> >> > http://openjpa.apache.org/entity-enhancement.html
> >> >
> >> > "The use of OpenJPA's subclassing support is not recommended, and is
> >> > disabled by default in OpenJPA 2.0 and beyond."
> >> >
> >> > TIA
> >> >
> >> >
> >> > Leo
> >> >
> >> >
> >> >
> >> > []
> >> >
> >> > Leo
> >> >
> >> >
> >> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <
> shikida@gmail.com>
> >> > wrote:
> >> > >
> >> > > Hi
> >> > >
> >> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I
> try to
> >> > run from windows, it gives me the following error message (see
> >> stacktrace)
> >> > >
> >> > > My doubts are
> >> > >
> >> > > - what does it mean :-)
> >> > > - why only in windows
> >> > > - is there any way to deal with this?
> >> > >
> >> > > My feeling it that it's somehow related to the OpenJPA enhancement
> >> > process, but I really don't have a clue here.
> >> > >
> >> > > TIA
> >> > >
> >> > > Leo
> >> > >
> >> > > Exception in thread "main" javax.ejb.EJBException: The bean
> >> encountered a
> >> > non-application exception; nested exception is:
> >> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> >> > org.apache.openjpa.persistence.PersistenceException: null
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >> > >     at (...)    at
> >> > > (...)
> >> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> >> > org.apache.openjpa.persistence.PersistenceException: null
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> >> > >     at
> >> >
> >> >
> >>
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> >> > >  (...)
> >> > > Caused by: java.lang.VerifyError
> >> > >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> >> > Method)
> >> > >     at
> >> >
> >> >
> >>
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >> > >     ... 52 more
> >> > >
> >> > > []
> >> > >
> >> > > Leo
> >> >
> >>
>



-- 
*Rick Curtis*

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the javaagent was broken (fixed on trunk) so i fear you need to
enhance classes in your build
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/9/18 Leonardo K. Shikida <sh...@gmail.com>:
> Hi Romain
>
> thanks
>
> I am running some code using tomEE embedded in a main() method, using
> eclipse.
>
> So I've added to the run configurations->java application->my class->VM
> arguments
>
> -javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar
>
> As suggested in (I guess)
>
> http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html
>
> But I still get an error such as
>
> INFO: Creating subclass and redefining methods for "[class xyz]". This
> means that your application will be less efficient than it would if you ran
> the OpenJPA enhancer.
> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> non-application exception; nested exception is:
>     <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
>
> Am I missing something here?
>
> Your posts below talks about some system properties, is it enough to just
> drop them into properties.xml for tomee 1.5.2?
>
> http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/
>
> TIA
>
> Leo
>
>
>
>
>
> []
>
> Leo
>
>
> On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
>> Hi
>>
>> Note: In tomee on trunk if you list your classes in persistence-unit it is
>> automatically done if the persistence.xml is in meta-inf/persistence.xml
>> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a écrit
>> :
>>
>> > So just answering myself (openJPA list brought the solution)
>> >
>> > It seems that if I use IBM JVM (J9) in both windows and linux, it works.
>> >
>> > If I use oracle's, then I get the error.
>> >
>> > My persistence.xml does not have
>> >
>> >  <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
>> >
>> > And I get the warning
>> >
>> > WARNING: Creating subclass for "[...]".
>> > This means that your application will be
>> > less efficient and will consume more memory
>> > than it would if you ran the OpenJPA enhancer.
>> >
>> > Additionally, lazy loading will not be
>> > available for one-to-one and many-to-one
>> > persistent attributes in types using field
>> > access; they will be loaded eagerly instead.
>> >
>> > And this procedure is not recommended as stated at
>> > http://openjpa.apache.org/entity-enhancement.html
>> >
>> > "The use of OpenJPA's subclassing support is not recommended, and is
>> > disabled by default in OpenJPA 2.0 and beyond."
>> >
>> > TIA
>> >
>> >
>> > Leo
>> >
>> >
>> >
>> > []
>> >
>> > Leo
>> >
>> >
>> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <sh...@gmail.com>
>> > wrote:
>> > >
>> > > Hi
>> > >
>> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
>> > run from windows, it gives me the following error message (see
>> stacktrace)
>> > >
>> > > My doubts are
>> > >
>> > > - what does it mean :-)
>> > > - why only in windows
>> > > - is there any way to deal with this?
>> > >
>> > > My feeling it that it's somehow related to the OpenJPA enhancement
>> > process, but I really don't have a clue here.
>> > >
>> > > TIA
>> > >
>> > > Leo
>> > >
>> > > Exception in thread "main" javax.ejb.EJBException: The bean
>> encountered a
>> > non-application exception; nested exception is:
>> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > org.apache.openjpa.persistence.PersistenceException: null
>> > >     at
>> >
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>> > >     at
>> >
>> >
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>> > >     at (...)    at
>> > > (...)
>> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
>> > org.apache.openjpa.persistence.PersistenceException: null
>> > >     at
>> >
>> >
>> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>> > >     at
>> >
>> >
>> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>> > >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>> > >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>> > >     at
>> >
>> >
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>> > >     at
>> >
>> >
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>> > >     at
>> >
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>> > >     at
>> >
>> >
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>> > >     at
>> >
>> >
>> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>> > >     at
>> >
>> >
>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>> > >     at
>> >
>> >
>> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>> > >  (...)
>> > > Caused by: java.lang.VerifyError
>> > >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
>> > Method)
>> > >     at
>> >
>> >
>> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>> > >     ... 52 more
>> > >
>> > > []
>> > >
>> > > Leo
>> >
>>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi Romain

thanks

I am running some code using tomEE embedded in a main() method, using
eclipse.

So I've added to the run configurations->java application->my class->VM
arguments

-javaagent:/home/myuser/tomee/lib/openejb-javaagent.jar

As suggested in (I guess)

http://webspherepersistence.blogspot.com.br/2009/02/openjpa-enhancement.html

But I still get an error such as

INFO: Creating subclass and redefining methods for "[class xyz]". This
means that your application will be less efficient than it would if you ran
the OpenJPA enhancer.
Exception in thread "main" javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
    <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null

Am I missing something here?

Your posts below talks about some system properties, is it enough to just
drop them into properties.xml for tomee 1.5.2?

http://rmannibucau.wordpress.com/2012/07/26/tomee-and-openejb-jpa-deploy-time-enhancement/

TIA

Leo





[]

Leo


On Wed, Sep 18, 2013 at 1:36 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> Hi
>
> Note: In tomee on trunk if you list your classes in persistence-unit it is
> automatically done if the persistence.xml is in meta-inf/persistence.xml
> Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a écrit
> :
>
> > So just answering myself (openJPA list brought the solution)
> >
> > It seems that if I use IBM JVM (J9) in both windows and linux, it works.
> >
> > If I use oracle's, then I get the error.
> >
> > My persistence.xml does not have
> >
> >  <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
> >
> > And I get the warning
> >
> > WARNING: Creating subclass for "[...]".
> > This means that your application will be
> > less efficient and will consume more memory
> > than it would if you ran the OpenJPA enhancer.
> >
> > Additionally, lazy loading will not be
> > available for one-to-one and many-to-one
> > persistent attributes in types using field
> > access; they will be loaded eagerly instead.
> >
> > And this procedure is not recommended as stated at
> > http://openjpa.apache.org/entity-enhancement.html
> >
> > "The use of OpenJPA's subclassing support is not recommended, and is
> > disabled by default in OpenJPA 2.0 and beyond."
> >
> > TIA
> >
> >
> > Leo
> >
> >
> >
> > []
> >
> > Leo
> >
> >
> > On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <sh...@gmail.com>
> > wrote:
> > >
> > > Hi
> > >
> > > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
> > run from windows, it gives me the following error message (see
> stacktrace)
> > >
> > > My doubts are
> > >
> > > - what does it mean :-)
> > > - why only in windows
> > > - is there any way to deal with this?
> > >
> > > My feeling it that it's somehow related to the OpenJPA enhancement
> > process, but I really don't have a clue here.
> > >
> > > TIA
> > >
> > > Leo
> > >
> > > Exception in thread "main" javax.ejb.EJBException: The bean
> encountered a
> > non-application exception; nested exception is:
> > >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> > >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> > >     at
> >
> >
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> > >     at (...)    at
> > > (...)
> > > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> > org.apache.openjpa.persistence.PersistenceException: null
> > >     at
> >
> >
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> > >     at
> >
> >
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> > >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> > >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> > >     at
> >
> >
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> > >     at
> >
> >
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> > >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> > >     at
> >
> >
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> > >     at
> >
> >
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> > >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> > >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> > >  (...)
> > > Caused by: java.lang.VerifyError
> > >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > Method)
> > >     at
> >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> > >     ... 52 more
> > >
> > > []
> > >
> > > Leo
> >
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Note: In tomee on trunk if you list your classes in persistence-unit it is
automatically done if the persistence.xml is in meta-inf/persistence.xml
Le 18 sept. 2013 04:40, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> So just answering myself (openJPA list brought the solution)
>
> It seems that if I use IBM JVM (J9) in both windows and linux, it works.
>
> If I use oracle's, then I get the error.
>
> My persistence.xml does not have
>
>  <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
>
> And I get the warning
>
> WARNING: Creating subclass for "[...]".
> This means that your application will be
> less efficient and will consume more memory
> than it would if you ran the OpenJPA enhancer.
>
> Additionally, lazy loading will not be
> available for one-to-one and many-to-one
> persistent attributes in types using field
> access; they will be loaded eagerly instead.
>
> And this procedure is not recommended as stated at
> http://openjpa.apache.org/entity-enhancement.html
>
> "The use of OpenJPA's subclassing support is not recommended, and is
> disabled by default in OpenJPA 2.0 and beyond."
>
> TIA
>
>
> Leo
>
>
>
> []
>
> Leo
>
>
> On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <sh...@gmail.com>
> wrote:
> >
> > Hi
> >
> > I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
> run from windows, it gives me the following error message (see stacktrace)
> >
> > My doubts are
> >
> > - what does it mean :-)
> > - why only in windows
> > - is there any way to deal with this?
> >
> > My feeling it that it's somehow related to the OpenJPA enhancement
> process, but I really don't have a clue here.
> >
> > TIA
> >
> > Leo
> >
> > Exception in thread "main" javax.ejb.EJBException: The bean encountered a
> non-application exception; nested exception is:
> >     <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
> >     at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >     at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >     at (...)    at
> > (...)
> > Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: null
> >     at
>
> org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
> >     at
>
> org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
> >     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
> >     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
> >     at
>
> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
> >     at
>
> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
> >     at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
> >     at
>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
> >     at
>
> org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
> >     at
>
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
> >     at
>
> org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
> >  (...)
> > Caused by: java.lang.VerifyError
> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> Method)
> >     at
>
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >     ... 52 more
> >
> > []
> >
> > Leo
>

Re: org.apache.openjpa.persistence.PersistenceException: null

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
So just answering myself (openJPA list brought the solution)

It seems that if I use IBM JVM (J9) in both windows and linux, it works.

If I use oracle's, then I get the error.

My persistence.xml does not have

 <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>

And I get the warning

WARNING: Creating subclass for "[...]".
This means that your application will be
less efficient and will consume more memory
than it would if you ran the OpenJPA enhancer.

Additionally, lazy loading will not be
available for one-to-one and many-to-one
persistent attributes in types using field
access; they will be loaded eagerly instead.

And this procedure is not recommended as stated at
http://openjpa.apache.org/entity-enhancement.html

"The use of OpenJPA's subclassing support is not recommended, and is
disabled by default in OpenJPA 2.0 and beyond."

TIA


Leo



[]

Leo


On Tue, Sep 17, 2013 at 1:14 PM, Leonardo K. Shikida <sh...@gmail.com>
wrote:
>
> Hi
>
> I have an tomee 1.5.2 + that runs perfectly on linux, but when I try to
run from windows, it gives me the following error message (see stacktrace)
>
> My doubts are
>
> - what does it mean :-)
> - why only in windows
> - is there any way to deal with this?
>
> My feeling it that it's somehow related to the OpenJPA enhancement
process, but I really don't have a clue here.
>
> TIA
>
> Leo
>
> Exception in thread "main" javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
>     <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
>     at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
>     at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
>     at (...)    at
> (...)
> Caused by: <openjpa-2.2.0-r422266:1244990 fatal general error>
org.apache.openjpa.persistence.PersistenceException: null
>     at
org.apache.openjpa.enhance.ClassRedefiner.redefineClasses(ClassRedefiner.java:96)
>     at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
>     at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:314)
>     at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:238)
>     at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:212)
>     at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
>     at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
>     at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
>     at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createEntityManager(ReloadableEntityManagerFactory.java:160)
>     at
org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager(JtaEntityManagerRegistry.java:115)
>     at
org.apache.openejb.persistence.JtaEntityManager.getEntityManager(JtaEntityManager.java:80)
>  (...)
> Caused by: java.lang.VerifyError
>     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
Method)
>     at
sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
>     ... 52 more
>
> []
>
> Leo