Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring + Jboss. Starting RMI Registry

 
Ricardo Corredor
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a question about a J2EE App which uses the Spring Framework. It's a Web application deployed in a JBoss 4.0.5GA app server. I need to expose the services that provide the application to use these in a simple java standalone program. Off course, I use Spring to expose my interface and to access via RMI in the main method of my program. In resume, I'm following this instructions: http://www.stehno.com/articles/java/springrmijndi.php.

The problem is that the RMI Registry only initiate when I run the Web application in a browser. It creates something like this:

INFO [RmiRegistryFactoryBean] Looking for RMI registry at port '1099'
WARN [RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'rmi.service.MyRemote'
INFO [RmiServiceExporter] Binding RMI service 'myRemote' to registry at port '1099'

After running the web application, I could use my java standalone program because the RMI is activated as well. But... How can avoid this process and just when I run my Java App, it starts thw RMI Registry ???


Thanks !!!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to use Spring Remoting, on the server side, all you need is to declare an Exporter. On the client side you will use a Factory for RMI.

Here are the docs on it

http://static.springframework.org/spring/docs/2.5.x/reference/remoting.html#remoting-rmi

Mark
 
Ricardo Corredor
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark


But I don't understand how can I use the services exposed in the JBoss Server. In my Java app what must I do in the main method to use them.
It's not clear for me :S ...
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, JBoss is just for those enterprise services. The RMI for stand-alone would just be RMI, regardless of inside JBoss or not.

Maybe I am confused at what you are trying to do. But where the server-side stuff is deployed on should make no difference.

Mark
 
Tristan Roo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peut-être qu'il faut ajouter lazy-init="false" à l'exporter pour qu'il soit chargé au déploiement ?

Ou bien configurer META-INF\application.xml...
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Tristan . Please use only English in the forums, looks like French
 
Tristan Roo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I didn't notice I wrote in french...

My message was : maybe a lazy-init="false" would do the trick ? or something in META-INF\application.xml

Though, after a few hours of research, I've found the solution :

Deploying a Spring ApplicationContext as a J2EE RAR file
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic