
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