Details

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

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      810
    • Status Whiteboard:
      Hide

      fixed-9.0peur1

      Show
      fixed-9.0peur1

      Description

      Upon starting my application in Glassfish v2 b09 I get:

      [#|2006-07-07T18:43:43.437+0200|WARNING|sun-appserver-pe9.1|javax.enterprise.system.core.classloading|_ThreadID=11;_ThreadName=httpWorkerThread-4848-0;_RequestID=a48753a7-e4d4-4756-9c8e-7f0c38e17338;|The
      log message is null.
      java.lang.NullPointerException
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.EmbeddedAccessor.processEmbeddableClass(EmbeddedAccessor.java:245)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.EmbeddedAccessor.process(EmbeddedAccessor.java:87)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessor(ClassAccessor.java:490)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessorFields(ClassAccessor.java:503)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessors(ClassAccessor.java:529)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:460)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:194)

      Classes to reproduce:

      @Entity
      @Table(name = "MYTABLE")
      @NamedQueries(

      {...}

      )
      public class MyEntity implements Serializable

      { @EmbeddedId protected MyEntityPK myEntityPK; }

      @Embeddable
      public class MyEntityPK implements Serializable {

      @Id
      @Column(name = "foo", nullable = false)
      private String foo;

      @Id
      @Column(name = "bar", nullable = false)
      private String bar;

      public MyEntityPK()

      { } }

        Activity

        Hide
        ulim added a comment -

        I found out what the problem was. I have a JEE application, which consists of an
        EJB module and a Web module. The EJB module defines the entity classes and the
        Web module uses those entity classes.

        The persistence.xml file is defined in the EJB module, whereas the Web module
        has no persistence.xml. I was under the impression that, since the Web module
        uses the entity classes from the EJB module, it would also use its
        persistence.xml. Indeed, under SJSAS 9.0 this appears to be exactly what is
        happening, as the application runs there.

        So all I had to do was copy the persistence.xml file to the Web module and now
        my application is up and running on Glassfish-v2-b09. So I think this issue
        could be closed, if the NPE is fixed and some error message is added like
        "missing persistence.xml" or "this is the persistence.xml that was supplied to
        me". With such an error message the user could probably find such errors himself.

        Show
        ulim added a comment - I found out what the problem was. I have a JEE application, which consists of an EJB module and a Web module. The EJB module defines the entity classes and the Web module uses those entity classes. The persistence.xml file is defined in the EJB module, whereas the Web module has no persistence.xml. I was under the impression that, since the Web module uses the entity classes from the EJB module, it would also use its persistence.xml. Indeed, under SJSAS 9.0 this appears to be exactly what is happening, as the application runs there. So all I had to do was copy the persistence.xml file to the Web module and now my application is up and running on Glassfish-v2-b09. So I think this issue could be closed, if the NPE is fixed and some error message is added like "missing persistence.xml" or "this is the persistence.xml that was supplied to me". With such an error message the user could probably find such errors himself.
        Hide
        mf125085 added a comment -

        Closing this issue after addition of a ValidationException. The change log can
        be accessed under:

        http://fisheye5.cenqua.com/changelog/glassfish/?cs=MAIN:mf125085:20060717211621

        Show
        mf125085 added a comment - Closing this issue after addition of a ValidationException. The change log can be accessed under: http://fisheye5.cenqua.com/changelog/glassfish/?cs=MAIN:mf125085:20060717211621
        Hide
        mf125085 added a comment -

        There's a way to make entities in an EJB module known to other parts of an ear,
        i.e. w/o copying persistence.xml, please see

        http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html

        Show
        mf125085 added a comment - There's a way to make entities in an EJB module known to other parts of an ear, i.e. w/o copying persistence.xml, please see http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html
        Hide
        mf125085 added a comment -

        reminder

        Show
        mf125085 added a comment - reminder
        Hide
        Mitesh Meswani added a comment -

        Changes backported to 9.0 UR1

        Show
        Mitesh Meswani added a comment - Changes backported to 9.0 UR1

          People

          • Assignee:
            mf125085
            Reporter:
            ulim
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: