Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: RmiServiceExporter / RmiProxyFactoryBean

  1. #11
    Join Date
    Nov 2005
    Location
    Chicago
    Posts
    122

    Default

    If you are using WebLogic, check out their RMI support http://www.weblogic.com/docs/classdocs/API_rmi.html. This will eliminate the need for a separate JVM (and main method). The other lines of code are used for mobile code which you only need if the interfaces aren't already available to the client.

    Jess

  2. #12
    Join Date
    Jun 2005
    Location
    Milan
    Posts
    32

    Default

    Quote Originally Posted by jbalint
    If you are using WebLogic, check out their RMI support http://www.weblogic.com/docs/classdocs/API_rmi.html. This will eliminate the need for a separate JVM (and main method). The other lines of code are used for mobile code which you only need if the interfaces aren't already available to the client.

    Jess
    Hi Jess, we will use BEA in integration environment, and production. For development purposes we choosed to use JBoss, much light
    So I dont want to use API specific for BEA in my code

    Salud

    Max

  3. #13
    Join Date
    Nov 2005
    Location
    Chicago
    Posts
    122

    Default

    You can use Spring to export your service. You can deploy into the JBoss/WebLogic server using a WAR and the ContextLoaderListener. Then, to export your RMI service, you will need something like this in your application context:

    Code:
      <!-- Service implementation implements the MyService interface -->
      <bean id="myService" class="xx.MyServiceImpl"/>
    
      <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="serviceName" value="MyService"/>
        <!-- Ref to service implementation -->
        <property name="service" ref="myService"/>
        <property name="serviceInterface" value="xx.MyService"/>
      </bean>
    This will export the service reference into the RMI registry under the name "MyService".

    Jess

  4. #14
    Join Date
    Jun 2005
    Location
    Milan
    Posts
    32

    Default

    Quote Originally Posted by jbalint
    You can use Spring to export your service. You can deploy into the JBoss/WebLogic server using a WAR and the ContextLoaderListener. Then, to export your RMI service, you will need something like this in your application context:

    Code:
      <!-- Service implementation implements the MyService interface -->
      <bean id="myService" class="xx.MyServiceImpl"/>
    
      <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
        <property name="serviceName" value="MyService"/>
        <!-- Ref to service implementation -->
        <property name="service" ref="myService"/>
        <property name="serviceInterface" value="xx.MyService"/>
      </bean>
    This will export the service reference into the RMI registry under the name "MyService".

    Jess
    sorry Jess, but I keep not understanding.
    I tell what I did up to now.

    One war deployed into JBoss into one machine. In this war I have my applicationContext with the client beans definition, and this one also:

    Code:
    <bean id="profilingService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    	<property name="serviceUrl">
    		<value>rmi://localhost:1099/ProfilingService</value>
    	</property>
    	<property name="serviceInterface">
    		<value>ProfilingService</value>
    	</property>
    </bean>

    In my JBoss ( or BEA ) that acts as server, deployed into another computer, I have one simple jar, with my services beans.
    I must put another applicationContext in this jar on the server?
    If yes I can define into it my serverside beans definition, and also this one:
    Code:
    <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    	<!-- does not necessarily have to be the same name as the bean to be exported -->
    	<property name="serviceName"><value>ProfilingService</value></property>
    	<property name="service"><ref bean="profilingManager"/></property>
    	<property name="serviceInterface"><value>web.profiling.services.ProfilingService</value></property>
    	<!-- defaults to 1099 -->
    	<property name="registryPort"><value>1099</value></property>
    </bean>
    I also put into the server jar a class with a main method, that, when executed, tells programmatically to Spring to load server side beans definition.
    Right?

    The problem is, How I tell to JBoss ( or BEA ) to execute that main class, being that I'm not in a war but into a simple jar???

    I hope to have well explained my situation.

    salud

    Max

  5. #15
    Join Date
    Nov 2005
    Location
    Chicago
    Posts
    122

    Default

    The main() method is not applicable when running inside the application server. You need to deploy a war or ear in the application server. In your web.xml in the war, you should use the ContextLoaderListener so it loads your application context and exports the RMI service.

    Jess

  6. #16
    Join Date
    Jun 2005
    Location
    Milan
    Posts
    32

    Default

    Quote Originally Posted by jbalint
    The main() method is not applicable when running inside the application server. You need to deploy a war or ear in the application server. In your web.xml in the war, you should use the ContextLoaderListener so it loads your application context and exports the RMI service.

    Jess
    Perfect
    Now I've got the solution.
    I deploy a war both into the server and the client

    Thanks a lot

    Salud

    Max

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •