You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Stephan Hagedorn (JIRA)" <ji...@apache.org> on 2012/09/03 12:30:07 UTC

[jira] [Created] (OPENJPA-2257) Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException

Stephan Hagedorn created OPENJPA-2257:
-----------------------------------------

             Summary: Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException
                 Key: OPENJPA-2257
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2257
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.1.2
         Environment: AIX 6.1 (64-bit)
WebSphere Application Server V8.0 (32-bit) 
            Reporter: Stephan Hagedorn


A call of EntityManager.getProperties() can lead to NullPointer and ConcurrentModificationException. Issue occurs right after start up of the overlying JEE application if multiple EntityManager instance are created at same time.

Please find the issued stack trace below:

Caused by: java.lang.NullPointerException
        at java.lang.String.compareTo(String.java:482)
        at java.lang.String.compareTo(String.java:31)
        at java.util.TreeMap.cmp(TreeMap.java:4514)
        at java.util.TreeMap.putImpl(TreeMap.java:4556)
        at java.util.TreeMap.put(TreeMap.java:4536)
        at java.util.TreeSet.add(TreeSet.java:122)
        at
org.apache.openjpa.lib.conf.ConfigurationImpl.getPropertyKeys(ConfigurationImpl.java:708)
        at
org.apache.openjpa.kernel.BrokerImpl.getSupportedProperties(BrokerImpl.java:729)
        at
org.apache.openjpa.kernel.DelegatingBroker.getSupportedProperties(DelegatingBroker.java:223)
        at
org.apache.openjpa.persistence.EntityManagerImpl.getProperties(EntityManagerImpl.java:1624)
        ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OPENJPA-2257) Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException

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

Albert Lee resolved OPENJPA-2257.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.0

Fixed only in trunk. To get fixes for 2.1.x, you'll need to request it from WebSphere service channel.
                
> Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2257
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2257
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.2
>         Environment: AIX 6.1 (64-bit)
> WebSphere Application Server V8.0 (32-bit) 
>            Reporter: Stephan Hagedorn
>            Assignee: Albert Lee
>              Labels: concurrency, concurrentmodificationexception, nullpointerexception
>             Fix For: 2.3.0
>
>         Attachments: OpenJPABugTest.zip
>
>
> A call of EntityManager.getProperties() can lead to NullPointer and ConcurrentModificationException. Issue occurs right after start up of the overlying JEE application if multiple EntityManager instance are created at same time.
> Please find the issued stack trace below:
> Caused by: java.lang.NullPointerException
>         at java.lang.String.compareTo(String.java:482)
>         at java.lang.String.compareTo(String.java:31)
>         at java.util.TreeMap.cmp(TreeMap.java:4514)
>         at java.util.TreeMap.putImpl(TreeMap.java:4556)
>         at java.util.TreeMap.put(TreeMap.java:4536)
>         at java.util.TreeSet.add(TreeSet.java:122)
>         at
> org.apache.openjpa.lib.conf.ConfigurationImpl.getPropertyKeys(ConfigurationImpl.java:708)
>         at
> org.apache.openjpa.kernel.BrokerImpl.getSupportedProperties(BrokerImpl.java:729)
>         at
> org.apache.openjpa.kernel.DelegatingBroker.getSupportedProperties(DelegatingBroker.java:223)
>         at
> org.apache.openjpa.persistence.EntityManagerImpl.getProperties(EntityManagerImpl.java:1624)
>         ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2257) Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException

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

Albert Lee updated OPENJPA-2257:
--------------------------------

    Attachment: OPENJPA-2257.patch
    
> Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2257
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2257
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.2
>         Environment: AIX 6.1 (64-bit)
> WebSphere Application Server V8.0 (32-bit) 
>            Reporter: Stephan Hagedorn
>            Assignee: Albert Lee
>              Labels: concurrency, concurrentmodificationexception, nullpointerexception
>             Fix For: 2.3.0
>
>         Attachments: OPENJPA-2257.patch, OpenJPABugTest.zip
>
>
> A call of EntityManager.getProperties() can lead to NullPointer and ConcurrentModificationException. Issue occurs right after start up of the overlying JEE application if multiple EntityManager instance are created at same time.
> Please find the issued stack trace below:
> Caused by: java.lang.NullPointerException
>         at java.lang.String.compareTo(String.java:482)
>         at java.lang.String.compareTo(String.java:31)
>         at java.util.TreeMap.cmp(TreeMap.java:4514)
>         at java.util.TreeMap.putImpl(TreeMap.java:4556)
>         at java.util.TreeMap.put(TreeMap.java:4536)
>         at java.util.TreeSet.add(TreeSet.java:122)
>         at
> org.apache.openjpa.lib.conf.ConfigurationImpl.getPropertyKeys(ConfigurationImpl.java:708)
>         at
> org.apache.openjpa.kernel.BrokerImpl.getSupportedProperties(BrokerImpl.java:729)
>         at
> org.apache.openjpa.kernel.DelegatingBroker.getSupportedProperties(DelegatingBroker.java:223)
>         at
> org.apache.openjpa.persistence.EntityManagerImpl.getProperties(EntityManagerImpl.java:1624)
>         ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (OPENJPA-2257) Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException

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

