Announcement Announcement Module
No announcement yet.
Issues when looking up a EJB3 Bean using SimpleRemoteStatelessSessionProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues when looking up a EJB3 Bean using SimpleRemoteStatelessSessionProxyFactoryBean


    I have deployed a EJB3 Bean(No Remote Home interface) in WAS 6.1 (has EJB 3.1 Feature pack installed).

    Following are my bean details :

    Remote Interface:

    public interface MyRemoteInterface {

    public void sayHello();


    EJB Bean

    * Bean implementation class for Enterprise Bean: MyRemoteInterface
    public class MyBean
    extends AbstractBaseSessionBean implements MyRemoteInterface {

    protected void onEjbCreate() throws CreateException {

    public void sayHello(){

    System.out.println("Calling sayHello ");



    This EJB bean is associated with the JNDI(bound to remote JNDI space) name called "ejb/MyBean".

    In my standalone Junit testcase's applicationContext.xml file, I have the following bean defined to look up the above remote stateless bean,

    <bean name="myProxyEJBBean" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
    <property name="jndiName" value="ejb/MyBean"/>
    <property name="businessInterface" value="MyRemoteInterface"/>
    <property name="jndiEnvironment">
    <prop key="java.naming.factory.initial"> e.naming.WsnInitialContextFactory</prop>
    <prop key="java.naming.provider.url">iiop://localhost:2812/</prop>

    Stubs for the same EJB classes are generated and set in my client application's(Junit) classpath.

    when i try to access "myProxyEJBBean" bean, i get the following exception:

    org.springframework.remoting.RemoteLookupFailureEx ception: EJB instance [IOR:00bdbdbd000000465726961642e7063746d732e6100000 0250000000400bd0003] is not a Remote Stateless Session Bean
    at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.newSessionBeanInstance(AbstractR
    at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.getSessionBeanInstance(SimpleRemot
    at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.doInvoke(SimpleRemoteSlsbInvokerIn
    at org.springframework.ejb.access.AbstractRemoteSlsbI nvokerInterceptor.invoke(AbstractRemoteSlsbInvoker
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(

    But i am able to lookup the same remote EJB bean and invoke methods using InitialContext lookup,

    try {
    ctx = new InitialContext(properties);
    java.lang.Object object = ctx.lookup("MyBean");
    MyRemoteInterface remoteReference = (MyRemoteInterface)object;
    } catch (Exception e) {

    Am i missing anything while defining "SimpleRemoteStatelessSessionProxyFactoryBean" ? or is anyother way to lookup remote stateless session EJB bean in spring framework?.

    Any help would be greatly appreciated.

    Thanks in advance
    Last edited by salamsoft; Feb 18th, 2008, 09:54 PM.

  • #2
    An alternative would be using JndiObjectFactoryBean. Though, the support for EJB3 access via SimpleRemoteStatelessSessionProxyFactoryBean (which has been developed for EJB 2.x) has just been added in a recent version of Spring.
    So if you are not using a recent version of Spring, an upgrade would help.

    Edit: It has been included in version 2.5.1



    • #3
      That's thread 50000!



      • #4
        Reported not working in 2.5.4:


        • #5
          Not working in 2.5.3 either (see my reply in same thread


          • #6
            I guess I found the problem and opened a Jira issue (

            As a workaround use <jee:jndi-lookup> which works without problem.



            • #7
              The problem is fixed in the current 2.5.5 nightly snapshot. It seems that the issue showed up in only some EJB3 containers.


              • #8
                Issues when looking up in EJB3 bean

                Hi Andreas, I faced the same problem with Spring2.5.5 ! I used the latest Spring 2.5.5 nightly build. I have EJB3.0 hosted in JBoss4.2.2GA. What can be the issue?
                EJB instance [jboss.j2ee:ear=sample.ear,
                jar=Sample.jar,name=createTest,service=EJB3] is not a Remote Stateless Session Bean ?

                Thanks in advance ,


                • #9
                  Actually, I verified the fix with JBoss 4.2.2GA (with added EJB3 support, installed by JEMS 1.2.1CR4) using the Spring 2.5.5 snapshot from 2008-05-13.

                  Based on the code changes made the issue should be fixed. Maybe you could also try debugging into AbstractRemoteSlsbInvokerInterceptor class and see what happens.



                  • #10
                    Hey Andreas, managed to solve the problem using <jee-jndi lookup> tag instead. Upgraded to Spring 2.5.5 as well. Thanks !


                    • #11
                      I have the same problem, spring2.5.2, jee:remote-slsbs or SimpleRemoteStatelessSessionProxyFactoryBean => same result. I will try with Spring2.5.5. (I use glassfish)


                      • #12
                        Ok for me too by using the last spring version and jee:* tags