Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1003

NullPointerException at runtime enhancement when the entity has no package

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • 1.2.0
    • 1.2.0
    • None
    • None
    • DB2, openJPA 1.2.0-r422266:683325

    Description

      The given entity (referenced as <class>C</class> in the persistence.xml) produce a NullPointerException at runtime enhancement:

      // no package
      @Entity
      @Table(...) // valid table definition
      public class C {
      private int id;
      @Id
      @Column(...) // valid column definition
      public int getId()

      { return this.id; }

      public void setId(int id)

      { this.id=id; }

      }

      The NPE is :

      org.apache.openjpa.enhance.ManagedClassSubclasser.setDetachedState(ManagedClassSubclasser.java:299)
      org.apache.openjpa.enhance.ManagedClassSubclasser.configureMetaData(ManagedClassSubclasser.java:217)
      org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:139)
      org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:310)
      org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
      org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)

      The class is enhanced like a charm when adding a package name.

      I would expect either:
      1) allow the enhancement of entities without package name [preferred]
      2) receive an error message such as "could not enhance an entity without package name".

      I set the priority to "Minor" as this is not very likely that an entity is added without package.

      Attachments

        Activity

          People

            curtisr7 Richard G. Curtis
            jkronegg Julien Kronegg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified