glassfish
  1. glassfish
  2. GLASSFISH-461

NPE is thrown during module initialization

    Details

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

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      461

      Description

      [Glassfish build 40]
      I have a EAR module with one EJB and one web module. EJB module includes entity
      classes and the Entitymanager is used in web module. I added persistence.xml
      file with jar-file element in web module. I get excception during deployment:
      ava.lang.NullPointerException
      at
      oracle.toplink.essentials.internal.annotations.EJBAnnotationsProcessor.processORAnnotations(EJBAnnotationsProcessor.java:1343)

      1. stacktrace.txt
        5 kB
        blaha
      2. TestLazy.zip
        172 kB
        blaha

        Activity

        Hide
        blaha added a comment -

        Created an attachment (id=166)
        test application

        Show
        blaha added a comment - Created an attachment (id=166) test application
        Hide
        blaha added a comment -

        Created an attachment (id=167)
        stack trace

        Show
        blaha added a comment - Created an attachment (id=167) stack trace
        Hide
        marina vatkina added a comment -

        Can you try it on the latest nightly. A similar NPE has been fixed last week.

        thanks,
        -marina

        Show
        marina vatkina added a comment - Can you try it on the latest nightly. A similar NPE has been fixed last week. thanks, -marina
        Hide
        Sanjeeb Sahoo added a comment -

        persistence.xml is not correct.
        Specify the jar-file as
        <jar-file>../../TestLazy-ejb.jar</jar-file>

        This is causing the NPE. The value specified is treated relative to the root of
        the persistence unit, which is TestLazy-war.war/WEB-INF/classes in your case.
        So, the relative path to TestLazy-ejb.jar is ../../TestLazy-ejb.jar.

        Thanks,
        Sahoo

        Show
        Sanjeeb Sahoo added a comment - persistence.xml is not correct. Specify the jar-file as <jar-file>../../TestLazy-ejb.jar</jar-file> This is causing the NPE. The value specified is treated relative to the root of the persistence unit, which is TestLazy-war.war/WEB-INF/classes in your case. So, the relative path to TestLazy-ejb.jar is ../../TestLazy-ejb.jar. Thanks, Sahoo
        Hide
        Sanjeeb Sahoo added a comment -

        My previous comment still holds good. persistence.xml needs to specify jar-file
        as I mentioned there.

        Even after that, I see that verifier is still reporting about non-existent jar
        file. Now, I see a bug in our PersistenceUnitInfoImpl.java where we are
        constructing the url corresponding to the jar-file. The bug appears when
        jar-file references a component jar file using .. syntax. So I am reopening the bug.

        Sahoo

        Show
        Sanjeeb Sahoo added a comment - My previous comment still holds good. persistence.xml needs to specify jar-file as I mentioned there. Even after that, I see that verifier is still reporting about non-existent jar file. Now, I see a bug in our PersistenceUnitInfoImpl.java where we are constructing the url corresponding to the jar-file. The bug appears when jar-file references a component jar file using .. syntax. So I am reopening the bug. Sahoo
        Hide
        Sanjeeb Sahoo added a comment -

        Assigning to myself.

        Show
        Sanjeeb Sahoo added a comment - Assigning to myself.
        Hide
        Sanjeeb Sahoo added a comment -

        Checking in
        appserv-core/src/java/com/sun/enterprise/server/PersistenceUnitInfoImpl.java;
        /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/server/PersistenceUnitInfoImpl.java,v
        <-- PersistenceUnitInfoImpl.java
        new revision: 1.8; previous revision: 1.7
        done
        Checking in
        avk/src/tools/com/sun/enterprise/tools/verifier/tests/persistence/JarNotFound.java;
        /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/persistence/JarNotFound.java,v
        <-- JarNotFound.java
        new revision: 1.3; previous revision: 1.2
        done

        Show
        Sanjeeb Sahoo added a comment - Checking in appserv-core/src/java/com/sun/enterprise/server/PersistenceUnitInfoImpl.java; /cvs/glassfish/appserv-core/src/java/com/sun/enterprise/server/PersistenceUnitInfoImpl.java,v <-- PersistenceUnitInfoImpl.java new revision: 1.8; previous revision: 1.7 done Checking in avk/src/tools/com/sun/enterprise/tools/verifier/tests/persistence/JarNotFound.java; /cvs/glassfish/avk/src/tools/com/sun/enterprise/tools/verifier/tests/persistence/JarNotFound.java,v <-- JarNotFound.java new revision: 1.3; previous revision: 1.2 done

          People

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

            Dates

            • Created:
              Updated:
              Resolved: