openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arata Yamamoto <art...@gmail.com>
Subject Re: reflect.InvocationTargetException by VerifyError at ClassRedefiner.redefineClasses method
Date Thu, 03 Oct 2013 04:22:55 GMT
Dear Rick,

Thank you for your reply.

I have the following log record regarding enhancing:
INFO: Creating subclass and redefining methods for "[class
com.newmainsoftech.jecommerce.dao.entity.OrderedProductPK, class
com.newmainsoftech.jecommerce.dao.entity.ContactBase, class
com.newmainsoftech.jecommerce.dao.entity.CustomerOrder, class
com.newmainsoftech.jecommerce.dao.entity.Product, class
com.newmainsoftech.jecommerce.dao.entity.Category, class
com.newmainsoftech.jecommerce.dao.entity.Customer, class
com.newmainsoftech.jecommerce.dao.entity.OrderedProduct, class
com.newmainsoftech.jecommerce.dao.entity.Supplier]". This means that your
application will be less efficient than it would if you ran the OpenJPA
enhancer.

I attempted to specify the Java Agent of OpenEJB or/and OpenJPA in the
following dynamic manners, and got the same log record above regarding
enhancing entity classes and got the same result
(ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:176)
log in the stacktrace):

   - With OpenEJB agent:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: cmd.exe /X /C "C:\Java\jdk1.7.0_21\jre\bin\java *
-javaagent:*D:\mvn_repo\org\apache\openejb\openejb-javaagent\4.5.2\*
openejb-javaagent-4.5.2.jar*-javaagent:D:\mvn_repo\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar
-jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefirebooter4357830757705183064.jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire845547936850090051tmp
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire3588961403524465407tmp"

   - With OpenJPA agent:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: cmd.exe /X /C "C:\Java\jdk1.7.0_21\jre\bin\java *
-javaagent:*D:\mvn_repo\org\apache\openejb\patch\openjpa-asm-shaded\2.2.0\*
openjpa-asm-shaded-2.2.0.jar*-javaagent:D:\mvn_repo\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar
-jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefirebooter7332055104354137715.jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire8510714806139240938tmp
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire7644070897687503479tmp"

   - With OpenJPA agent + OpenEJB agent

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: cmd.exe /X /C "C:\Java\jdk1.7.0_21\jre\bin\java *
-javaagent:*D:\mvn_repo\org\apache\openejb\patch\openjpa-asm-shaded\2.2.0\*
openjpa-asm-shaded-2.2.0.jar* *-javaagent*
:D:\mvn_repo\org\apache\openejb\openejb-javaagent\4.5.2\*
openejb-javaagent-4.5.2.jar*-javaagent:D:\mvn_repo\org\aspectj\aspectjweaver\1.7.3\aspectjweaver-1.7.3.jar
-jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefirebooter5316621859494960948.jar
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire5778328340144466825tmp
D:\EclipseWorkspaces\NetBeansE-commerce\e_commerce_demo\e_commerce_ejb\target\surefire\surefire2316888947938102575tmp"

Additional note: asm-3.2.jar was included in test class path.

Regards,
Art




On Mon, Sep 30, 2013 at 6:35 AM, Rick Curtis <curtisr7@gmail.com> wrote:

