How to use <ejb-local-ref> in a separate WAR when EJB jar is deployed separately

Solution Verified - Updated -

Issue

  • Deployed an EAR application which contains EJB Jar and looking to refer to the EJB from separately deployed WAR which is deployed on the same JBoss EAP instance. We need a mechanism so that the WAR can access the classes available in the EJB Jars.
    Following is the "WEB-INF/web.xml" contents
<web-app>
 <ejb-local-ref>              
    <ejb-ref-name>ejb3/SomeService/local</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>ejb3.CalculatorLocal</local>               
 </ejb-local-ref>
</web-app>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.