1 2 3 Previous Next 34 Replies Latest reply on May 5, 2009 3:59 AM by jaikiran Go to original post
      • 30. Re: NullPointerException in JavaEEComponentHelper with JBoss
        jaikiran

        We finally were able to reproduce this issue. This issue arises because of Classpath entries in MANIFEST.MF of the ejb jar files. Looking at the MANIFEST.MF files your application has set the Classpath attribute to point to other ejb jar deployments. This leads to incorrect handling of the bean deployment for such jar (and the jars referred in the Classpath attribute). These issues are now being tracked here:

        https://jira.jboss.org/jira/browse/JBAS-6843

        https://jira.jboss.org/jira/browse/EJBTHREE-1815

        To get your application working on the current AS-5.x till these issues are fixed, here's what you can do:

        1) Remove the Classpath entries (completely) from the MANIFEST.MF of the jar deployments.
        2) JEE5 packaging provides a simpler way of adding jars to classpath. All plain jar files (i.e. not EJB deployments) can be placed in a folder named "lib" at the root of the EAR:

        ifsapp.ear
         |
         |
         |--- META-INF
         | |--- application.xml
         |
         |
         |--- lib
         | | --- xyz.jar (plain jar files)
         | | --- more plain jar files
         |
         |
         |--- ejbjar1.jar
         |
         |--- ejbjar2.jar
         |
         |--- myapp.war
         |
         |---
        


        3) All EJB deployments can then be placed at the root of the EAR and marked as a EJB module in the application.xml (this you already do).

        Make sure you don't have any ejb jars in the EAR/lib folder. Everything in the lib folder will be available in the classpath of all the components (ejbjar1, ejbjar2, war...) in the EAR.

        P.S: This packaging is portable across servers since the "lib" folder (which can be configured to be named different) is defined by JEE5 spec.



        • 31. Re: NullPointerException in JavaEEComponentHelper with JBoss

          We will try repacking our application according to the suggestions. Just a couple of additional questions/clarifications:

          1) As I understand we should remove the Classpath entries from _all_ the jar deployments: not only EJBs, but also all the plain jar files in the "lib" folder.

          2) What about plain jar referring each other, i.e. if we have a plain jar file in the "lib" folder referring another plain jar file from the same "lib" folder? Will it work without Classpath specification?

          3) What about war files and jar files within war files? The jar files within war files need to access the plain jar files from the ear’s "lib" folder, but also EJBs. Do we need to have any Classpath specification for those jar and war files?

          • 32. Re: NullPointerException in JavaEEComponentHelper with JBoss
            jaikiran

             

            "japase" wrote:


            1) As I understand we should remove the Classpath entries from _all_ the jar deployments: not only EJBs, but also all the plain jar files in the "lib" folder.

            You can let the plain jars have the ClassPath entries to point to other plain jars. Infact the EJB jars too can have Classpath entries pointing to *plain jar* files. But just make sure the EJB jars do not point to other EJB jars through Classpath attribute in the MANIFEST.MF. The reason i asked you to remove all Classpath entries was to keep it simple :)

            "japase" wrote:

            2) What about plain jar referring each other, i.e. if we have a plain jar file in the "lib" folder referring another plain jar file from the same "lib" folder? Will it work without Classpath specification?

            Yes, it will work without the need for ClassPath attribute in MANIFEST.MF.

            "japase" wrote:

            3) What about war files and jar files within war files? The jar files within war files need to access the plain jar files from the ear’s "lib" folder,

            The plain jars in the "lib" of the EAR are available to all components, including the jars in the WAR file, within that EAR. So it will work.

            "japase" wrote:

            The jar files within war files need to access the plain jar files from the ear’s "lib" folder, but also EJBs.

            Yes, the EJBs (placed at the root of the EAR) too will be available to the WARs (and the jars within that WAR).

            "japase" wrote:

            Do we need to have any Classpath specification for those jar and war files?


            No, not needed.


            • 33. Re: NullPointerException in JavaEEComponentHelper with JBoss

              Hi,

              After restructuring the application as suggested I could finally deploy it (even the "big" one I've initially started with). But I have now another, run time, problem - our EJBs access data sources and I get now authorization error when accessing a data source. The same application works on 4.3 (I'm using the same versions of data source definition files and login-config.xml in both versions).
              Shall I start a new thread or supply more details here?

              • 34. Re: NullPointerException in JavaEEComponentHelper with JBoss
                jaikiran

                 

                "japase" wrote:
                Hi,

                After restructuring the application as suggested I could finally deploy it (even the "big" one I've initially started with).


                That's good news :)

                "japase" wrote:

                But I have now another, run time, problem - our EJBs access data sources and I get now authorization error when accessing a data source. The same application works on 4.3 (I'm using the same versions of data source definition files and login-config.xml in both versions).
                Shall I start a new thread or supply more details here?


                Sure, create a new thread in this forum with all the details including any relevant xml files or code and exception stacktraces.


                1 2 3 Previous Next