-
Aug 30th, 2004, 09:11 PM
#1
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.
Config:
<bean id="myService" class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
<property name="jndiName">
<value>java:comp/env/mySessionFacadeEjb</value>
</property>
<property name="businessInterface">
<value>com.mycompany.domain.service.MyBusinessServ ice</value>
</property>
</bean>
Stacktrace:
[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>(Throwable.java)
at java.lang.Throwable.<init>(Throwable.java)
at java.lang.IllegalArgumentException.<init>(IllegalA rgumentException.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.springframework.ejb.access.LocalSlsbInvokerInt erceptor.invoke(LocalSlsbInvokerInterceptor.java)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:148)
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);
logger.info("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 org.albertawellnet.pin.service.MySessionFacadeLoca 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
-
Aug 31st, 2004, 04:54 PM
#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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules