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.
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.
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.)
Joined: Apr 27, 2005
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.