0 Replies Latest reply on Mar 13, 2007 10:18 AM by Adil berdai

    No 'jboss' MBeanServer found! (while getting Connection from

    Adil berdai Newbie

      Hi !

      I'm deploying a simple stateless EJB under jboss 4.0.5 GA

      it's throws this following trace :

      org.jboss.util.NestedSQLException: Problem locating real ConnectionManager: jboss.jca:service=LocalTxCM,name=MyDS; - nested throwable: (java.lang.IllegalStateException: No 'jboss' MBeanServer found!); - nested throwable: (Problem locating real ConnectionManager: jboss.jca:service=LocalTxCM,name=MyDS; - nested throwable: (java.lang.IllegalStateException: No 'jboss' MBeanServer found!))
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
      at com.solutions.auto.persistence.connection.DBManager.getConnection(DBManager.java:129)
      at com.solutions.auto.persistence.dao.DaoFactory.createConnection(DaoFactory.java:57)
      at com.solutions.auto.persistence.indicator.IndicatorDaoImpl.selectIndicators(IndicatorDaoImpl.java:66)
      at com.solutions.auto.persistence.indicator.TestIndicatorDaoImpl.testSelectIndicators(TestIndicatorDaoImpl.java:50)
      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)
      (RemoteTestRunner.java:344)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: Problem locating real ConnectionManager: jboss.jca:service=LocalTxCM,name=MyDS; - nested throwable: (java.lang.IllegalStateException: No 'jboss' MBeanServer found!)
      at org.jboss.resource.JBossResourceException.rethrowAsResourceException(JBossResourceException.java:61)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.getCM(BaseConnectionManager2.java:881)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      ... 19 more
      Caused by: java.lang.IllegalStateException: No 'jboss' MBeanServer found!
      at org.jboss.mx.util.MBeanServerLocator.locateJBoss(MBeanServerLocator.java:122)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.getCM(BaseConnectionManager2.java:875)
      ... 21 more


      I get this Exception when trying to get java.sql.Connection from my datasource provided by an EJB :

      System.setProperty("java.security.policy", "client.policy");
      if (System.getSecurityManager() == null)
      System.setSecurityManager(new RMISecurityManager());
      Properties env = new Properties();
      env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      env.setProperty("java.naming.provider.url", "180.162.10.10:1099");
      env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");


      Context ctx = new InitialContext(env);
      if (System.getSecurityManager() == null) {
      System.setSecurityManager(new RMISecurityManager());
      }

      Object obj = ctx.lookup("MyDatasourceBean");
      MyDatasourceHome home = (MyDatasourceHome) PortableRemoteObject.narrow(obj,MyDatasourceHome.class);
      MyDatasourceRemote myDatasourceRemote = home.create();


      ds= myDatasourceRemote.giveDatasource("MyDS");



      Could you help me please ! thank you in advance

      Adil