openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] Created: (OPENJPA-97) Runtime Enhancement without <class> entries in persistence.xml fails while attempting to process non-Entity classes
Date Tue, 09 Jan 2007 17:14:27 GMT
Runtime Enhancement without <class> entries in persistence.xml fails while attempting
to process non-Entity classes

                 Key: OPENJPA-97
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
            Reporter: Kevin Sutter
            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 java.lang.reflect.Method.getDeclaredAnnotations(
	at java.lang.reflect.AccessibleObject.getAnnotations(
	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 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):


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.


This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message