Announcement Announcement Module
Collapse
No announcement yet.
lookup local slsb failes on glassfish Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • lookup local slsb failes on glassfish

    hi there,

    i try to to use a Local EJB3 StatelessBean within my Spring-POJO.



    Code:
    @Local(MyLocal.class)
    @Stateless(name="MyBean", mappedName="MyBean")
    public class MyBean implements MyLocal{...}
    i know that glassfish does not map local ejbs to global jndi-tree.
    but anyway, the bean needs a name where it could be found under java:comp/env

    applicationContext.xml:

    Code:
    <jee:local-slsb id="myBean" jndi-name="MyBean"
    		business-interface="org.test.MyLocal" resource-ref="true" />

    resulting in an:
    javax.naming.NameNotFoundException: MyBean not found

    when i try to inject the 'myBean' into a Spring-Bean.

    Code:
    <jee:local-slsb id="myBean" jndi-name="java:comp/env/MyBean"
    		business-interface="org.test.MyLocal" resource-ref="true" />
    works neither.

    the whole project contains only an EJB-Module, which contains the EJB3-Beans and the Spring-Pojos together with all configuration-files.

    the ejb-module is packaged into an EAR(only containing the EJB-module) and deployed on glassfish v2.1

    I read th glassfish-faqs about how to lookup a local-ejb from a pojo.
    but these examples assume that i call the Pojo itself from an EJB, which i dont do.


    anyway, isnt there a way to lookup a local EJB?


    thanks in advance.
    tim

  • #2
    nobody ever solved this problem?

    Comment


    • #3
      Hi,
      try to replace - just for test - @Local annotation with @Remote.
      Regards,
      Milan

      Comment


      • #4
        yes, this works as expected. using @Remote and <jee:remote-slsb ...> and mapped-jndi-nbame of the remote-slsb. i knew it work fine with glassfish.


        but this is not want i want. i need to local-slsb lookedup in glassfish.

        Comment


        • #5
          Hi,
          where do you initialize your spring context ? Is it in a web module ?
          If yes, than you have to make a local slsb visible through configuration entry in web.xml:

          <ejb-local-ref>
          <ejb-ref-name>MyBean</ejb-ref-name>
          <local>org.test.MyLocal</local>
          <ejb-link>MyBean</ejb-link>
          </ejb-local-ref>

          It makes SLSB lookupable also in spring context:
          <jee:local-slsb id="myBean" jndi-name="java:comp/env/MyBean" business-interface="org.test.MyLocal"></jee:local-slsb>

          regards,
          Milan
          Last edited by xminoxde; May 19th, 2009, 03:49 AM.

          Comment


          • #6
            no web-module. only an ejb-module. if i use a "dummy"-webmodule and deploy as an ear together with the ejb-module, is the local-ejb specified in the dummy-web.xml visible(through jndi?) in my ejb-module and spring-pojos??

            Comment

            Working...
            X