根据bean名.jar中的jboss.xml来编写注册绑定代码。

解决方案 »

  1.   

    解决了。
    ...
     Hashtable env = new Hashtable();
        env.put("java.naming.factory.initial",
                "org.jnp.interfaces.NamingContextFactory");
        env.put("java.naming.provider.url", "jnp://localhost:1099");
        env.put("java.naming.factory.url.pkgs",
                "org.jboss.naming:org.jnp.interfaces");
        if (System.getSecurityManager() == null)
        {
          System.setSecurityManager(new RMISecurityManager());
        }
        try
        {
          Context ctx = new InitialContext(env);
          ConnectionManagerImpl connmanager = new ConnectionManagerImpl();
          ctx.bind("connmanager", connmanager);    }
        catch (Exception e) {
                  System.out.println("AdminService: error occured,"+e.getMessage());
                  e.printStackTrace();            }