6 Replies Latest reply on Nov 17, 2010 8:00 AM by Peter Johnson

    Patiently trying to deploy my first ejb

    Ben Hundley Newbie

      I am new to JBoss and EJB but not completely new to J2EE.  In any case... I am just trying to get a feel for JBoss and EJB by deploying a simple EJB bean.  I bought the OReilly EJB 3.1 book and now I'm just trying to deploy their example bean from chapter 4, which is just a simple stateless session bean.  I am finding it very very frustrating.  I created all the Bean classes and interfaces.  They all compiled.  I jarred them up and named it firstejb.jar.  I started jboss.  I dropped it in the

      %jboss_install_dir\jboss-as\server\default directory.  Then I looked at the consol and nothing.  All the documentation I read said that dropping the bean in the directory was all that needed to be done and that I should see output in the console that it had deployed.

       

      Then I thought maybe I'd have better luck trying to download and build the examples from this community using Git and Maven as instructed in the book (two more technologies I don't yet know) and I wound up on another wild goose chase trying to figure out why I couldn't get the code checked out properly...

       

      Anyway, I would be really greatful if someone could maybe point me in the right direction as to why jboss doesn't seem to be detecting my jar file when I drop it into the deploy directory.

        • 1. Re: Patiently trying to deploy my first ejb
          Peter Johnson Master

          The JAR file should go into the "deploy" directory, in your case %jboss_install_dir\jboss-as\server\default\deploy

           

          Oh, and welcome to the JBoss forums!

          • 2. Re: Patiently trying to deploy my first ejb
            Ben Hundley Newbie

            Yes, sorry, I mistyped the directory in my first message.  I did put it in the %jboss_install_dir%\jboss-as\server\default\deploy directory but nothing happened in the console.  Is there any reason It would completely ignore this?

             

            This is my jar:

             

            $ jar -tvf firstejb.jar
                 0 Tue Nov 16 15:59:34 MST 2010 META-INF/
                71 Tue Nov 16 15:59:34 MST 2010 META-INF/MANIFEST.MF
                 0 Tue Nov 16 14:44:20 MST 2010 blogoceros/
                 0 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/
                 0 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/
               620 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/CalculatorBeanBase.c
            lass
               175 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/CalculatorCommonBusi
            ness.class
               209 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/CalculatorRemoteBusi
            ness.class
               451 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/SimpleCalculatorBean
            .class
                 0 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/test/
               920 Tue Nov 16 14:44:20 MST 2010 blogoceros/com/examples/test/CalculatorUnitT
            estCase.class

             

            Here is the Console:

             

            ===============================================================================

             

              JBoss Bootstrap Environment

             

              JBOSS_HOME: C:\Program Files\EnterprisePlatform-4.3.0.GA_CP08\jboss-as

             

              JAVA: C:\Program Files\Java\jdk1.6.0_22\bin\java

             

              JAVA_OPTS:  -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Djava.net.prefer
            IPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcIn
            terval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true

             

              CLASSPATH: C:\Program Files\Java\jdk1.6.0_22\lib\tools.jar;C:\Program Files\En
            terprisePlatform-4.3.0.GA_CP08\jboss-as\bin\run.jar

             

            ===============================================================================

             

            16:02:07,351 INFO  [Server] Starting JBoss (MX MicroKernel)...
            16:02:07,367 INFO  [Server] Release ID: JBoss [EAP] 4.3.0.GA_CP08 (build: SVNTag
            =JBPAPP_4_3_0_GA_CP08 date=201004202136)
            16:02:07,367 INFO  [Server] Home Dir: C:\Program Files\EnterprisePlatform-4.3.0.
            GA_CP08\jboss-as
            16:02:07,367 INFO  [Server] Home URL: file:/C:/Program Files/EnterprisePlatform-
            4.3.0.GA_CP08/jboss-as/
            16:02:07,367 INFO  [Server] Patch URL: null
            16:02:07,367 INFO  [Server] Server Name: production
            16:02:07,367 INFO  [Server] Server Home Dir: C:\Program Files\EnterprisePlatform
            -4.3.0.GA_CP08\jboss-as\server\production
            16:02:07,367 INFO  [Server] Server Home URL: file:/C:/Program Files/EnterprisePl
            atform-4.3.0.GA_CP08/jboss-as/server/production/
            16:02:07,367 INFO  [Server] Server Log Dir: C:\Program Files\EnterprisePlatform-
            4.3.0.GA_CP08\jboss-as\server\production\log
            16:02:07,367 INFO  [Server] Server Temp Dir: C:\Program Files\EnterprisePlatform
            -4.3.0.GA_CP08\jboss-as\server\production\tmp
            16:02:07,367 INFO  [Server] Root Deployment Filename: jboss-service.xml
            16:02:07,992 INFO  [ServerInfo] Java version: 1.6.0_22,Sun Microsystems Inc.
            16:02:07,992 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 17.1-b03,Sun
            Microsystems Inc.
            16:02:07,992 INFO  [ServerInfo] OS-System: Windows XP 5.1,x86
            16:02:08,039 INFO  [ServerInfo] VM arguments: -Dprogram.name=run.bat -Xms128m -X
            mx512m -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -
            Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=t
            rue -Djava.endorsed.dirs=C:\Program Files\EnterprisePlatform-4.3.0.GA_CP08\jboss
            -as\lib\endorsed
            16:02:08,945 INFO  [Server] Core system initialized
            16:02:15,492 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083
            /
            16:02:15,492 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resour
            ce:jboss-log4j.xml

             

            There are no extra log messages after I drop my jar file into that directory.

            • 3. Re: Patiently trying to deploy my first ejb
              Peter Johnson Master

              You never said you were running EAP 4.3 - it always helps to specify the version you are running. Though I should have guessed you were running EAP (and not AS) based on the directory name you gave.

               

              Anyway, EAP is configured to not log to the console once bootstrap is finished and has passed processing off to the app server. So you will never see any other messages on the console (unless you turn console logging on). Instead, look in the server/default/log/server.log file - you should see your EJB being deployed there. If not, then post the source code for the beans and its interface(s).

              • 4. Re: Patiently trying to deploy my first ejb
                Ben Hundley Newbie

                For some reason the server.log file was in the production directory and not the default directory.  But I did see log messages in there that led me to believe my ejb was deployed.  Thanks!  I was about to pull my hair out. 

                • 5. Re: Patiently trying to deploy my first ejb
                  Ben Hundley Newbie

                  Oh, and yes, I should have specified the version.  Sorry about that.

                  • 6. Re: Patiently trying to deploy my first ejb
                    Peter Johnson Master

                    Since you mentioned the "default" directory in your original post I thought that was the one you specified at startup (i.e., "-c default"). With EAP, if you don't specify a configuration during startup, it uses "production" by default. - thus "default" is not the default ;-)