• 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

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: 41860
908
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: 41860
908
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic