glassfish
  1. glassfish
  2. GLASSFISH-322

NPE when use inheritance in entity class

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe_dev
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Issuezilla Id:
      322

      Description

      [glassfish build 37]
      I created two entity classes with inheritance. The classes are same as in
      chapter 2.1.9.1 in Persistence spec:

      @Entity
      @Inheritance(strategy=InheritanceType.JOINED)
      public class Employee {

      @Entity
      @DiscriminatorValue(value="EMP")
      @PrimaryKeyJoinColumn(name="ADMIN")
      public class Administrator extends Employee{

      I get a expection when run project:
      [TopLink Config]: 2006.02.28
      06:47:12.590-ServerSession(27338224)Thread(Thread[main,5,main])-The alias
      name for the entity class
      [oracle.toplink.essentials.internal.annotations.DescriptorMetadata@276af2] is
      being defaulted to: Administrator.
      [TopLink Config]: 2006.02.28
      06:47:12.652-ServerSession(27338224)Thread(Thread[main,5,main])-The alias
      name for the entity class
      [oracle.toplink.essentials.internal.annotations.DescriptorMetadata@1de3f2d] is
      being defaulted to: Employee.
      [TopLink Config]: 2006.02.28
      06:47:12.663-ServerSession(27338224)Thread(Thread[main,5,main])-The table
      name for entity
      [oracle.toplink.essentials.internal.annotations.DescriptorMetadata@1de3f2d] is
      being defaulted to: EMPLOYEE.
      [TopLink Config]: 2006.02.28
      06:47:12.676-ServerSession(27338224)Thread(Thread[main,5,main])-The
      discriminator column name for the root inheritance class [class model.Employee]
      is being defaulted to: DTYPE.
      Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializerAgent.initializeFromAgent(JavaSECMPInitializerAgent.java:54)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializerAgent.premain(JavaSECMPInitializerAgent.java:47)
      ... 5 more
      Caused by: java.lang.NullPointerException
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processDiscriminatorValue(EJBAnnotationsProcessor.java:945)
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processInheritance(EJBAnnotationsProcessor.java:1335)
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processEntityClass(EJBAnnotationsProcessor.java:1144)
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processEntity(EJBAnnotationsProcessor.java:1090)
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processEntityClass(EJBAnnotationsProcessor.java:1125)
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processORAnnotations(EJBAnnotationsProcessor.java:1848)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:365)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:147)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:295)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:314)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initializeFromAgent(JavaSECMPInitializer.java:331)
      ... 11 more

        Activity

        Hide
        marina vatkina added a comment -

        Reassigned

        Show
        marina vatkina added a comment - Reassigned
        Hide
        pkrogh added a comment -

        Looking at this issue.

        Show
        pkrogh added a comment - Looking at this issue.
        Hide
        pkrogh added a comment -

        This is now fixed and checked in to CVS.

        Show
        pkrogh added a comment - This is now fixed and checked in to CVS.

          People

          • Assignee:
            tware
            Reporter:
            blaha
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: