[Security & JAAS/JBoss] - Eclipse RAP application and JBoss JAAS
by sandello
Hi,
I have a project consists two parts: ejb3-server part and RAP-client. Both parts are deployed in JBoss 4.2.1. I need to implement Authentication and Authorization in the project.
I do this:
1. add this to web.xml in RAP client war-file
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>MyProject</web-resource-name>
| <url-pattern>/*</url-pattern>
| <http-method>POST</http-method>
| <http-method>GET</http-method>
| </web-resource-collection>
| <auth-constraint>
| <role-name>User_MyProject_system</role-name>
| </auth-constraint>
| </security-constraint>
| <login-config>
| <auth-method>BASIC</auth-method>
| <realm-name>MyProjectRealm</realm-name>
| </login-config>
| <security-role>
| <role-name>User_MyProject_system</role-name>
| </security-role>
|
2. add file jboss-web.xml to rap client war-file
| <jboss-web>
| <security-domain>java:/jaas/MyProjectPolicy</security-domain>
| </jboss-web>
|
Now, when I access RAP-client application via web the browser login window is displayed. I enter correct login/password and all works fine.
Next, I configure EJB3 security. I add annotations @SecurityDomain("MyProjectPolicy") and @PermitAll tþ stateless session bean classes and restart JBoss. After this, I open the rap application in my browser, enter correct login/password. The application's first screen is displayed. But when I try to do something which interact with EJB3-part I see exception (in JBoss logs and RAP): "javax.ejb.EJBAccessException: Authentication failure".
What I do wrong???
Environment:
JBoss 4.2.1
Eclise 3.3
Rap 1.1M2
Java 1.5.0_14
Stacktrace from JBoss logs:
| 21:07:30,735 ERROR [STDERR] javax.ejb.EJBAccessException: Authentication failure
| 21:07:30,735 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:68)
| 21:07:30,735 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:70)
| 21:07:30,735 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| 21:07:30,735 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,735 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| 21:07:30,735 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,735 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 21:07:30,735 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,736 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
| 21:07:30,736 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| 21:07:30,736 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:1550)
| 21:07:30,736 ERROR [STDERR] at org.jboss.remoting.Client.invoke(Client.java:530)
| 21:07:30,736 ERROR [STDERR] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,737 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
| 21:07:30,737 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,737 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
| 21:07:30,737 ERROR [STDERR] at $Proxy214.find(Unknown Source)
| 21:07:30,737 ERROR [STDERR] at com.company.myproject.ui.server.SelectServerAction.run(SelectServerAction.java:26)
| 21:07:30,737 ERROR [STDERR] at com.company.myproject.ui.server.SelectServerAction.run(SelectServerAction.java:1)
| 21:07:30,738 ERROR [STDERR] at com.company.myproject.ui.server.common.AJob.run(AJob.java:23)
| 21:07:30,738 ERROR [STDERR] at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,738 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
| 21:07:30,738 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 21:07:30,738 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
| 21:07:30,739 ERROR [STDERR] at $Proxy214.find(Unknown Source)
| 21:07:30,739 ERROR [STDERR] at com.company.myproject.ui.server.SelectServerAction.run(SelectServerAction.java:26)
| 21:07:30,739 ERROR [STDERR] at com.company.myproject.ui.server.SelectServerAction.run(SelectServerAction.java:1)
| 21:07:30,739 ERROR [STDERR] at com.company.myproject.ui.server.common.AJob.run(AJob.java:23)
| 21:07:30,739 ERROR [STDERR] at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151799#4151799
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151799
18 years, 1 month
[JBoss jBPM] - Re: Invoking webservice from action
by jagr
Why sometimes when I execute process and enter in node that invoke webservice Exception is thrown because don't find the class?
| ava.lang.NoClassDefFoundError: com/aixtelecom/portbooker/UpdatePrice_Service
| at com.aixtelecom.portbooker.bpm.actions.Node1Action.execute(Node1Action.java:32)
| at org.jbpm.graph.def.Action.execute(Action.java:122)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
| at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:220)
| at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:190)
| at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:174)
| at org.jbpm.graph.def.Node.enter(Node.java:303)
| at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$ef5f66fa.enter(<generated>)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.node.StartState.leave(StartState.java:70)
Jax-ws only generate .class from webservice.
I add these .class into folder and in eclipse I specify in build path project, Add class folder and I select folder that contains .class generated.
Into action of jbpm, I can use this generated classes and invoke web service, but now, when I execute the process and enter into node that invoke ws, exception java.lang.NoClassDefFoundError is thrown but I don't know why.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151792#4151792
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151792
18 years, 1 month