You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2011/03/16 00:19:29 UTC

[jira] Created: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

openjpa.InitializeEagerly breaks bean-validation integration
------------------------------------------------------------

                 Key: OPENJPA-1960
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel, validation
    Affects Versions: 2.1.0
            Reporter: Gerhard Petracek


<property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration

AbstractBrokerFactory#makeReadOnly
evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
+ at the end of AbstractBrokerFactory#initializeBroker it gets called again

that causes:
the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis updated OPENJPA-1960:
---------------------------------

    Attachment: OPENJPA-1960-test_fix.jar

Attaching a test fix. The jar has a patch file of the changes, and the compiled .class change.

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008489#comment-13008489 ] 

Rick Curtis commented on OPENJPA-1960:
--------------------------------------

Gerhard -

Please give the attached patch a try. 

I really don't like the change, but I want to make sure I am looking at fixing the same path that you are reporting. Once I get the thumbs up from you I'll see about fixing this another way.

Thanks,
Rick

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis updated OPENJPA-1960:
---------------------------------

    Affects Version/s: 2.2.0
        Fix Version/s: 2.2.0

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0, 2.2.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>             Fix For: 2.2.0
>
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Gerhard Petracek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008633#comment-13008633 ] 

Gerhard Petracek commented on OPENJPA-1960:
-------------------------------------------

your bypass of #assertChangeable works

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007301#comment-13007301 ] 

Rick Curtis commented on OPENJPA-1960:
--------------------------------------

What is the exception / warning that you are getting?

Thanks,
Rick

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Albert Lee (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Lee closed OPENJPA-1960.
-------------------------------


Close issue in preparation for 2.2.0 release.
                
> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0, 2.2.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>             Fix For: 2.2.0
>
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis resolved OPENJPA-1960.
----------------------------------

    Resolution: Fixed

Committed revision 1084349 to trunk.

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0, 2.2.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>             Fix For: 2.2.0
>
>         Attachments: OPENJPA-1960-test_fix.jar
>
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Assigned: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Curtis reassigned OPENJPA-1960:
------------------------------------

    Assignee: Rick Curtis

> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>            Assignee: Rick Curtis
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (OPENJPA-1960) openjpa.InitializeEagerly breaks bean-validation integration

Posted by "Gerhard Petracek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007317#comment-13007317 ] 

Gerhard Petracek commented on OPENJPA-1960:
-------------------------------------------

with the default validation mode (== auto):
WARN   [btpool0-1] openjpa.Runtime - Could not create the optional validation provider. Reason returned: "Can not modify "LifecycleEventManager" because the property is not dynamic and the current configuration is read-only."

in case of <validation-mode>CALLBACK</validation-mode> it is:
Caused by: java.lang.RuntimeException: Can not modify "LifecycleEventManager" because the property is not dynamic and the current configuration is read-only.
	at org.apache.openjpa.lib.conf.Value.assertChangeable(Value.java:480)
	at org.apache.openjpa.lib.conf.PluginValue.setString(PluginValue.java:135)
	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.setLifecycleEventManager(OpenJPAConfigurationImpl.java:1742)
	at org.apache.openjpa.persistence.validation.ValidationUtils.setupValidation(ValidationUtils.java:103)
	at org.apache.openjpa.persistence.PersistenceProviderImpl.loadValidator(PersistenceProviderImpl.java:325)
	at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:104)


> openjpa.InitializeEagerly breaks bean-validation integration
> ------------------------------------------------------------
>
>                 Key: OPENJPA-1960
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1960
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel, validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>
> <property name="openjpa.InitializeEagerly" value="true"/> breaks the bean-validation integration
> AbstractBrokerFactory#makeReadOnly
> evaluates conf.isInitializeEagerly() which returns true (due to the config) and calls _conf.setReadOnly(Configuration.INIT_STATE_FROZEN)
> + at the end of AbstractBrokerFactory#initializeBroker it gets called again
> that causes:
> the created BrokerFactory gets used as argument for PersistenceProviderImpl#loadValidator which fails (with a warning or an exception depending on the validation-mode configured in the persistence.xml) because the config is in state INIT_STATE_FROZEN

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira