calling EJB from handleNotification in timer listener
ittay May 8, 2003 8:40 AMHello,
I have a regular class implementing the NotificationListener interface, a session bean send a message to a message driven bean which in turn adds a notification to the timer. when the listener is called by the timer, it tries to call on another session bean (actually, it tries to create an instance of it), but fails with the exception:
javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
Insufficient method permissions, principal=null, method=create, interface=HOME, requiredRoles=[User], principalRoles=[]
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:346)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:124)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessSessionContainer.java:310)
at org.jboss.ejb.Container.invoke(Container.java:694)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:88)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:175)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
at $Proxy243.create(Unknown Source)
all this happens within the save VM, but the session beans have remote interfaces only. the session bean that starts the whole process is called from the outside (by a unit test), and there the security is just fine (the unit tests does a login()).
please help, but be gentle, i'm a newbie,
thanx,
ittay