openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1377) JPA property to enum conversion failure
Date Fri, 06 Nov 2009 22:48:32 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774467#action_12774467
] 

Albert Lee commented on OPENJPA-1377:
-------------------------------------

Per spec:

3.6.1.1 Enabling Automatic Validation
The validation-mode element of the persistence.xml file determines whether the automatic
lifecycle event validation is in effect. The values of the validation-mode element are AUTO,
CALLBACK, NONE. The default validation mode is AUTO.

If the application creates the entity manager factory using the Persistence.createEntityManagerFactory
method, the validation mode can be specified using the javax.persistence.
validation.mode map key, which will override the value specified (or defaulted) in the
persistence.xml file. The map values for this key are "auto", "callback", "none"

Enum values are in upper case and corresponding properties are in lowercase. Need to convert
to upper case before converting to its enum value.

> JPA property to enum conversion failure
> ---------------------------------------
>
>                 Key: OPENJPA-1377
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1377
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0-M3, 2.0.0
>            Reporter: Albert Lee
>            Assignee: Albert Lee
>             Fix For: 2.0.0
>
>
> Exception occurred during JPA property to equivalent enum conversion:
> java.lang.IllegalArgumentException: No enum const class javax.persistence.ValidationMode.callback
>         at java.lang.Enum.valueOf(Enum.java:196)
>         at org.apache.openjpa.persistence.JPAProperties.getEnumValue(JPAProperties.java:156)
>         at org.apache.openjpa.persistence.JPAProperties.getEnumValue(JPAProperties.java:147)
>         at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.fromUserProperties(PersistenceUnitInfoImpl.java:325)
>         at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.endElement(PersistenceProductDerivation.java:734)
>         at org.apache.openjpa.lib.meta.XMLMetaDataParser.endElement(XMLMetaDataParser.java:456)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.xs.XMLSchemaValidator.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>         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:671)
>         at org.apache.openjpa.persistence.PersistenceProductDerivation.parseResources(PersistenceProductDerivation.java:479)
>         at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:449)
>         at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:271)
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:83)
>         at com.ibm.websphere.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:73)
>         at com.ibm.websphere.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:43)
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:151)
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:59)
>         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:159)
>         at suite.r80.base.jpaspec.validation.basic.JSE_BasicTest.setupTestEnvironmentModeBasicEMFPropOvrCallback(JSE_BasicTest.java:486)

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


Mime
View raw message