Announcement Announcement Module
Collapse
No announcement yet.
RemoteLookupFailureException strange, please look Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RemoteLookupFailureException strange, please look

    hy all ,
    First of all I am trying to get this work for few days, but no luck. .
    I am using jboss+spring, but I don't have experience with those.
    I have an ear with one ejb and one war which uses the ejb.


    I have in ejb-jar archive, one stateless ejb. From war (build with spring), I am trying to use the ejb method.

    I put in my application spring context:
    <bean id="myComponent" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiName"
    value="/brainstorm/BookTestBean/remote" />
    <property name="businessInterface"
    value="de.laliluna.library.BookTestBeanInterface" />
    </bean>
    <bean name="/pages/hello.do"
    class="ro.storming.controllers.HelloController">
    <property name="bookTestBean" ref="myComponent" />
    </bean>

    My Controller:
    public class HelloController extends AbstractController {

    @Autowired
    BookTestBeanInterface bookTestBean;

    public void setBookTestBean(BookTestBeanInterface bookTestBean) {
    this.bookTestBean = bookTestBean;
    }

    protected ModelAndView handleRequestInternal(HttpServletRequest arg0,
    HttpServletResponse arg1) throws Exception {
    bookTestBean.test();
    }


    But no luck , It throws :org.springframework.remoting.RemoteLookupFailureE xception: EJB instance [org.jnp.interfaces.NamingContext@7af728] is not a Remote Stateless Session Bean




    . I also tried same with local interface.


    The weird fact for me is that is that I if I use the InitialContext in controller I !can! call the ejb method:

    context = new javax.naming.InitialContext();

    BookTestBeanInterface beanRemote = (BookTestBeanInterface) context .lookup("/brainstorm/BookTestBean/remote");

    beanRemote.test();

    BookTestBeanRemote and BookTestBeanLocal is extended from BookTestBeanInterface .

    The jboss jndi looks like:
    Global JNDI Namespace
    ...
    +- brainstorm (class: org.jnp.interfaces.NamingContext)
    | +- BookTestBean (class: org.jnp.interfaces.NamingContext)
    | | +- local (proxy: $Proxy74 implements interface de.laliluna.library.BookTestBeanLocal,interface org.jboss.ejb3.JBossProxy)
    | | +- remote (proxy: $Proxy72 implements interface de.laliluna.library.BookTestBeanRemote,interface org.jboss.ejb3.JBossProxy)

    Thank you in advance.
    up.
    Last edited by remus; Apr 22nd, 2008, 04:33 AM.

  • #2
    Same with Glassfish V2

    Also refers to:
    http://forum.springframework.org/showthread.php?t=50000

    That post said EJB3 only supported as of 2.5.1, but I'm using 2.5.4.

    Same problem with Glassfish v2 ur1:
    org.springframework.remoting.RemoteLookupFailureEx ception: EJB instance [com.company.mein._MyClassRemote_Wrapper@b02589d8] is not a Remote Stateless Session Bean

    tried local but "is not a local SLSB", either.

    What _does_work:
    * InitialContext().lookup("...")
    * EJB3 DI on the same class
    * JndiObjectFactoryBean

    remus - have you tried that? You're using >=2.5.1, right? Here's the config snip which worked for me.

    <bean id="" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="/brainstorm/BookTestBean/remote" />
    </bean>

    Others - will there be a performance impact for using a stateless sb like so (perhaps extra jndi lookups)? Moreover, what do you gain by using the SimpleRemoteStatelessSessionProxyFactoryBean over the JndiObjectFactoryBean?

    Comment


    • #3
      I'm using Spring 2.5.3 and I have the exact same problem when using Spring and EJB3 on JBoss 4.2.2.
      When I do a lookup using :
      Code:
      <jee:remote-slsb id="RemoteWiringExampleFacadeEJB" jndi-name="EAR-BUSINESSLAYER/WiringExampleFacade/remote" business-interface="com.acme.biz.api.WiringExample" resource-ref="true">
      <jee:environment>
          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=jnp://localhost:1099
      </jee:environment>
      </jee:remote-slsb>
      I get this error :

      org.springframework.remoting.RemoteLookupFailureEx ception: EJB instance [jboss.j2ee:ear=EAR-BUSINESSLAYER.ear,jar=EJB-BUSINESSLAYER.jar,name=WiringExampleFacade,service =EJB3] is not a Remote Stateless Session Bean
      Last edited by sonicfab; May 9th, 2008, 11:24 AM.

      Comment

      Working...
      X