OpenJPA
  1. OpenJPA
  2. OPENJPA-1631

MetaDataRepository preload doesn't load JAXB meta data

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2, 2.0.0-beta3
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      The MetaDataRepository preloading doesn't process JAXB xml meta data on EMF creation, resulting in a condition where multiple threads can trample on each other. AnnotationPersistenceXMLMetaDataParser.parse(..) isn't thread-safe and relied on the MetaDataRepository to enforce synchronization. After preloading is complete, all locks are removed from the MetaDataRepository and in turn AnnotationPersistenceXMLMetaDataParser can have some threading problems.

      Caused by: java.lang.NullPointerException
      at org.apache.openjpa.lib.util.J2DoPrivHelper$56.run(J2DoPrivHelper.java:1163)
      at org.apache.openjpa.lib.util.J2DoPrivHelper$56.run(J2DoPrivHelper.java:1161)
      at java.security.AccessController.doPrivileged(AccessController.java:202)
      at org.apache.openjpa.persistence.AnnotationPersistenceXMLMetaDataParser.parseXMLClassAnnotations(AnnotationPersistenceXMLMetaDataParser.java:175)
      at org.apache.openjpa.persistence.AnnotationPersistenceXMLMetaDataParser.parse(AnnotationPersistenceXMLMetaDataParser.java:163)
      at org.apache.openjpa.persistence.PersistenceMetaDataFactory.loadXMLMetaData(PersistenceMetaDataFactory.java:579)
      at org.apache.openjpa.meta.MetaDataRepository.getXMLMetaDataInternal(MetaDataRepository.java:2376)
      at org.apache.openjpa.meta.MetaDataRepository.getXMLMetaData(MetaDataRepository.java:2364)
      at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.traversePath(AbstractExpressionBuilder.java:315)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getPath(JPQLExpressionBuilder.java:1941)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getPathOrConstant(JPQLExpressionBuilder.java:1861)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:1169)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getValue(JPQLExpressionBuilder.java:2054)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getValue(JPQLExpressionBuilder.java:2040)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:1055)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getExpression(JPQLExpressionBuilder.java:1970)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.eval(JPQLExpressionBuilder.java:997)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.evalWhereClause(JPQLExpressionBuilder.java:668)
      at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getQueryExpressions(JPQLExpressionBuilder.java:297)
      at org.apache.openjpa.kernel.jpql.JPQLParser.eval(JPQLParser.java:67)

        Issue Links

          Activity

          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Rick Curtis made changes -
          Link This issue relates to OPENJPA-1634 [ OPENJPA-1634 ]
          Donald Woods made changes -
          Fix Version/s 2.1.0 [ 12314542 ]
          Rick Curtis made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Kevin Sutter made changes -
          Fix Version/s 2.0.0 [ 12314019 ]
          Rick Curtis made changes -
          Fix Version/s 2.1.0 [ 12314542 ]
          Rick Curtis made changes -
          Field Original Value New Value
          Attachment OPENJPA-1631.patch [ 12441649 ]
          Rick Curtis created issue -

            People

            • Assignee:
              Rick Curtis
              Reporter:
              Rick Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development