• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Need help in calling a EJB from a WAR file

 
Ranch Hand
Posts: 646
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your web.xml addd the ejb-link tag as follows:

 
Tony Evans
Ranch Hand
Posts: 646
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks it deployed cheers for that.

Tony
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic