openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] Closed: (OPENJPA-97) Runtime Enhancement without <class> entries in persistence.xml fails while attempting to process non-Entity classes
Date Thu, 18 Sep 2008 19:08:44 GMT


Michael Dick closed OPENJPA-97.

    Resolution: Cannot Reproduce
      Assignee: Michael Dick

I tried a simple jUnit testcase (Eclipse + Sun JDK5 + OpenJPA 1.0.2) and did not see the error
message. Please reopen the issue if it can be reproduced. 

> Runtime Enhancement without <class> entries in persistence.xml fails while attempting
to process non-Entity classes
> -------------------------------------------------------------------------------------------------------------------
>                 Key: OPENJPA-97
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>            Reporter: Kevin Sutter
>            Assignee: Michael Dick
>            Priority: Minor
> When using dynamic Runtime Enhancement (-javaagent) and not having the explicit set of
classes defined in persistence.xml, the processing gets sick once in a while.  It starts off
fine with the appropriate warning...
> 160  my persistence unit  INFO   [main] openjpa.Enhance - You have enabled runtime enhancement,
but have not specified the set of persistent classes.  OpenJPA must look for metadata for
every loaded class, which might increase class load times significantly.
> It then starts parsing (and processing) every package and class that gets loaded...
> 210  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner".
> 210  my persistence unit  INFO   [main] openjpa.MetaData - Parsing package "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner".
> 230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class "org.eclipse.jdt.internal.junit.runner.MessageSender".
> 230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class "org.eclipse.jdt.internal.junit.runner.IVisitsTestTrees".
> 230  my persistence unit  INFO   [main] openjpa.MetaData - Parsing class "org.eclipse.jdt.internal.junit.runner.IListensToTestExecutions".
> :
> :
> But, it also hits "warnings" similar to the following:
> 530  my persistence unit  WARN   [main] openjpa.Enhance - An exception was thrown while
attempting to perform class file transformation on "$Proxy3":
> <0|false|0.0.0> org.apache.openjpa.util.GeneralException: $Proxy3
> 	at org.apache.openjpa.enhance.PCClassFileTransformer.needsEnhance(
> 	at org.apache.openjpa.enhance.PCClassFileTransformer.transform(
> 	at sun.instrument.TransformerManager.transform(
> 	at sun.instrument.InstrumentationImpl.transform(
> 	at java.lang.reflect.Proxy.defineClass0(Native Method)
> 	at java.lang.reflect.Proxy.getProxyClass(
> 	at java.lang.reflect.Proxy.newProxyInstance(
> 	at
> 	at
> 	at
> 	at java.lang.reflect.Method.getDeclaredAnnotations(
> 	at java.lang.reflect.AccessibleObject.getAnnotations(
> 	at
> 	at java.lang.reflect.Method.getAnnotation(
> 	at org.junit.internal.runners.TestIntrospector.getTestMethods(
> 	at org.junit.internal.runners.TestClassMethodsRunner.<init>(
> 	at org.junit.internal.runners.TestClassRunner.<init>(
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> 	at java.lang.reflect.Constructor.newInstance(
> 	at org.junit.internal.requests.ClassRequest.getRunner(
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> 	at
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> Caused by: java.lang.ClassNotFoundException: $Proxy3
> 	at java.lang.Class.forName(
> 	at org.apache.openjpa.enhance.PCClassFileTransformer.needsEnhance(
> 	... 29 more
> There are similar ClassNotFoundExceptions for the following classes that were loaded
(in my test scenario):
> sun.reflect.GeneratedMethodAccessor1
> sun.reflect.GeneratedConstructorAccessor1
> sun.reflect.GeneratedConstructorAccessor2
> sun.reflect.GeneratedConstructorAccessor3
> sun.reflect.GeneratedConstructorAccessor4
> $Proxy7
> $Proxy8
> $Proxy9
> Since these are obviously not Entities, maybe we should just eat these exceptions.  That
is, assume that any errors that happen during the parsing phase just indicate that they are
not Entities and continue on.  Currently, the "warning" message and call stack look a bit
more drastic than what they really are.
> BTW, the rest of the runtime enhancement worked just fine.  It parsed several hundred
class files as they were being loaded.  It found the one class file that I was interested
in and successfully enhanced it.  So, the processing worked okay.  It's just kind of messy.
> Kevin

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message