2 Replies Latest reply on Nov 26, 2017 9:07 AM by Artem Khmelevskyi

    Insufficient method permissions

    Artem Khmelevskyi Newbie

      Hi, I'm new in Jboss. I'm using AS 7.1.1

       

      I run my EJB on server and want to call it by external client, but have error. How I can change roles for certain EJB, and where it is?

       

      I create ejb-jar.xml and tried to change domain.xml - it doesn't help.

       

      Please advise... I run out of ideas.

       

      thx

       

      INFO: Discarding result for invocation id 1 since no waiting context found

      java.rmi.AccessException: SecurityException; nested exception is:

        java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=GetPersonalOptions, method=create, interface=HOME, requiredRoles=[GetPersonalOptions], principalRoles=[guest]

        at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:388)

        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:136)

        at org.jboss.ejb.plugins.CleanShutdownInterceptor.invokeHome(CleanShutdownInterceptor.java:212)

        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)

        at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)

        at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:637)

        at org.jboss.ejb.Container.invoke(Container.java:981)

        at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

        at org.jboss.invocation.unified.server.UnifiedInvokerHA.invoke(UnifiedInvokerHA.java:148)

        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:862)

        at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:634)

        at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:434)

        at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:176)

        at ...asynchronous invocation...(Unknown Source)

        at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:99)

        at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:270)

        at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:47)

        at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)

        at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:132)

        at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:260)

        at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:399)

        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:140)

        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)Hello From Java!

      ejb:/MyAdditionEJB1//Addition!com.mylogic.AdditionRemote

      ejb:/MyAdditionEJB1//PoMultUpdate!com.cust.api.PoMultUpdateRemote

      Result computed by EJB is :10

      [2765418]

       

        at com.sun.proxy.$Proxy1.execute(Unknown Source)

        at StartCalc.main(StartCalc.java:53)

      Caused by: java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=GetPersonalOptions, method=create, interface=HOME, requiredRoles=[GetPersonalOptions], principalRoles=[guest]

        at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.java:273)

        at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:135)

        at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132)

        at org.jboss.ejb.plugins.CleanShutdownInterceptor.invokeHome(CleanShutdownInterceptor.java:212)

        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)

        at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105)

        at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:637)

        at org.jboss.ejb.Container.invoke(Container.java:981)

        at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

        at org.jboss.invocation.unified.server.UnifiedInvokerHA.invoke(UnifiedInvokerHA.java:148)

        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:862)

        at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:634)

        at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:434)

        at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:176)

        at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:182)

        at org.jboss.remoting.Client.invoke(Client.java:1935)

        at org.jboss.remoting.Client.invoke(Client.java:788)

        at org.jboss.invocation.unified.interfaces.UnifiedInvokerHAProxy.invoke(UnifiedInvokerHAProxy.java:208)

        at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)

        at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)

        at org.jboss.proxy.TransactionStickyInterceptor.invoke(TransactionStickyInterceptor.java:40)

        at org.jboss.proxy.ejb.RetryInterceptor.invoke(RetryInterceptor.java:177)

        at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

        at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)

        at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)

        at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)

        at com.sun.proxy.$Proxy16.create(Unknown Source)

        at com.cust.api.PoMultUpdate.login(PoMultUpdate.java:112)

        at com.cust.api.PoMultUpdate.execute(PoMultUpdate.java:68)

        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:597)

        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)

        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

        at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:302)

        at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$200(MethodInvocationMessageHandler.java:64)

        at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:196)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

        at java.lang.Thread.run(Thread.java:662)

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

       

       

      java.lang.SecurityException : Insufficient method permissions, principal=null, ejbName=GetPersonalOptions, method=create, interface=HOME, requiredRoles=[GetPersonalOptions], principalRoles=[guest]

       

       

        • 1. Re: Insufficient method permissions
          Wolf-Dieter Fink Master

          You need to add user credentials to your client and add this user via the add-user script for teh server n apply the role to it requiredRoles=[GetPersonalOptions]

          It seems you have disabled security for the connect because the Exxception says principal=null

           

          Note this works only if you have the default configuration for security for the ApplicationRealm and the remote-connector.

           

          BTW, 7.1.1 is really old, you should move to wildfly which is the successor for JBossAS

          • 2. Re: Insufficient method permissions
            Artem Khmelevskyi Newbie

            Hi, Thanks for your answer.

            I got it. I added rights for the guest user on other server side. It's like workaround, in future anyway need to change it. So - I need to customize my security remote-connector configuration.

             

            My chain is - Client --> Jboss 7.1.1 --> Jboss 4.2(or somth like this. Really old one. But it's also can't be changed) I added rights on 4.2 for logging.

             

            About 7.1.1 - it's requirement, so can't go to latest version((

             

            Thank you.