• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI service available through JNDI

 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering if there was a way in WAS 4.0 I could write an RMI service or some service running in its own process, and register it with JNDI so it could be accessible. Basically, I need something functionally equivalent to the Weblogic startup services. Is there anything like this in WAS 4.0?
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you can register a JRMP object in JNDI in WAS 4.0 (in fact, anythign serializable can be put in JNDI in WAS 4.0). I'm not familiar with the weblogic classes you're referring to. What exactly do you want to do? There's probably some other way of doing it that I could suggest...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A weblogic startup class has a startup method that is called when the server starts ( http://e-docs.bea.com/wls/docs61/javadocs/weblogic/common/T3StartupDef.html ). WAS 4.0 offers Custom services that seem to perform a similar function but the WAS documentation states that you cannot access JNDI from the methods of the custom service. The type of things I used the weblogic startups for, e.g. were proxies to call native services. But I needed to bind them to the JNDI tree so that clients could look them up.
[This message has been edited by Jim Baiter (edited October 25, 2001).]
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if that's all you want to do why can't you make your wrapper services stateless session beans? Now if it's because you believe that you can't use JNI inside an EJB -- well, that's not entirely true. A class that uses JNI can be called by an EJB, but an EJB itself can't have native methods.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, but if I'm loading native libraries in some native process then if one of these native processes has an exception (e.g. core dumps in unix), then the vm with the container will also crash. Even if the JNI is not inside of the bean it will still be running in the same VM. Also, the EJB spec brings up some security issues with this approach as well in chpt. 24.
[This message has been edited by Jim Baiter (edited October 25, 2001).]
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, that's true. Your VM will crash if the JNI code crashes, I'll grant you that. However, you could deploy your EJB's that indirectly call the JNI in a separate application server from other code (you can run > 1 application server on a node).
But anyway, that's probably a dead horse. I think you've misread the Custom Services documentation it says that in the custom services you can't invoke JNDI but that's in the context of this application server. If your Custom Service code starts another process, then that other process should be able to access JNDI like normal. The key here is that the JNDI server itself runs in one of two places
(a) in 4.0 AE the JNDI Server runs in the admin process, which is outside of any Application server
(b) in 4.0 AEs the JNDI Server run in the context of the application server process.
What it comes down do is making sure that JNDI is up before you register your RMI server. That can be as simple as a busy loop in your RMI process. If it fails to obtain an initial context, wait a few seconds, then try again.
BTW, one more change -- I think I misspoke when I said you can registre JRMP objects -- you really do have to use RMI over IIOP -- but that's just using the -IIOP parameter on the rmic.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I see, thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic