• 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

How to access a Bean in From Separate EAR.

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hello every one.

I am using WSAD 5.1.2 and EJB 2.1

I have a LoginSession session bean in

Shopping
ShoppingClient
ShoppingEAR

i want to access the session bean in my struts project.

WebWork
WebWorkEAR

How can I access the LoginSession bean in the ShoppingEAR from the Web Project?


I have done the same thing before but, before my LogginSession Bean was in the WebWorkEar.



Any Help will be of great help.


Thanks for your time.
Have a nice time.
 
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to look up the bean's remote home interface and then call create() to create an instance of the bean.
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

you need to have the EJB client classes(remote and homeRemote) on the client side, in your case the webapp that needs to use the EJB.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
What Marcos, said above is exactly what you have to do. And you have to write your client code in your struts login Action class. Thats how you'd do a look up from the struts application.
[ October 27, 2006: Message edited by: Mehul Mistry ]
 
Tina Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Means the only thing we need is client.jar file, when we deploy a bean.

I would like to thank each one of you for taking time, I was able to solve the problem, from your hints.

Thanks,
Have a nice day and weekend.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before you put it directly in your Action class, you should look at some best practices, which include using the ServiceLocator pattern to get access to your Beans, instead of tying(tightly coupling) EJB directly in your Struts code.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic