[jboss-user] [EJB 3.0] - Interceptors and Service dependencies

drepster do-not-reply at jboss.com
Fri Sep 21 07:25:03 EDT 2007


Hi,

Is it possible to have have an interceptor class depend on a Service Bean. I have seen in Interceptor examples that you can inject EntityManagers and EJB references but i can't seem to inject a service dependency.

here is my use case:
I have a service MBean which tracks all my monitoring metrics. I have written a simple Interceptor to time the execution of EJB calls. So I would like to inject a reference to my Monitoring service MBean into an instance variable of my interceptor. 
I am using the @Depend annotation but that causes the following exception:
java.lang.ArrayStoreException: org.jboss.injection.DependsFieldInjector

I believe this is occuring when the stateless (which has interceptor) is being created. 

Any help much appreciated.

thanks
andre

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087178#4087178

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087178



More information about the jboss-user mailing list