SerializationStreamFactory.setManagerClassName("jms", "org.jboss.jms.server.remoting.JMSSerializationManager");
SerializationStreamFactory.setManagerClassName("jms", "org.jboss.remoting.serialization.impl.jboss.JBossSerializationManager");
   private void initializeRemoting(MBeanServer mbeanServer) throws Exception   {      //We explicitly associate the datatype "jms" with our customer SerializationManager      //This is vital for performance reasons.      SerializationStreamFactory.setManagerClassName("jms", "org.jboss.jms.server.remoting.JMSSerializationManager");            JMSWireFormat wf = new JMSWireFormat();            MarshalFactory.addMarshaller("jms", wf, wf);                  log.info("Getting invokerlocator for " + connectorName);            String s = (String)mbeanServer.getAttribute(connectorName, "InvokerLocator");            locator = new InvokerLocator(s);            //Note - There seems to be a bug (feature?) in JBoss Remoting which if you specify      //a socket timeout on the invoker locator URI then it always makes a remote call      //even when in the same JVM      log.debug("LocatorURI: " + getLocatorURI());            //First remove the invocation handler specified in the config      mbeanServer.invoke(connectorName, "removeInvocationHandler",            new Object[] {"JMS"},            new String[] {"java.lang.String"});      // add the JMS subsystem invocation handler            handler = new JMSServerInvocationHandler();      mbeanServer.invoke(connectorName, "addInvocationHandler",                         new Object[] {"JMS", handler},                         new String[] {"java.lang.String",                                       "org.jboss.remoting.ServerInvocationHandler"});        //      //install the connection listener that listens for failed connections//      connectionListener = new ServerConnectionListener();//      //      mbeanServer.invoke(connectorName, "addConnectionListener",//            new Object[] {connectionListener},//            new String[] {"org.jboss.remoting.ConnectionListener"});          }