3 Replies Latest reply on Dec 28, 2009 8:32 AM by heuven

    Differences between JBoss web and all?

      Hi,

       

      I am pretty new to JBoss and J2EE development. Nonetheless I am trying a complicated setup - I downloaded jboss-5.0.1.GA and managed to deploy a resource adapter which accepts TCP data streams. The RA is associated with a MDB. However, I am getting this error when deploying my MDB:

       

      DEPLOYMENTS IN ERROR:
         Deployment "vfszip:/C:/jboss-5.0.1.GA/server/web/deploy/sockets-ejb-1.1.jar/"
      is in error due to the following reason(s): java.lang.NullPointerException

       

      1) I am unsure on what strategy to follow to debug/trace the root cause of this problem. To me it seems like not a single line of source code from my MDB is called. So there must be a problem with the ejb-jar.xml or jboss.xml file? Or the structure of my JAR file? I have log code in each method of my source code. Maybe logging is not (yet) enabled?

       

      2) As I am quite new to J2EE development I am not 100% sure in my assumption that I can deploy a MDB as a JAR file - it is my assumption that it is not necessary to deploy a MDB as an EAR file. Pls, can some one confirm this or deny?

       

      3) I would need a simple MDB example which I am able to deploy (preferably as a JAR file).

       

      4) I have several configurations for JBoss on my laptop - all, default, minimal, standard and web. Currently I am using web (start with run -c web). I do assume the web configuration does support deployment of MDBs? How or where can you see the differences between all these configurations?

       

      BR,

       

      Rene

       

       

       


        • 1. Differences between JBoss web and all?

          Hi,

           

          I managed to get a lot further in the meantime. The MDB is now working and can receive TCP data through port 9000 or port 5000.

           

          I also discovered that it is not necessary to deploy a MDB in an EAR file - you can just deploy it as a JAR file. A couple of things are still bothering my mind:

           

          Concerning the configurations for JBoss:

           

          My MDB works in the all configuration (start with run -c all), but gives an error when I try (and re-deploy) to run the MDB in the web configuration (start with run -c web). Here is the error:

           

          DEPLOYMENTS IN ERROR:
            Deployment "vfszip:/C:/jboss-5.0.1.GA/server/web/deploy/sockets-ejb-1.1.jar/"
          is in error due to the following reason(s): java.lang.NullPointerException

           

          I am a bit supprised about this behaviour as I would expect the MDB and RAR to be running also in the web configuration. We have ejb3.deployer and jboss-jca.deployer in the web configuration just like in the all configuration. So why can my MDB not run in the web configuration?

           

          BR,

           

          Rene

          • 2. Re: How to find the cause of java.lang.NullPointerException when deploying MDB
            jaikiran

            heuven wrote:

             

            Hi,

             

            I am pretty new to JBoss and J2EE development. Nonetheless I am trying a complicated setup - I downloaded jboss-5.0.1.GA

             

            The latest stable JBoss AS version is 5.1.0. So i would recommend that you download that version.

             

            heuven wrote:

             

            However, I am getting this error when deploying my MDB:

             

            DEPLOYMENTS IN ERROR:
               Deployment "vfszip:/C:/jboss-5.0.1.GA/server/web/deploy/sockets-ejb-1.1.jar/"
            is in error due to the following reason(s): java.lang.NullPointerException

            Please post the entire exception stacktrace. That will give the relevant information. You will find the stacktrace earlier on the console or even in the server.log file.

             

            heuven wrote:

             

            1) I am unsure on what strategy to follow to debug/trace the root cause of this problem. To me it seems like not a single line of source code from my MDB is called. So there must be a problem with the ejb-jar.xml or jboss.xml file? Or the structure of my JAR file? I have log code in each method of my source code. Maybe logging is not (yet) enabled?

            Depends where the exception is originating from. It might even be from some JBoss server class and the control may not have reached your code yet. You can find  the logs on the console as well as JBOSS_HOME/server/<servername>/log/server.log file.

             

            heuven wrote:

             

            2) As I am quite new to J2EE development I am not 100% sure in my assumption that I can deploy a MDB as a JAR file - it is my assumption that it is not necessary to deploy a MDB as an EAR file. Pls, can some one confirm this or deny?

             

             

             


            You are right, an .jar should be enough to deploy a MDB. An .ear is not mandatory although you can package the jar in a .ear too.

             

            heuven wrote:

             

            3) I would need a simple MDB example which I am able to deploy (preferably as a JAR file).

             

            The EJB3 tutorials can be found here (along with the source code) http://www.jboss.org/ejb3/docs/

             

            heuven wrote:

             

            4) I have several configurations for JBoss on my laptop - all, default, minimal, standard and web. Currently I am using web (start with run -c web). I do assume the web configuration does support deployment of MDBs? How or where can you see the differences between all these configurations?

             

             


            The "web" configuration does not support EJB deployments. Each of those configurations "all", "default", "minimal", "standard", "web" provide a different set of services. Normally, the "default" is what you would go far. The "all" contains the clustering support additionally. For more details, see this

             

            By the way, a better place for questions related to JBoss AS is here http://community.jboss.org/community/jbossas

            1 of 1 people found this helpful
            • 3. Re: How to find the cause of java.lang.NullPointerException when deploying MDB

              Hi Jaikiran,

               

              thanks for your very useful answer. I will continue in the JBoss AS community forum. I understand I cannot use JBoss web as it does not support EJBs. Also I noticed I cannot use TomCat. This is only a servlet container, not a full blown J2EE server like JBoss AS.

               

              BR,

               

              Rene