[
https://issues.apache.org/jira/browse/OPENJPA-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914015#action_12914015
]
Donald Woods commented on OPENJPA-1811:
---------------------------------------
This is due to the persistence.xml not listing all of the classes. The
Javaagent loaded enhancer and Dynamically loaded enhancer behave the same, in
that when a <class> list is provided, then only those classes will get
pre-enhanced.
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_enhance_runtime
Section 2.3 - "If you declare a persistent class list, OpenJPA will only
search for metadata for classes in that list. "
I'll add the same note to Section 2.4 using OPENJPA-1804.
Once I added the other 2 classes to the persistence.xml so they were all listed
-
<class>openjpatest.AddressBook</class>
<class>openjpatest.Group</class>
<class>openjpatest.Organization</class>
<class>openjpatest.EmailAddress</class>
<class>openjpatest.HostName</class>
then your expected behavior appears -
. . .
79 db TRACE [main] openjpa.Runtime -
org.apache.openjpa.enhance.InstrumentationFactory.getInstrumentation()
_inst:null _dynamicallyInstall:true
82 db TRACE [main] openjpa.Runtime -
org.apache.openjpa.enhance.InstrumentationFactory.findToolsJar() -- couldn't
find default
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/tools.jar
83 db TRACE [main] openjpa.Runtime -
org.apache.openjpa.enhance.InstrumentationFactory.findToolsJar() -- found
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar
. . .
210 db TRACE [main] openjpa.MetaData - Found 5 classes with metadata in 7
milliseconds.
216 db TRACE [main] openjpa.MetaData - Clearing metadata repository
"org.apache.openjpa.meta.metadatareposit...@761eec35".
707 db INFO [main] openjpa.Runtime - OpenJPA dynamically loaded the class
enhancer. Any classes that were not enhanced at build time will be enhanced
when they are loaded by the JVM.
. . .
1588 db WARN [main] openjpa.Enhance - An exception was thrown while
attempting to perform class file transformation on "openjpatest/Group":
<openjpa-2.1.0-SNAPSHOT-r422266:999559M fatal user error>
org.apache.openjpa.util.MetaDataException: Errors encountered while resolving
metadata. See nested exceptions for details.
. . .
Caused by: <openjpa-2.1.0-SNAPSHOT-r422266:999559M nonfatal user error>
org.apache.openjpa.util.MetaDataException: No metadata was found for type
"class java.lang.Object". The class is not enhanced.
. . .
> Dynamic load of enhancer agent on Mac OS X fails
> ------------------------------------------------
>
> Key: OPENJPA-1811
> URL: https://issues.apache.org/jira/browse/OPENJPA-1811
> Project: OpenJPA
> Issue Type: Bug
> Components: Enhance, UnenhancedClasses
> Affects Versions: 2.0.0
> Environment: Mac
> Reporter: Willis Blackburn
> Assignee: Donald Woods
> Fix For: 2.1.0
>
>
> Splitting out this item from OPENJPA-1804.
> The dynamic loading of the enhancer agent on Mac OS X w/ Java 1.6.0 fails due
> to the packaging differences on the Mac, where instead of a tools.jar, there
> is a 1.6.0/Classes/classes.jar that we should be using instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.