You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Kevin Sutter (JIRA)" <ji...@apache.org> on 2010/04/08 19:01:36 UTC
[jira] Assigned: (OPENJPA-1618) Exception during factory creation
due to javax.persistence.transactionType
[ https://issues.apache.org/jira/browse/OPENJPA-1618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Sutter reassigned OPENJPA-1618:
-------------------------------------
Assignee: Kevin Sutter
> Exception during factory creation due to javax.persistence.transactionType
> --------------------------------------------------------------------------
>
> Key: OPENJPA-1618
> URL: https://issues.apache.org/jira/browse/OPENJPA-1618
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 2.0.0-beta3
> Environment: Windows XP SP3, Java 1.6.0_19
> Reporter: Florian Bruckner
> Assignee: Kevin Sutter
>
> With the folliowing code:
> emProperties.put("javax.persistence.transactionType", "RESOURCE_LOCAL");
> EntityManagerFactory factory = Persistence.createEntityManagerFactory("myPu", emProperties);
> This exception is thrown:
> Provider named org.apache.openjpa.persistence.PersistenceProviderImpl threw unexpected exception at create EntityManagerFactory:
> java.lang.IllegalArgumentException
> java.lang.IllegalArgumentException: No enum const class javax.persistence.spi.PersistenceUnitTransactionType.JAVAX.PERSISTENCE.TRANSACTIONTYPE
> at java.lang.Enum.valueOf(Enum.java:196)
> at org.apache.openjpa.persistence.JPAProperties.getEnumValue(JPAProperties.java:207)
> at org.apache.openjpa.persistence.JPAProperties.getEnumValue(JPAProperties.java:190)
> at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.fromUserProperties(PersistenceUnitInfoImpl.java:310)
> at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.endElement(PersistenceProductDerivation.java:804)
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.endElement(XMLMetaDataParser.java:456)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:795)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:393)
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:334)
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:311)
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:284)
> at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.parse(PersistenceProductDerivation.java:741)
> at org.apache.openjpa.persistence.PersistenceProductDerivation.parseResources(PersistenceProductDerivation.java:550)
> at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:520)
> at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:334)
> at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:89)
> at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:154)
> at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:65)
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
> at com.dreikraft.persistence.SyncSchema.testSetOwner(SyncSchema.java:32)
> due to the following code in PersistenceUnitInfoImpl:
> else if (JPAProperties.TRANSACTION_TYPE.equals(key)) {
> setTransactionType(JPAProperties.getEnumValue(PersistenceUnitTransactionType.class, key));
> which quite clearly should use the value to lookup the enum value, and not the key.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.