| Author |
Need help in calling a EJB from a WAR file
|
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
I have a ejb called :TradeBean.java Remote interface is called :Trade.java Home is called TradeHome.java im my ejb-jar.xml I have : <ejb-jar> <enterprise-beans> <session> <ejb-name>TradeObject</ejb-name> <home>brokearage.broker.co.sessionBean.stateless.trades.TradesHome</home> <remote>brokearage.broker.co.sessionBean.stateless.trades.Trades</remote> <ejb-class>brokearage.broker.co.sessionBean.stateless.trades.TradesBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> </enterprise-beans> </ejb-jar> In my weblogic-ejb-jar.xml I have <weblogic-ejb-jar> <weblogic-enterprise-bean> <ejb-name>TradeObject</ejb-name> <jndi-name>TradeObject</jndi-name> </weblogic-enterprise-bean> </weblogic-ejb-jar> The EJB is deployed in a jar called BrokerEJB. in the War file web.xml I have the following <ejb-ref> <ejb-ref-name>ejb/TradeObject</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>mbrokearage.broker.co.sessionBean.stateless.trades.TradesHome</home> <remote>brokearage.broker.co.sessionBean.stateless.trades.Trades</remote> </ejb-ref> and in my weblogic.xml I have the following: <ejb-ref-description> <ejb-ref-name>TradeObject</ejb-ref-name> <jndi-name>BrokerEJB/TradeObject</jndi-name> </ejb-ref-description> When I try to deploy the war file I get the following error: ejb-ref ejb/TradeObject requires an ejb-link or jndi-name. The problem is that I have got very confused about what goes in the deployment xml files. does the ejb-ref-name in web.xml and weblogic.xml match the ejb-name in ejb-jar.xml and weblogic-ejb-jar.xml
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8145
|
|
In your web.xml addd the ejb-link tag as follows:
|
[My Blog] [JavaRanch Journal]
|
 |
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
Thanks it deployed cheers for that. Tony
|
 |
 |
|
|
subject: Need help in calling a EJB from a WAR file
|
|
|