Announcement Announcement Module
Collapse
No announcement yet.
RemoteHomeProxy - NoSuchMethodException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RemoteHomeProxy - NoSuchMethodException

    I have a POJO service which use a local stateless session bean. When calling a business method on this service, I get NoSuchMethodException from the proxy.
    Code:
    java.lang.NoSuchMethodException:ApplicEJB_RemoteHomeProxy_118nol5.getFOO()
    ...
    	at java.lang.Class.getMethod(Unknown Source)
    	at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invokeInContext(LocalSlsbInvokerInterceptor.java:74)
    	at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:188)
    Why is the proxy a RemoteHome?

    I have tried both ways of declaring this stuff in pure desperation (see below), but to no avail. Anyone who can tell me what is going on?

    Code:
     
        <bean id="applicEjb"
              class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
            <property name="jndiName" value="ApplicEJB"/>
            <property name="businessInterface" value="com.xyz.ApplicBusiness"/>
        </bean>
    
        <jee:local-slsb id="applicEjb" jndi-name="ApplicEJB"
                        business-interface="com.xyz.ApplicBusiness"/>
     
        <bean id="applicBean" class="com.xyz.ApplicabilityServiceImpl">
            <property name="applicabilityBean" ref="applicEjb"/>
        </bean>
    Regards,
    M
    Last edited by motorhead; Feb 15th, 2009, 03:43 PM. Reason: Solved

  • #2
    Problem solved

    Well, since beeing a n00b on old-school stuff such as EJB2 I had forgot to add the local-refs in web.xml Adding the correct configuration solved my problem and I am now one more experience richer. I would have been a great help if the documentation regarding EJB integration would have mentioned this, not that it is Interface21's responsibility though.

    Next move must be to remove all EJB stuff before I loose anymore sleep.

    Comment


    • #3
      Problem solved (contd.)

      Using a declaration like this
      Code:
          <bean id="applicEjb"
                class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
              <property name="jndiName" value="ApplicEJB"/>
              <property name="businessInterface" value="com.xyz.ApplicBusiness"/>
          </bean>
      Without having local-refs in the web.xml results in a RemoteHomeProxy. This proxy has different signatures (i.e. with additional RemoteException) since it uses the remote interface of the EJB in question during proxy creation. This was the reason that I got (note the 'ApplicEJB_RemoteHomeProxy')...
      Code:
      java.lang.NoSuchMethodException:ApplicEJB_RemoteHomeProxy_118nol5.getFOO()
      ...
      	at java.lang.Class.getMethod(Unknown Source)
      	at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invokeInContext(LocalSlsbInvokerInterceptor.java:74)
      	at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:188)
      So to clarify my point regarding documentation above, it would have been really helpful if I knew that the LocalStatelessSessionProxyFactoryBean would create a remote proxy, instead of a local, given that no local-refs were detected. An exception saying that the LocalStatelessSessionProxyFactoryBean could not find any local-refs would have also been more helpful during the search for what caused my problem.

      Comment


      • #4
        Another way to do it

        I don't get EJB2, but I need to incorporate it sometimes into my code. If you want to accomplish the below, but not have to muck up your web.xml with EJB refs, I've found that changing from local-slsb to remote-slsb works the same magic, as follows:

        Code:
        <jee:remote-slsb 
             id="applicEjb" 
             jndi-name="ApplicEJB"
             business-interface="com.xyz.ApplicBusiness"
             home-interface="com.xyz.ApplicBusinessHome"
        </jee:remote-slsb>

        Comment

        Working...
        X