Spring Framework
  1. Spring Framework
  2. SPR-4319

Local Websphere EJB lookup fails in 2.5.1 and worked in 2.5.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.5.2
    • Component/s: EJB
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      In Spring 2.5.0, we had a local EJB being looked up with this spring definition:

      <jee:local-slsb jndi-name="ejb/WebCacheManager" business-interface="com.bc.dctm.webcache.ejb.WebCacheManagerLocal"
      lookup-home-on-startup="true" id="webcacheManagerEP" resource-ref="true"/>

      In spring 2.5.1, it appears that Spring is referencing the wrong class on the EJB to make method calls. The exception is:

      java.lang.NoSuchMethodException: com.bc.dctm.webcache.ejb.EJSLocalStatelessWebCacheManagerHome_940a93c6.query(java.lang.String, java.lang.String, java.util.List, java.lang.String)
      [1/10/08 19:48:08:505 GMT] 42193c4c SystemErr R at java.lang.Class.getMethod(Class.java(Compiled Code))
      [1/10/08 19:48:08:505 GMT] 42193c4c SystemErr R at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invoke(LocalSlsbInvokerInterceptor.java:73)
      [1/10/08 19:48:08:505 GMT] 42193c4c SystemErr R at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      [1/10/08 19:48:08:505 GMT] 42193c4c SystemErr R at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      [1/10/08 19:48:08:506 GMT] 42193c4c SystemErr R at $Proxy1.query(Unknown Source)
      [1/10/08 19:48:08:506 GMT] 42193c4c SystemErr R at com.roche.cwp.tool.expertpanel.dao.documentum.ExpertPanelContentDAODocumentum.retrieveContent(ExpertPanelContentDAODocumentum.java:174)

      The call being made is:
      wcoList = getWebcacheManager().query(webcacheInstance, query, values, sortBy);

      However, if looking in the generated EJB class EJSLocalStatelessWebCacheManagerHome_940a93c6 referenced above, there are only two methods: create and remove. It seems odd that Spring is looking at this WebCacheManagerHome class when it should be looking at this other generated class: EJSLocalStatelessWebCacheManager_940a93c6 which has our query method in it.

      The interface we reference com.bc.dctm.webcache.ejb.WebCacheManagerLocal is correct and it's the local business interface. We have also tried writing our EJB spring element like:

      <bean id="webcacheManagerEP"
      class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
      <property name="jndiName" value="ejb/WebCacheManager"/>
      <property name="businessInterface" value="com.bc.dctm.webcache.ejb.WebCacheManagerLocal"/>
      <property name="jndiEnvironment">
      <props>
      <prop key="javax.naming.factory.initial">com.ibm.websphere.naming.WsnInitialContextFactory</prop>
      <prop key="javax.naming.provider.url">iiop://localhost:2809</prop>
      </props>
      </property>
      <property name="resourceRef" value="true"/>
      <property name="cacheHome" value="false"/>

      </bean>

      but we receive the same issue.

        Activity

        Hide
        Grant Gochnauer added a comment -

        To be absolutely sure it is a Spring issue, I rolled back to spring 2.5.0 and it's now working.

        On a side note, I also upgraded aspectweaver from 1.5.3 to 1.5.4 during this same upgrade process. I'm not sure if that might have an effect.

        Show
        Grant Gochnauer added a comment - To be absolutely sure it is a Spring issue, I rolled back to spring 2.5.0 and it's now working. On a side note, I also upgraded aspectweaver from 1.5.3 to 1.5.4 during this same upgrade process. I'm not sure if that might have an effect.
        Hide
        Grant Gochnauer added a comment -

        Aspectweaver version had no effect.

        Just by replacing spring-2.5.0.jar with spring-2.5.1.jar will produce the issue.

        Show
        Grant Gochnauer added a comment - Aspectweaver version had no effect. Just by replacing spring-2.5.0.jar with spring-2.5.1.jar will produce the issue.
        Hide
        Juergen Hoeller added a comment -

        This is probably caused by WebSphere's EJB home objects somehow implementing EJBLocalObject as well... although the latter is really only supposed to be implemented by exposed EJB references, not by home objects.

        Spring 2.5.1 uses EJBLocalObject for detecting EJB 2.x beans over EJB 3 style beans. I've changed this to a !EJBLocalHome check for Spring 2.5.2, which should work correctly on WebSphere as well.

        This will be available in the next Spring 2.5.2 snapshot (http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR). Please give it a try and let me know whether it works for you (again)!

        Juergen

        Show
        Juergen Hoeller added a comment - This is probably caused by WebSphere's EJB home objects somehow implementing EJBLocalObject as well... although the latter is really only supposed to be implemented by exposed EJB references, not by home objects. Spring 2.5.1 uses EJBLocalObject for detecting EJB 2.x beans over EJB 3 style beans. I've changed this to a !EJBLocalHome check for Spring 2.5.2, which should work correctly on WebSphere as well. This will be available in the next Spring 2.5.2 snapshot ( http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR ). Please give it a try and let me know whether it works for you (again)! Juergen
        Hide
        Grant Gochnauer added a comment -

        Thanks Juergen. I will give it a try in the next day or two.

        Show
        Grant Gochnauer added a comment - Thanks Juergen. I will give it a try in the next day or two.
        Hide
        Juergen Hoeller added a comment -

        Grant, have you already had a chance to verify whether this fix works for you? FYI, the 2.5.2 GA is now scheduled for Monday 25th.

        Juergen

        Show
        Juergen Hoeller added a comment - Grant, have you already had a chance to verify whether this fix works for you? FYI, the 2.5.2 GA is now scheduled for Monday 25th. Juergen
        Hide
        Grant Gochnauer added a comment -

        Just gave it a try and it's working great. Thanks Juergen!

        Show
        Grant Gochnauer added a comment - Just gave it a try and it's working great. Thanks Juergen!

          People

          • Assignee:
            Juergen Hoeller
            Reporter:
            Grant Gochnauer
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              6 years, 9 weeks, 2 days ago