Announcement Announcement Module
No announcement yet.
LocalSlsbInvokerInterceptor, Websphere 5.1 IllegalArgumentEx Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • LocalSlsbInvokerInterceptor, Websphere 5.1 IllegalArgumentEx

    I am running Spring 1.0.2 on Websphere 5.1 and using the LocalSlsbInvokerInterceptor for an EJB proxy.

    I am receiving an IllegalArgumentException when the interceptor invokes the EJB local.


    <bean id="myService" class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
    <property name="jndiName">
    <property name="businessInterface">
    <value>com.mycompany.domain.service.MyBusinessServ ice</value>


    [8/30/04 20:38:59:590 CDT] 169b169b RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class org.aopalliance.aop.AspectException
    [8/30/04 20:39:01:072 CDT] 169b169b WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.IllegalArgumentException
    at java.lang.Throwable.<init>(
    at java.lang.Throwable.<init>(
    at java.lang.IllegalArgumentException.<init>(IllegalA
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at org.springframework.ejb.access.LocalSlsbInvokerInt erceptor.invoke(
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed( :138)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(
    at $Proxy0.findUsers (Unknown Source)


    Note: I noticed the following in the interceptor:

    public Object invoke(MethodInvocation invocation) throws Throwable {
    EJBLocalObject ejb = null;
    try {
    ejb = newSessionBeanInstance();
    return invocation.getMethod().invoke(ejb, invocation.getArguments());
    catch (InvocationTargetException ex) {
    Throwable targetException = ex.getTargetException);"Method of local EJB [" + getJndiName() + "] threw exception", targetException);
    if (targetException instanceof CreateException) {
    throw new AspectException("Could not create local EJB [" + getJndiName() + "]", targetException);
    else {
    throw targetException;
    catch (Throwable ex) {
    throw new AspectException("Failed to invoke local EJB [" + getJndiName() + "]", ex);

    . . .

    The interceptor creates the new EJB instance (EJBLocalObject) then reflectively tries to invoke the method.

    When debugging the above, I noticed the variable 'ejb' in the code is actually Websphere generated classes... i.e.

    * EJSLocalStatelessMySessionFacade_5f717edd
    public class EJSLocalStatelessPerscriptionSessionFacade_5f717ed d extends EJSLocalWrapper implements l { . .

    Since this class extends MySessionFacadeLocal.. it should be of the same type. I am passing in a single java.lang.String as an argument, so I dont think it should be a matter of invalid number or type of Parameters.

    Anyone else having a problem using the LocalSlsbInvokerInterceptor using Websphere 5.1 ??

    I noticed Colin had a problem that was kinda similar? But I think that was a matter of trying to use the LocalSlsbInvokerInterceptor accessing a Remote and not Local EJB..

    Any thoughts / advice are appreciated

  • #2
    Ok found the issue

    Looks like the container generated classes do NOT implement the Business Interface... obviously a problem with the invoke.

    Now, to figure out how to get WSAD to carry over the Business Interface into the signatures...