This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of TensorFlow 2.0 in Action and have Thushan Ganegedara on-line!
See this thread for details.
Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

@EJB annotation from a remote client

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I have an EJB deployed in a JBoss server on a machine. I want to invoke another EJB deployed on a remote server. I want to use the @EJB annotation to inject the remote EJB reference. How do I specify the remote server url in this annotation? Or do I specify this in some xml file?

I got this paragraph from http://trailblazer.demo.jboss.com/EJB3Trail/serviceobjects/injection/


EJB 3.0 dependency injection only works in the local JNDI. Hence you cannot inject objects from remote servers.



Does this mean that I cannot use @EJB annotation from remote clients?

Thanks,
Devi
 
author
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know latest versions of JBoss does not support a concept of Application Client Container that allows you to use @EJB injection from a remote client.

See http://manning.com/panda/ for examples in Glassfish and OracleAS how they support DI in the client side. I had to change the code to use lookup for porting it to JBoss

regards
Debu
 
Sreedevi Vinod
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Debu,

Thanks for your response. I downloaded the code from your site, but could not find the code for locating remote beans from a servlet or EJB using @EJB annotation. Where do we specify the jndi properties in this case? Do we use a jndi.properties file like we do for standalone clients?

Thanks,
Devi
[ April 22, 2007: Message edited by: Sreedevi Vinod ]
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic