aspose file tools*
The moose likes Other Application Frameworks and the fly likes Spring + Jboss. Starting RMI Registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring + Jboss. Starting RMI Registry" Watch "Spring + Jboss. Starting RMI Registry" New topic
Author

Spring + Jboss. Starting RMI Registry

Ricardo Corredor
Greenhorn

Joined: Nov 06, 2008
Posts: 2
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ricardo Corredor
Greenhorn

Joined: Nov 06, 2008
Posts: 2
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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

Joined: Aug 07, 2010
Posts: 2
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

Joined: Mar 24, 2008
Posts: 3829

Welcome to JavaRanch, Tristan . Please use only English in the forums, looks like French


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Tristan Roo
Greenhorn

Joined: Aug 07, 2010
Posts: 2
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring + Jboss. Starting RMI Registry