Forum Stats

  • 3,874,239 Users
  • 2,266,700 Discussions
  • 7,911,777 Comments

Discussions

Expose a local interface of an ejb on WebLogic server

I'm trying to deploy an application on Oracle Java Cloud Service. I created a stateless ejb (3.0):

<span class="lit">@Stateless</span><span class="pun">(</span><span class="pln">name </span><span class="pun">=</span><span class="pln"> </span><span class="str">"PTOnlineSessionEJB"</span><span class="pun">,</span><span class="pln"> mappedName </span><span class="pun">=</span><span class="pln"> </span><span class="str">"ejb/PtOnlineBean"</span><span class="pun">)</span><span class="pln"> </span><span class="lit">@Local</span><span class="pun">(</span><span class="typ">PTOnlineSessionEJBLocal</span><span class="pun">.</span><span class="kwd">class</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">PTOnlineSessionEJBBean</span><span class="pln"> </span><span class="kwd">implements</span><span class="pln"> </span><span class="typ">PTOnlineSessionEJBLocal</span><span class="pln"> </span><span class="pun">{</span>

with a local interface:

<span class="lit">@Local</span><span class="pln"> </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">interface</span><span class="pln"> </span><span class="typ">PTOnlineSessionEJBLocal</span><span class="pln"> </span><span class="pun">{</span>

then I try to access to the ejb:

<span class="lit">@WebService</span><span class="pun">(</span><span class="pln">serviceName </span><span class="pun">=</span><span class="pln"> </span><span class="str">"PTOnlineService"</span><span class="pun">,</span><span class="pln"> portName </span><span class="pun">=</span><span class="pln"> </span><span class="str">"PTOnlineServiceSoap12HttpPort"</span><span class="pun">)</span><span class="pln"> </span><span class="lit">@BindingType</span><span class="pun">(</span><span class="typ">SOAPBinding</span><span class="pun">.</span><span class="pln">SOAP12HTTP_BINDING</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">PTOnlineService</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="lit">@EJB</span><span class="pun">(</span><span class="pln">name </span><span class="pun">=</span><span class="pln"> </span><span class="str">"ejb/PtOnlineBean"</span><span class="pun">)</span><span class="pln"> </span><span class="typ">PTOnlineSessionEJBLocal</span><span class="pln"> </span><span class="typ">PtOnlineBean</span><span class="pun">;</span>

When I try to deploy on cloud server I get this error:

<span class="typ">Caused</span><span class="pln"> by</span><span class="pun">:</span><span class="pln"> weblogic</span><span class="pun">.</span><span class="pln">deployment</span><span class="pun">.</span><span class="typ">EnvironmentException</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln">J2EE</span><span class="pun">:</span><span class="lit">160200</span><span class="pun">]</span><span class="typ">Error</span><span class="pln"> resolving ejb</span><span class="pun">-</span><span class="pln">ref </span><span class="str">'ejb****'</span><span class="pln"> from module </span><span class="str">'PTOnlinev6-ViewController-context-root'</span><span class="pln"> of application </span><span class="str">'PTOnline'</span><span class="pun">.</span><span class="pln"> </span><span class="typ">The</span><span class="pln"> ejb</span><span class="pun">-</span><span class="pln">ref does not have an ejb</span><span class="pun">-</span><span class="pln">link and the JNDI name of the target bean has not been specified</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Attempts</span><span class="pln"> to automatically link the ejb</span><span class="pun">-</span><span class="pln">ref to its target bean failed because no </span><span class="typ">EJBs</span><span class="pln"> in the application were found to implement the </span><span class="str">'it.enigen.pt.online.ejb.PTOnlineSessionEJBLocal'</span><span class="pln"> </span><span class="kwd">interface</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Please</span><span class="pln"> link or map </span><span class="kwd">this</span><span class="pln"> ejb</span><span class="pun">-</span><span class="pln">ref to its target EJB and ensure the interfaces declared in the ejb</span><span class="pun">-</span><span class="pln">ref are correct</span><span class="pun">.</span>

How can I expose and use an ejb with local interface on weblogic?

Thank you.

Tagged:
This discussion has been closed.