3 Replies Latest reply on Dec 28, 2010 10:35 PM by Sam Tsang

    Does JBoss 6 support EJB 2.0?

    Sam Tsang Newbie

      I want to migrate my project from using JBoss 3.2.5 to JBoss 6. But I failed to deploy my EJBs to JBoss 6 CR1. Do I need to change any configurations in JBoss 6 in order to deploy successfully?


      Here is the error I get when I first tried to deploy my ear file.


      I am using JPA with Hibernate implementation and EJB 2.1 in my project (a  Spring + Hibernate project). After I deployed my project to JBoss 6.0 CR1 the  server log said:

      15:34:20,866 INFO  [EjbDeployer] installing bean: ejb/ejbproject.jar#EBMyBean,uid27484928 
      15:34:20,867 INFO  [EjbDeployer]   with dependencies:
      15:34:20,870 INFO  [EjbDeployer]   and supplies:
      15:34:20,871 INFO  [EjbDeployer]    jndi:EBMyBean
      15:34:20,873 INFO  [EjbDeployer]    jndi:local/EBMyBean@31242541
      15:34:21,038 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=myproject.ear/ejbproject.jar#persistenceUnit
      15:34:21,196 INFO  [Version] Hibernate Commons Annotations 3.2.0.Final

      The server didn't start properly and at the end it threw an exception  saying:

      Caused by: javax.naming.NameNotFoundException: EBMyBean not bound 

      In JMX console of JBoss I cannot see anything under Ejb 2.1 Module section.  My EAR file contains a jar file and a war file. All ejbs and persistence unit  are in the jar file. In META-INF folder of my jar file there are ejb-jar.xml and  persistence.xml files. I have a beanRefContext.xml outside that folder, as well  as some bean definition files.

      I also made a test project of a simple EJB 2.1 session bean without Hibernate  and deployed it. The server log, however, is different:

      15:30:46,658 INFO  [EjbDeployer] installing bean: ejb/#HiEJB,uid14009391 
      15:30:46,658 INFO  [EjbDeployer]   with dependencies:
      15:30:46,659 INFO  [EjbDeployer]   and supplies:
      15:30:46,660 INFO  [EjbDeployer]    jndi:HiEJB
      15:30:46,660 INFO  [EjbDeployer]    jndi:HiEJB/com.test.HiRemote
      15:30:46,697 INFO  [EjbModule] Deploying HiEJB
      15:30:46,904 INFO  [ProxyFactory] Bound EJB Home 'HiEJB' to jndi 'HiEJB'

      In JMX console I can see some jndi objects under Ejb 2.1 Module section and  the server starts OK.

      It seems the beans in my first project haven't bound to jndi objects.


      I then removed persistence.xml to see what happens if hibernate is not invoked. I still get the same error. Can someone please help me?

        • 1. Re: Does JBoss 6 support EJB 2.0?
          Sam Tsang Newbie

          Now I tried to deploy only the EJBs and I get this error:


          ERROR [org.jboss.profileservice.bootstrap] Failed to load profile:: org.jboss.deployers.client.spi.Incomple
          teDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):


            Deployment "jboss.ejb:persistencePolicy=database,service=EJBTimerService" is missing the following dependencies:
              Dependency "jboss.jdbc:datasource=DefaultDS,service=metadata" (should be in state "Create", but is actually in state
          "** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **")
            Deployment "jboss.ejb:service=EJBTimerService" is missing the following dependencies:
              Dependency "jboss.ejb:persistencePolicy=database,service=EJBTimerService" (should be in state "Create", but is actua
          lly in state "Configured")
            Deployment "jboss.j2ee:ear="project.ear",module="project-ejb.jar",service=EjbModule" is missing th
          e following dependencies:
              Dependency "jboss.ejb:service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")


            Deployment "jboss.jdbc:datasource=DefaultDS,service=metadata" is in error due to the following reason(s): ** NOT FOUND
          Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **


                  at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha8]
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha8]
                  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87)
                  at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegis
          try.java:118) [:0.1.0.Alpha1]
                  at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootst
          rap.java:133) [:]
                  at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootst
          rap.java:56) [:]
                  at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap
                  at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-boots
                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

          • 2. Re: Does JBoss 6 support EJB 2.0?
            jaikiran pai Master

            Is this a clean JBoss AS installation? Did you change anything with DefaultDS? Also please post the entire exception stacktrace of the original problem.

            • 3. Re: Does JBoss 6 support EJB 2.0?
              Sam Tsang Newbie

              Thanks for your reminding jaikiran. I realised that I need to put DefaultDS into the deploy folder even if I use my DS settings.

              The reason I got that error is that I put the DefaultDS.xml file to an undeploy folder and renamed my DS name to DefaultDS. But apparently JBoss is still using DefaultDS to do other jobs during bootstrapping. After I put both the DefaultDS file and my MyDS file into the deploy folder the error didn't come up again. So I have two DS names, one is DefaultDS which is for JBoss and the other is the one for my project.