3 Replies Latest reply on Jun 8, 2007 4:10 PM by gottad

    Newbie Remoting Problem (Class does not expose a management

    gottad

      Hi,

      I'm new at remoting with JBoss. I Use JBoss 4.2.0GA, Remoting 2.0.0 and Java JDK 1.5.0_12. I'm not possible to deploy the 2.0.0 Remoting-Server-Example. I get the Exception "Class does not expose a management interface".
      This is my Server:

      package rem;
      
      import javax.management.MBeanServer;
      import org.jboss.remoting.InvocationRequest;
      import org.jboss.remoting.InvokerLocator;
      import org.jboss.remoting.ServerInvocationHandler;
      import org.jboss.remoting.ServerInvoker;
      import org.jboss.remoting.callback.InvokerCallbackHandler;
      import org.jboss.remoting.transport.Connector;
      
      public class SampleInvocationHandler implements ServerInvocationHandler
      {
       public Object invoke(InvocationRequest invocation) throws Throwable{
       System.out.println("Invocation request is: " + invocation.getParameter());
       return "ich Server, dein Request ("+invocation.getParameter()+") meine Antwort";
       }
       public void addListener(InvokerCallbackHandler callbackHandler){}
      
       public void removeListener(InvokerCallbackHandler callbackHandler) {}
       public void setMBeanServer(MBeanServer server){}
      
       public void setInvoker(ServerInvoker invoker){}
      }

      I compiled this File and placed it in a folder called "rem" (because of its package) and this folder would be included into an file called rem_test.jar. I have placed this rem_test.jar File in the JBOSS/server/default/lib directory.

      I created then a META-INF Folder and placed there 2 XML-Files. The First one is "jboss-app.xml" with this content:
      <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
      <jboss-app>
       <module>
       <service>rem.sar</service>
       </module>
      </jboss-app>

      The second one is "jboss-service.xml" with this content:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE server>
      
      <server>
       <!-- <classpath codebase="../" archives="*"/> -->
       <mbean code="org.jboss.remoting.transport.Connector"
       name="jboss.remoting:service=Connector,transport=Socket"
       display-name="Socket transport Connector">
       <attribute name="Configuration">
       <config>
       <invoker transport="socket">
       <attribute name="numAcceptThreads">1</attribute>
       <attribute name="maxPoolSize">303</attribute>
       <attribute name="clientMaxPoolSize" isParam="true">304</attribute>
       <attribute name="socketTimeout">60000</attribute>
       <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
       <attribute name="serverBindPort">6666</attribute>
       <!-- <attribute name="clientConnectAddress">127.0.0.1</attribute>
       <attribute name="clientConnectPort">7777</attribute> -->
       <attribute name="enableTcpNoDelay" isParam="true">false</attribute>
       <attribute name="backlog">200</attribute>
       </invoker>
       <handlers>
       <handler subsystem="remSample">
       rem.SampleInvocationHandler</handler>
       </handlers>
       </config>
       </attribute>
       </mbean>
      </server>

      I created a Folder called "rem.sar" in the JBoss/server/default/deploy Folder and placed there the "META-INF" Folder with both xml files.

      If I start JBoss, i get the Exception that JBoss need a management Interface. But i thought this was the "ServerInvocationHandler"? Here is part from the Log-File:
      ...
      2007-06-08 18:23:17,113 DEBUG [org.jboss.deployment.SARDeployer] create operation failed for package file:/C:/schulung/jboss-4.2.0.GA/server/default/deploy/rem.sar/
      org.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object; - nested throwable: (javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object)
       at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
       at org.jboss.system.ServiceController.install(ServiceController.java:226)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.install(Unknown Source)
       at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
      ...

      I hope i make a stupid mistake, but i can't find my fault (and i still have no client). I'm trying since 12 hours about this problem, i hope someone can help me.
      Thanks a lot!

      Thomas (gottad)

        • 1. Re: Newbie Remoting Problem (Class does not expose a managem
          mazz

           

          I Use JBoss 4.2.0GA, Remoting 2.0.0 and Java JDK 1.5.0_12. I'm not possible to deploy the 2.0.0 Remoting-Server-Example.


          FYI: JBossAS 4.2.0.GA already ships with Remoting 2.2.SP4 installed.

          I don't know if that is the cause of your problem - but if you are deploying your own Remoting 2.0.0 jar into JbossAS 4.2.0.GA, be aware that you might be conflicting with the built-in Remoting 2.2.SP4.

          • 2. Re: Newbie Remoting Problem (Class does not expose a managem
            gottad

            I doesn't know that JBoss 4.2.0 included Remoting 2.2. Thanks.
            I have switched back to 2.2.SP4 (replaced the downloaded *remoting*.jar Files from the Remoting 2.0.0 package in the JBoss/server/default/lib Folder with the original ones), but the error Message was the same.
            Should I try JBoss 4.0.5?
            Should I post/send my sourcecodes?

            Thomas

            • 3. Re: Newbie Remoting Problem (Class does not expose a managem
              gottad

              Appendix:
              I have tried my sourcecode (recompiling my SampleInvocationHandler with using of JBoss 4.0.5 jboss-remoting.jar package) with JBoss 4.0.5GA and the error is still the same. Therefore I think it must be something wrong with my code.
              Is there an example (something without an ant script) that i can deploy?
              Thanks again.

              Thomas (gottad)