> It appears that you need to enhance your Entities[1].
>
> Thanks,
> Rick
>
> [1] http://openjpa.apache.org/entity-enhancement.html
>
>
> On Sat, Sep 28, 2013 at 6:34 PM, Arata Yamamoto <artymt@gmail.com> wrote:
>
> > Dear group,
> >
> > I just started to try using OpenEJB for testing my EJB beans. So, I'm
> > pretty beginner with OpenEJB (and OpenJPA).
> > I hit the next exception (what I cannot overcome) in my test using
> > OpenEJB's ApplicationComposer:
> > Exception stacktrace:
> > Caused by: java.rmi.RemoteException: 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.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:154)
> >     ... 43 more
> > 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)
> >     at
> >
> >
> org.apache.openejb.persistence.JtaEntityManager.getMetamodel(JtaEntityManager.java:475)
> >     at
> >
> >
> com.newmainsoftech.jecommerce.dao.impl.AbstractFacadeImpl.postConstruct(AbstractFacadeImpl.java:28)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >     at java.lang.reflect.Method.invoke(Method.java:601)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$LifecycleInvocation.invoke(ReflectionInvocationContext.java:213)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> >     at
> >
> >
> org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
> >     at
> >
> >
> org.apache.openejb.monitoring.StatsInterceptor.PostConstruct(StatsInterceptor.java:104)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >     at java.lang.reflect.Method.invoke(Method.java:601)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
> >     at
> >
> >
> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
> >     at org.apache.openejb.BeanContext.newInstance(BeanContext.java:1478)
> >     ... 42 more
> > Caused by: java.lang.reflect.InvocationTargetException
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> >     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >     at java.lang.reflect.Method.invoke(Method.java:601)
> >     at org.apache.openjpa.enhance.*
> > ClassRedefiner.redefineClasses(ClassRedefiner.java:85)*
> >     ... 71 more
> > Caused by: java.lang.VerifyError
> >     at sun.instrument.InstrumentationImpl.retransformClasses0(Native
> > Method)
> >     at
> >
> >
> sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144)
> >     ... 76 more
> >
> > Statement throwing exception in the test method:
> > @Test
> > public void test_create() {
> >     final String testName = JUnitAssistAspect.getTestName();
> >
> >     final Category category = new Category();
> >         category.setName( testName);
> >
> >     final CategoryFacade categoryFacade = getCategoryFacade();
> >     categoryFacade.create( category); // <-- Exception is thrown at here!
> >     ...
> > }
> >
> > I traced and dumped the calls from ClassRedefiner.redefineClasses to
> > reflect.Method.invoke:
> > 16:27:24.078 [main] INFO
> >
> >
> c.n.j.d.i.AbstractCategoryFacadeImplTest$CreateEntityManagerDebugTraceAspect
> > -
> > Invocation start : org.apache.openjpa.enhance.*
> > ClassRedefiner.redefineClasses*(
> >
> >
> >
> conf(type:JDBCConfigurationImpl)=org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl@7a44ac1a
> > ,
> >     *classes(type:HashMap)={
> >         class com.newmainsoftech.jecommerce.dao.entity.Product*=[B@9d8e7b
> > *,
> >         class com.newmainsoftech.jecommerce.dao.entity.OrderedProductPK*
> > =[B@1f54525*,
> >         class
> com.newmainsoftech.jecommerce.dao.entity.Supplier*=[B@18eb67b
> > *,
> >
> >         class
> com.newmainsoftech.jecommerce.dao.entity.Customer*=[B@6e7953
> > *,
> >
> >         class com.newmainsoftech.jecommerce.dao.entity.OrderedProduct*
> > =[B@df77f7*,
> >         class
> com.newmainsoftech.jecommerce.dao.entity.Category*=[B@13d164c
> > *,
> >
> >         class com.newmainsoftech.jecommerce.dao.entity.CustomerOrder*
> > =[B@1830452*,
> >         class com.newmainsoftech.jecommerce.dao.entity.ContactBase*
> > =[B@90daa2*
> >         }*
> >     ) @ ClassRedefiner.java:55
> >
> > 16:27:24.078 [main] INFO
> > c.n.j.d.i.AbstractCategoryFacadeImplTest$RedefineClassesDebugTraceAspect
> -
> > Invocation start : java.lang.reflect.Method.invoke(
> >
> > arg0(type:InstrumentationImpl)=sun.instrument.InstrumentationImpl@17b930d
> ,
> >
> > arg1(type:Object[])=[org.apache.openjpa.enhance.ClassRedefiner$1@1f378ca
> ,
> > true]
> >     ) @ ClassRedefiner.java:82
> > 16:27:24.078 [main] INFO
> > c.n.j.d.i.AbstractCategoryFacadeImplTest$RedefineClassesDebugTraceAspect
> -
> > Invocation end : java.lang.reflect.Method.invoke(
> >
> > arg0(type:InstrumentationImpl)=sun.instrument.InstrumentationImpl@17b930d
> ,
> >
> > arg1(type:Object[])=[org.apache.openjpa.enhance.ClassRedefiner$1@1f378ca
> ,
> > true]
> >     ) @ ClassRedefiner.java:82
> > Returned null
> >
> > 16:27:24.078 [main] INFO
> > c.n.j.d.i.AbstractCategoryFacadeImplTest$RedefineClassesDebugTraceAspect
> -
> > Invocation start : java.lang.reflect.*Method.invoke*(
> >     *arg0*(type:InstrumentationImpl)=*sun.instrument.InstrumentationImpl*
> > @17b930d,
> >     *arg1*(type:Object[])=*[[Ljava.lang.Class;@17f2629]*
> >     ) *@ ClassRedefiner.java:85*
> >
> > It's puzzling me why
> sun.instrument.InstrumentationImpl.retransformClasses
> > method throws the VerifyError exception, since, from the above dump, it
> > appeared to me that the array local field in the
> > ClassRedefiner.redefineClasses method holds the array of the proper
> entity
> > bean classes.
> >
> > Environment:
> > OpenEJB ver 4.5.2
> > OpenJPA ver 2.2.0 (as resolved openjpa-asm-shaded dependency from
> > openejb-core artifact dependency)
> > EJB 3
> > JDK 1.7.0
> > Windows box
> >
> > Can someone shed the guiding light?
> > I appreciate any advises since I am pretty beginner of OpenEJB (and
> > OpenJPA).
> >
> > Regards,
> > Art
> >
>
>
>
> --
> *Rick Curtis*
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message