OpenJPA
  1. OpenJPA
  2. OPENJPA-1377

JPA property to enum conversion failure

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: 2.0.0-beta
    • Component/s: kernel
    • Labels:
      None

      Description

      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)

        Activity

        Hide
        Albert Lee added a comment -

        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.

        Show
        Albert Lee added a comment - 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.

          People

          • Assignee:
            Albert Lee
            Reporter:
            Albert Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development