3 Replies Latest reply on Sep 27, 2010 11:56 AM by Ron Sigal

    How do I deploy the JBoss Remoting examples in JBoss AS 5.1?

    Ken Williams Newbie



        I've downloaded the JBoss Remoting 2_5_3_SP1 zip file and am able to build and run the SimpleServer and

        SimpleClient examples from the command line, using ant, as described in the documentation.


        I now want to run the SimpleServer and SimpleClient examples in my JBoss AS 5.1 server but I'm a bit confused

        about how to do it. The docs (http://docs.jboss.org/jbossremoting/2.5.3.SP1/html/ch12.html) only show

        me how to run them from the command-line. I read the article here (http://onjava.com/pub/a/onjava/2005/02/23/remoting.html)

        but I'm not sure what config file(s) I should edit. This (http://community.jboss.org/wiki/Remotingexampleservicexml)

        example config file looks interesting, but there are no service.xml files in my JBoss installation - there's plenty

        of jboss-service.xml files but they look different. I also watched the flash-demo

         (http://docs.jboss.org/jbossas/remoting/demo/JBossRemoting_demo.htm) but this doesn't tell me what config

         files to change and how, either. So basically, I'm note sure what config files to edit (create ?) or how.


        I'm also not sure how I would actually deploy the SimpleServer.class and SimpleClient.class files. I assume I

        don't copy the .class files anywhere and they don't seem to belong in a .war file which can be deployed either.


        I should perhaps point out that I'm more of a web-component developer (Servlets, JSPs, etc) and not worked

        much with 'mbean's (message beans ??) and services before.


        If anyone can help me I'll happily write up a step-by-step tutorial for people.




        Ken Williams

        • 1. Re: How do I deploy the JBoss Remoting examples in JBoss AS 5.1?
          Ken Williams Newbie

          I think no one is active on Jboss Remote forums

          • 2. Re: How do I deploy the JBoss Remoting examples in JBoss AS 5.1?
            Ken Williams Newbie

            I have now deployed the 'jboss-remoting-samples.jar' file into $JBOSS-5.1.0/server/default/deploy,

            (The jboss-remoting-samples.jar file contains the SimpleServer.class file),

            and the server output this text;


            INFO [JBossASKernel] Created KernelDeployment for: jboss-remoting-samples.jar
            INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-remoting-samples.jar,name=jboss-remoting-samples,service=EJB3
            INFO [JBossASKernel] with dependencies:
            INFO [JBossASKernel] and demands:
            INFO [JBossASKernel] and supplies:
            INFO [JBossASKernel] Aded bean (jboss.j2ee:jar=jboss-remoting-samples.jar,name=jboss-remoting-samples,service=EJB3) to KernelDeployment of: jboss-remoting-samples.jar
            INFO [ClientENCInjectionContainer] STARTED CLIENT ENC CONTAINER: jboss-remoting-samples


            Which looks good. So now I try to run the simple socket client,


                ant run-simple-client


            but it throws an exception (org.jboss.remoting.CannotConnectException : Can not get connection to server),

            and there is nothing listening on port 5400 (the port specified in SimpleServer.java).


            I'm guessing I need to change one of the .xml config files but which one ? I copied the

            <mbean> code for the 'socket' transport from the example-service.xml file included in

            the remoting distribution into the jboss-service.xml file and restarted JBoss but

            it threw several pages of errors. There is no service.xml file, as mentioned in

            the documentation. Should I try and configure it in the remoting-jboss-beans.xml file

            instead ? Am I doing the right thing ??


            Surely someone must be know how to deploy and run the simple examples in JBoss ??


            How do the rest of you run your programs ??



            • 3. Re: How do I deploy the JBoss Remoting examples in JBoss AS 5.1?
              Ron Sigal Master

              Hi Ken,


              What you're asking, I think, is how to get the AS to start up the Remoting server started by SimpleServer.  I.e., you want to replace the code in SimpleServer.setupServer() with a file that causes the AS to start the same server.  You want a file like $JBOSS_HOME/server/default/deploy/remoting-jboss-beans.xml, where the "UnifiedInvokerConnector" describes the Remoting server and "UnifiedInvokerConfiguration" configures it.  You could call your file example-remoting-jboss-beans.xml, for example, put it in the same directory, and replace the connector and configuration beans with your own versions.  For more about Remoting configuration, see Chapter 5 of the Remoting Guide (http://docs.jboss.org/jbossremoting/2.5.3.SP1/html/) for a description of the various configuration parameters, and, in particular, see Section "Declarative configuration: POJOs" for a discussion of the xml configuration file.