2 Replies Latest reply on Feb 1, 2011 6:49 AM by jaikiran

    EJB 2.1 Deployment in JBOSS 5.1

    sep_xtr

      Hello everyone,

       

      After having a long research and reading more on deployment both from original JBoss Sources and other handbooks, couldn't be able to migrate my 2.1 versioned EJBs from WebLogic to Jboss 5.1..

       

      Simply speaking, what I'm trying to do is to migrate an enterprise project from WebLogic to Jboss AS. For that purpose, I have done the following changes by reading the following respective links...

       

      For EJB Part

       

      As you can see in following http://tim.oreilly.com/pub/a/onjava/2005/03/09/ejb-migration.html link, I have replaced all weblogic-ejb-jar.xml files with jboss.xml ones one by one. However, eventhough I set both "jndi-name" and "local-jndi-name" fields in my jboss.xml s, when client code tries to retrieve an EJB on startup by invoking the following code:

       

       

       public static ServerServiceLocalHome getLocalHome() throws javax.naming.NamingException
         {
            if (cachedLocalHome == null) {
                  cachedLocalHome = (ServerServiceLocalHome) lookupHome(null, ServerServiceLocalHome.JNDI_NAME, ServerServiceLocalHome.class);
            }
            return cachedLocalHome;
         }
      
      

       

      Here is the constant JNDI_NAME value for that...  : public static final String JNDI_NAME="/ejb/dashboard/ServerServiceLocal";

       

      Content of my ejb-jar.xml is as follows:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      
      
      <ejb-jar >
      
      
         <description><![CDATA[No Description.]]></description>
         <display-name>Generated by XDoclet</display-name>
      
      
         <enterprise-beans>
      
      
            <session >
               <description><![CDATA[]]></description>
                 <ejb-name>ServerService</ejb-name>
      
                <home>dashboard.service.server.ejb.ServerServiceHome</home>
               <remote>dashboard.service.server.ejb.ServerService</remote>
               <local-home>dashboard.service.server.ejb.ServerServiceLocalHome</local-home>
               <local>dashboard.service.server.ejb.ServerServiceLocal</local>
               <ejb-class>dashboard.service.server.ejb.ServerServiceBean</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
              </session>
      
         </enterprise-beans>
      
           <container-transaction >
            <method >
               <ejb-name>ServerService</ejb-name>
                <method-name>*</method-name>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
      
      
         </assembly-descriptor>
      
      
      </ejb-jar>
      
      

       

      Respective jboss.xml file is as follows:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">
      
      
      <jboss>
                  <enterprise-beans>
                             <session>
                                    <ejb-name>ServerService</ejb-name>
                                    <jndi-name>ejb/dashboard/ServerService</jndi-name>
                                    <local-jndi-name>ejb/dashboard/ServerServiceLocal</local-jndi-name>
                                  <method-attributes>
                                    </method-attributes>
                          </session>
      
                </enterprise-beans>
                  <resource-managers>
                </resource-managers>
        </jboss>
      
      

       

      and this is the log dumped by Jboss AS during deployment of my EJB...

       

       

      11:17:43,262 ERROR [DashboardAgentBootstrap] could not create server service ejb
      javax.naming.NameNotFoundException: ServerServiceLocal not bound
                at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
                at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
                at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
                at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                at javax.naming.InitialContext.lookup(Unknown Source)
                at dashboard.service.server.util.ServerServiceUtil.lookupHome(ServerServiceUtil.java:24)
                at dashboard.service.server.util.ServerServiceUtil.getLocalHome(ServerServiceUtil.java:70)
                at dashboard.agent.timer.DashboardAgentBootstrap.checkApplicationServerAvailablity(DashboardAgentBootstrap.java:132)
                at dashboard.agent.timer.DashboardAgentBootstrap.init(DashboardAgentBootstrap.java:53)
                at javax.servlet.GenericServlet.init(GenericServlet.java:212)
                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
                at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                at $Proxy38.start(Unknown Source)
                at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                at org.jboss.system.ServiceController.start(ServiceController.java:460)
                at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
                at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
                at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
                at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
      11:17:43,262 ERROR [DashboardAgentBootstrap] could not check application server availablity information
      motive.exceptions.ProviderException: could not create server service ejb
                at dashboard.agent.timer.DashboardAgentBootstrap.checkApplicationServerAvailablity(DashboardAgentBootstrap.java:138)
                at dashboard.agent.timer.DashboardAgentBootstrap.init(DashboardAgentBootstrap.java:53)
                at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      
      

       

      Anyhow, I couldn't understand what's the main reason of why Jboss is not able to deploy the EJB eventhough I can see it's registered through JMX-Console JNDI Tree. Is there any way how we can check JNDI Name registered in JMX-Console of an EJB?

       

      Any help will be appreciated...

       

      Thanks,