[
https://issues.apache.org/jira/browse/OPENJPA-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Zowalla resolved OPENJPA-72.
------------------------------------
Resolution: Fixed
Already fixed on master: The transformer is still always added, but
PersistenceProviderImpl.java:184-191 now catches the addTransformer failure
(b7fe66357, on master, not reverted), so the Spring IllegalStateException that
caused the report no longer breaks EMF creation. Closing; please reopen if this
still happens with OpenJPA 4.x.
> PersistenceProviderImpl.createContainerEntityManagerFactory() should not add
> a ClassTransformerImpl to PersistenceUnitInfo if <exclude-unlisted-classes>
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OPENJPA-72
> URL: https://issues.apache.org/jira/browse/OPENJPA-72
> Project: OpenJPA
> Issue Type: Bug
> Environment: JDK1.5, Win32, openjpa-0.9.0-incubating
> Reporter: Corey Klaasmeyer
> Priority: Major
>
> Adding a transformer is unnecessary if classes are enhanced at build time. As
> far as I can tell, you specify this by adding the <exclude-unlisted-classes>
> property to persistence.xml. This could probably be made more clear by
> calling the property something like "build-time-enhancement-only" or
> "disable-runtime-enhancement". Additionally, this causes a Spring configured
> JPA to fail with and IllegalStateException if no LoadTimeWeaver is specified
> in the LocalContainerEntityManagerFactory. The relevent code is on line 93 of
> PersistenceProviderImpl
> public EntityManagerFactory createContainerEntityManagerFactory(
> PersistenceUnitInfo pui, Map m) {
> PersistenceProductDerivation pd = new PersistenceProductDerivation();
> try {
> ConfigurationProvider cp = pd.load(pui, m);
> if (cp == null)
> return null;
> // add enhancer
> String ctOpts = (String) Configurations.getProperty
> (CLASS_TRANSFORMER_OPTIONS, pui.getProperties());
> pui.addTransformer(new ClassTransformerImpl(cp, ctOpts,
> pui.getNewTempClassLoader()));
> BrokerFactory factory = Bootstrap.newBrokerFactory(cp,
> pui.getClassLoader());
> return OpenJPAPersistence.toEntityManagerFactory(factory);
> } catch (Exception e) {
> throw PersistenceExceptions.toPersistenceException(e);
> }
> }
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)