Albert Lee reassigned OPENJPA-2257:
-----------------------------------

    Assignee: Albert Lee
    
> Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2257
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2257
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.2
>         Environment: AIX 6.1 (64-bit)
> WebSphere Application Server V8.0 (32-bit) 
>            Reporter: Stephan Hagedorn
>            Assignee: Albert Lee
>              Labels: concurrency, concurrentmodificationexception, nullpointerexception
>         Attachments: OpenJPABugTest.zip
>
>
> A call of EntityManager.getProperties() can lead to NullPointer and ConcurrentModificationException. Issue occurs right after start up of the overlying JEE application if multiple EntityManager instance are created at same time.
> Please find the issued stack trace below:
> Caused by: java.lang.NullPointerException
>         at java.lang.String.compareTo(String.java:482)
>         at java.lang.String.compareTo(String.java:31)
>         at java.util.TreeMap.cmp(TreeMap.java:4514)
>         at java.util.TreeMap.putImpl(TreeMap.java:4556)
>         at java.util.TreeMap.put(TreeMap.java:4536)
>         at java.util.TreeSet.add(TreeSet.java:122)
>         at
> org.apache.openjpa.lib.conf.ConfigurationImpl.getPropertyKeys(ConfigurationImpl.java:708)
>         at
> org.apache.openjpa.kernel.BrokerImpl.getSupportedProperties(BrokerImpl.java:729)
>         at
> org.apache.openjpa.kernel.DelegatingBroker.getSupportedProperties(DelegatingBroker.java:223)
>         at
> org.apache.openjpa.persistence.EntityManagerImpl.getProperties(EntityManagerImpl.java:1624)
>         ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OPENJPA-2257) Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException

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

Albert Lee commented on OPENJPA-2257:
-------------------------------------

The problem is caused by the assumption that the configurationImpl obtained from emf is threadsafe since all the configuration values are frozen once the emf is created. However the broker getProperty() implementation defers the building up of the property key collection (_supportedKeys) in the configurationImpl when it is needed, but the _supportedKeys is not synchronized( thread safe), hence the observed exceptions.
                
> Concurreny in org.apache.openjpa.persistence.EntityManagerImpl.getProperties leads to NullPointer and ConcurrentModificationException
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2257
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2257
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.2
>         Environment: AIX 6.1 (64-bit)
> WebSphere Application Server V8.0 (32-bit) 
>            Reporter: Stephan Hagedorn
>              Labels: concurrency, concurrentmodificationexception, nullpointerexception
>         Attachments: OpenJPABugTest.zip
>
>
> A call of EntityManager.getProperties() can lead to NullPointer and ConcurrentModificationException. Issue occurs right after start up of the overlying JEE application if multiple EntityManager instance are created at same time.
> Please find the issued stack trace below:
> Caused by: java.lang.NullPointerException
>         at java.lang.String.compareTo(String.java:482)
>         at java.lang.String.compareTo(String.java:31)
>         at java.util.TreeMap.cmp(TreeMap.java:4514)
>         at java.util.TreeMap.putImpl(TreeMap.java:4556)
>         at java.util.TreeMap.put(TreeMap.java:4536)
>         at java.util.TreeSet.add(TreeSet.java:122)
>         at
> org.apache.openjpa.lib.conf.ConfigurationImpl.getPropertyKeys(ConfigurationImpl.java:708)
>         at
> org.apache.openjpa.kernel.BrokerImpl.getSupportedProperties(BrokerImpl.java:729)
>         at
> org.apache.openjpa.kernel.DelegatingBroker.getSupportedProperties(DelegatingBroker.java:223)
>         at
> org.apache.openjpa.persistence.EntityManagerImpl.getProperties(EntityManagerImpl.java:1624)
>         ... 33 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira