• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Calling class in a web module from EJB

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I need to modify and exisitng application which runs on a websphere.As per the new requirement i need to call a class in webmodule from EJB.Is it a correct to call a class from EJB jar.Also there's a possibility that this appplication can be deployed in a clustered environment.I learnt from sites that shared library option is there.if thats the solution then i need to state the reason why i need to move the class to share library.I would be greatful if someone could tell me the drawbacks of calling class in a webmodule from EJB.
 
author & internet detective
Posts: 42055
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Praveen,
Typically the web layer calls the ejb layer. Doing the opposite would introduce a circular dependency.

This is a common sign that you really have three units: the common code, the web module and the ejb module. If you refactor the common code into it's own module/jar, you can have the real web module (servlets, etc) and ejb module call it without a circular dependency.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want your ejb to call the class in a webmodule,move those classes in the APP-INF directory of the application ,so that both your ejb module and your webmodule can able to access it now.
 
Jeanne Boyarsky
author & internet detective
Posts: 42055
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by magesh sripathy:
If you want your ejb to call the class in a webmodule,move those classes in the APP-INF directory of the application ,so that both your ejb module and your webmodule can able to access it now.


Is APP-INF a standard? I've seen it in WebLogic, but not JBoss or WebSphere. In other apps, I've just seen the jar files in the root of the EAR (or a lib directory under it.)
 
praveen kanakarajan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved it somehow.but i dont know whether its the correct method.I loaded both war and ejb jar with same class loader which websphere provides and then it was working.I would like to know the drawbacks of doing the said method.
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic