This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Spring + Jboss. Starting RMI Registry

 
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 !!!
 
ranger
Posts: 17344
11
Mac IntelliJ IDE 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
Posts: 17344
11
Mac IntelliJ IDE 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
 
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...
 
Bartender
Posts: 4101
64
Hibernate Fedora Chrome
  • 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
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!