2 Replies Latest reply on Jul 26, 2012 10:11 PM by Jonas Hu

    A stateless sessionBean invoke another sessionBean error in the same JVM and the same jboss as 7

    Jonas Hu Newbie

      Hi community:

       

          i made two stateless sessionbeans located in different jars, deployed them under the same JBOSS AS7 7.1.0.CR1b. my purpose is to find a way to have one sessionbean invoke another, but failed.

       

        1、full  logs:

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

      17:42:53,421 信息[org.jboss.modules] JBoss Modules version 1.1.0.CR6

      17:42:53,703 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA

      17:42:53,781 INFO  [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" starting

      17:42:55,281 INFO  [org.jboss.as] Creating http management service using  socket-binding (management-http)

      17:42:55,281 INFO  [org.xnio] XNIO Version 3.0.0.CR7

      17:42:55,296 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.0.CR7

      17:42:55,312 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.0.CR8

      17:42:55,328 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

      17:42:55,375 INFO  [org.jboss.as.cmp.subsystem.CmpSubsystemAdd] Activating EJB CMP Subsystem

      17:42:55,421 INFO  [org.jboss.as.clustering] JBAS010300: Activating Infinispan subsystem.

      17:42:55,421 INFO  [org.jboss.as.naming] JBAS011802: Starting Naming Service

      17:42:55,421 INFO  [org.jboss.as.security] Activating Security Subsystem

      17:42:55,421 INFO  [org.jboss.as.mail.extension] JBAS015400: Bound mail session [java:jboss/mail/Default]

      17:42:55,484 INFO  [org.jboss.as.webservices] JBAS015537: Activating WebServices Extension

      17:42:55,515 INFO  [org.jboss.as.security] Picketbox version=4.0.6.Beta2

      17:42:55,531 INFO  [org.jboss.as.osgi] JBAS011910: Activating OSGi Subsystem

      17:42:55,828 INFO  [org.jboss.as.connector] JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.6.Final)

      17:42:55,890 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      17:42:55,921 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.driver.OracleDriver (version 10.2)

      17:42:55,937 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010403: Deploying JDBC-compliant driver class org.hsqldb.jdbc.JDBCDriver (version 2.2)

      17:42:56,359 WARN  [org.jboss.as.messaging] JBAS011600: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal

      17:42:56,406 INFO  [org.jboss.as.remoting] Listening on localhost/127.0.0.1:4447

      17:42:56,421 WARN  [jacorb.codeset] Warning - unknown codeset (GBK) - defaulting to ISO-8859-1

      17:42:56,437 INFO  [org.jboss.as.jacorb] CORBA ORB Service Started

      17:42:56,500 信息[org.hornetq.core.server.impl.HornetQServerImpl] live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=D:\Programs\redhat\jboss-as-7.1.0.CR1b\standalone\data\messagingjournal,bindingsDirectory=D:\Programs\redhat\jboss-as-7.1.0.CR1b\standalone\data\messagingbindings,largeMessagesDirectory=D:\Programs\redhat\jboss-as-7.1.0.CR1b\standalone\data\messaginglargemessages,pagingDirectory=D:\Programs\redhat\jboss-as-7.1.0.CR1b\standalone\data\messagingpaging)
      17:42:56,562 警告[org.hornetq.core.server.impl.HornetQServerImpl] Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to do this.

      17:42:57,328 INFO  [org.jboss.ws.common.management.AbstractServerConfig] JBoss Web Services - Stack CXF Server 4.0.0.GA

      17:42:57,343 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5455 for CORE protocol

      17:42:57,343 INFO  [org.hornetq.core.remoting.impl.netty.NettyAcceptor] Started Netty Acceptor version 3.2.3.Final-r${buildNumber} localhost:5445 for CORE protocol

      17:42:57,359 信息[org.hornetq.core.server.impl.HornetQServerImpl] Server is now live
      17:42:57,359 信息[org.hornetq.core.server.impl.HornetQServerImpl] HornetQ Server version 2.2.7.Final (HQ_2_2_7_FINAL_AS7, 121) [99bf2631-cfef-11e1-92c3-d8d3852a87bd] started

      17:42:57,515 INFO  [org.jboss.as.jacorb] CORBA Naming Service Started

      17:42:57,531 INFO  [org.jboss.as.messaging] JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory

      17:42:57,531 信息[org.hornetq.core.server.impl.HornetQServerImpl] trying to deploy queue jms.queue.testQueue

      17:42:57,609 INFO  [org.jboss.as.messaging] JBAS011601: Bound messaging object to jndi name java:/queue/test

      17:42:57,609 INFO  [org.jboss.as.messaging] JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory

      17:42:57,609 信息[org.hornetq.core.server.impl.HornetQServerImpl] trying to deploy queue jms.topic.testTopic

      17:42:57,656 INFO  [org.apache.coyote.http11.Http11AprProtocol] Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080

      17:42:57,656 INFO  [org.jboss.as.messaging] JBAS011601: Bound messaging object to jndi name java:/topic/test

      17:42:57,703 INFO  [org.jboss.as.remoting] Listening on /127.0.0.1:9999

      17:42:57,703 WARN  [org.jboss.as.server.deployment.scanner] JBAS015005: Reliable deployment behaviour is not possible when auto-deployment of exploded content is enabled (i.e. deployment without use of ".dodeploy"' marker files). Configuration of auto-deployment of exploded content is not recommended in any situation where reliability is desired. Configuring the deployment scanner's auto-deploy-exploded setting to "false" is recommended.

      17:42:57,718 INFO  [org.jboss.as.server.deployment.scanner] JBAS015012: Started FileSystemDeploymentService for directory D:\Programs\redhat\jboss-as-7.1.0.CR1b\standalone\deployments

      17:42:57,750 INFO  [org.jboss.as.server.deployment.scanner] JBAS015014: Re-attempting failed deployment EJBProject.jar

      17:42:58,046 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010400: Bound data source [java:/ds/spmgr]

      17:42:58,046 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      17:42:58,046 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010400: Bound data source [java:/ds/localH2db]

      17:42:58,046 INFO  [org.jboss.as.connector.subsystems.datasources] JBAS010400: Bound data source [java:/ds/boss_product_service]

      17:42:58,078 INFO  [org.jboss.as.deployment.connector] JBAS010406: Registered connection factory java:/JmsXA

      17:42:58,093 INFO  [org.hornetq.ra.HornetQResourceAdapter] HornetQ resource adaptor started

      17:42:58,093 INFO  [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] IJ020002: Deployed: file://RaActivatorhornetq-ra

      17:42:58,093 INFO  [org.jboss.as.deployment.connector] JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]

      17:42:58,140 INFO  [org.jboss.as.server.deployment] Starting deployment of "EJBProjectAssistant.jar"

      17:42:58,140 INFO  [org.jboss.as.server.deployment] Starting deployment of "EJBProject.jar"

      17:42:58,296 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] JNDI bindings for session bean named AppStartupBean in deployment unit deployment "EJBProject.jar" are as follows:

       


      java:global/EJBProject/AppStartupBean!yu.zhong.hu.service.impl.AppStartupBean

      java:app/EJBProject/AppStartupBean!yu.zhong.hu.service.impl.AppStartupBean

      java:module/AppStartupBean!yu.zhong.hu.service.impl.AppStartupBean

      java:global/EJBProject/AppStartupBean

      java:app/EJBProject/AppStartupBean

      java:module/AppStartupBean

       

      17:42:58,296 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] JNDI bindings for session bean named ServiceBImpl in deployment unit deployment "EJBProjectAssistant.jar" are as follows:

       


      java:global/EJBProjectAssistant/ServiceBImpl!yu.zhong.hu.service.IServiceB

      java:app/EJBProjectAssistant/ServiceBImpl!yu.zhong.hu.service.IServiceB

      java:module/ServiceBImpl!yu.zhong.hu.service.IServiceB

      java:global/EJBProjectAssistant/ServiceBImpl

      java:app/EJBProjectAssistant/ServiceBImpl

      java:module/ServiceBImpl

       

      17:42:58,468 ERROR [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" started (with errors) in 5328ms - Started 249 of 329 services (3 services failed or missing dependencies, 72 services are passive or on-demand)

      17:42:58,671 INFO  [org.jboss.as.server] JBAS015857: Undeploy of deployment "EJBProjectAssistant.jar" was rolled back with no failure message

      17:42:58,671 INFO  [org.jboss.as.server] JBAS015856: Undeploy of deployment "EJBProject.jar" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.EJBProject.EJBProject.AppStartupBean.env.\"yu.zhong.hu.service.impl.AppStartupBean\".serviceBjboss.naming.context.java.module.EJBProject.EJBProject.ServiceBImplMissing[jboss.naming.context.java.comp.EJBProject.EJBProject.AppStartupBean.env.\"yu.zhong.hu.service.impl.AppStartupBean\".serviceBjboss.naming.context.java.module.EJBProject.EJBProject.ServiceBImpl]"]}

      17:42:58,687 INFO  [org.jboss.as.server.deployment] Stopped deployment EJBProjectAssistant.jar in 16ms

      17:42:58,687 INFO  [org.jboss.as.server.deployment] Stopped deployment EJBProject.jar in 17ms

      17:42:58,687 INFO  [org.jboss.as.controller] JBAS014774: Service status report

      JBAS014775:New missing/unsatisfied dependencies:
        service jboss.naming.context.java.module.EJBProject.EJBProject.ServiceBImpl (missing) dependents: [service jboss.naming.context.java.comp.EJBProject.EJBProject.AppStartupBean.env."yu.zhong.hu.service.impl.AppStartupBean".serviceB]

       

      17:42:58,687 ERROR [org.jboss.as.server.deployment.scanner] {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.EJBProject.EJBProject.AppStartupBean.env.\"yu.zhong.hu.service.impl.AppStartupBean\".serviceBjboss.naming.context.java.module.EJBProject.EJBProject.ServiceBImplMissing[jboss.naming.context.java.comp.EJBProject.EJBProject.AppStartupBean.env.\"yu.zhong.hu.service.impl.AppStartupBean\".serviceBjboss.naming.context.java.module.EJBProject.EJBProject.ServiceBImpl]"]}}}

      17:42:58,687 ERROR [org.jboss.as.server.deployment.scanner] JBAS014654: Composite operation was rolled back

       

       

      2、sourcecodes in EJBProject.jar

      /**

      *@fileName   : AppStartupBean.java

      *@description: startupBean

      */

      @Singleton

      @Startup

      public class AppStartupBean {

          @EJB(lookup="java:module/ServiceBImpl")

          private IServiceB serviceB;

         

          @PostConstruct

          public void init() {

              int i = (int)Math.round(Math.random() * 100);

              int j = (int)Math.round(Math.random() * 50);

              System.out.println(String.format("%d - %d = %d", i, j, serviceB.dec(i, j)));

          }

       

      }

       

      3、EJBProjectAssistant.jar

      /**

      *@fileName   : IServiceB.java

      */

      public interface IServiceB {

         int dec(int i, int j);

      }

       

       

      /**

      *@fileName   : ServiceBImpl.java

      */

      @Stateless

      @Local(value=IServiceB.class)

      public class ServiceBImpl implements IServiceB {

       

          /* (non-Javadoc)

           * @see yu.zhong.hu.service.IServiceB#dec(int, int)

           */

          @Override

          public int dec(int i, int j) {

              return i - j;

          }

      }

       

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

      anyone can help me?  many thanks.   (if all the sessionBeans are in the same jar, there is no failure)