Frage

Since:

  • the @EJB doesn't work on desktop apps, because there's no container,
  • Weblogic doesn't expose through JNDI the names of the EJB's (3.0),
  • I didn't find anything about it in the official documentation for a few days now,

does anyone know how I could consume an EJB from a desktop app?

I got hints that i have to modify web.xml... but then what web.xml, there's more of them and at least some of them break my app.

Clarification: I have a WebLogic server running, NOT exposing some EJB's inside an EAR hosted on that server. Specifically, the server is not exposing the names of EJB3.0 Session beans, while it DOES expose the names of some other EJB2.1 names. How do i get a reference to the EJB3.0 objects, hosted on my server, from my desktop app?

FURTHER Clarification: Weblogic Specifically does not expose the names of EJB3.0 within the JNDI, because the specifications of EJB3.0 don't require it.

War es hilfreich?

Lösung

To answer my own question (got it after some effort), to expose an EJB3.0 object through a remote interface, in the Weblogic 11g server, these steps must be taken:

This is what my ejb-jar.xml says about the bean RolyBean:

<enterprise-beans>       
    <session id="Session_Roly">
      <display-name>Roly</display-name>
      <ejb-name>Roly</ejb-name>
      <remote>com.medicon.server.RolyRemote</remote>
      <ejb-class>com.medicon.server.RolyBean</ejb-class>
      <session-type>Stateless</session-type>
    </session>
  </enterprise-beans>

This is what the weblogic-ejb-jar.xml (in the same dir) says:

<wls:weblogic-enterprise-bean>
    <wls:ejb-name>Roly</wls:ejb-name>
<wls:jndi-name>Roly</wls:jndi-name>
</wls:weblogic-enterprise-bean>

These 2 deployment descriptors seem to be the only 2 places where it's required to specify exposure of the EJB through JNDI.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top