cancel
Showing results for 
Search instead for 
Did you mean: 

EJB - inbound and outbound proxy

Former Member
0 Kudos

I have implemented inbound and outbound proxy to transfer file. In proxyFTPClientREQIB method of ProxyFTPClientREQIB_PortTypeImpl class I want to invoke outbound proxy that sends structure to XI. I have a problem with context, because after invoking outbound proxy method from inbound proxy there is an incorrect context (concatenation of EJB inbound context and EJB outbound context: ejbContexts/bcc.com.pl/MonaApp/bcc.com.pl/MonaApp/ProxyFTPClientREQIB_PortTypeBean and localejbs/bcc.com.pl/MonaApp/ProxyFTPClientRESOB_PortTypeBean)

Context ctx = new InitialContext();

proxyFTPClientRESOB_PortTypeLocalHome = ProxyFTPClientRESOB_PortTypeLocalHome) ctx.lookup("localejbs/bcc.com.pl/MonaApp/ProxyFTPClientRESOB_PortTypeBean");

proxyFTPClientRESOB_PortTypeLocal = proxyFTPClientRESOB_PortTypeLocalHome.create();

Error:

Path to object does not exist at localejbs, the whole lookup name is ejbContexts/bcc.com.pl/MonaApp/bcc.com.pl/MonaApp/ProxyFTPClientREQIB_PortTypeBean/localejbs/bcc.com.pl/MonaApp/ProxyFTPClientRESOB_PortTypeBean.

What should I do to avoid concatenation of contexts?

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

Hi Julia,

the correct call is:

... ctx.lookup("java:comp/env/ejb/ProxyFTPClientRESOB_PortTypeBean");

The Reference to the JNDI name is done in the ejb-jar.xml:

<ejb-local-ref>
  <ejb-ref-name>ejb/ProxyFTPClientRESOB_PortTypeBean</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <local-home>YourLocalHomeInterface</local-home>
  <local>YourLocalInterface</local>
  <ejb-link>ProxyFTPClientRESOB_PortTypeBean</ejb-link>
  </ejb-local-ref>

Hope that helps,

Stefan