[JBoss Seam] - Re: Exception for authorization attempt
by henrik.lindberg
Then, when I actually restrict the settings page (in pages.xml) like this:
| <page view-id="/settings.xhtml">
| <restrict/>
| </page>
|
Then I get
| 18:00:36,890 ERROR [AbstractSeamPhaseListener] Swallowing exception thrown by page action
| org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [#{s:hasPermission('/settings.xhtml', 'ren
| der', null)}]
| at org.jboss.seam.security.Identity.checkRestriction(Identity.java:165)
| at org.jboss.seam.pages.Page.enter(Page.java:185)
| at org.jboss.seam.core.Pages.enterPage(Pages.java:239)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:241)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:192)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:53)
| at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:619)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010911#4010911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010911
19Â years, 2Â months
[JBoss Seam] - Re: Exception for authorization attempt
by henrik.lindberg
I tried it - does not work for me. Is it supposed to work for 1.1.5.GA, or does this depends on things only in CVS?
This is what I have done
In security.drl
| canUserRenderSettings
| no-loop
| activation-group "permissions"
| when
| c: PermissionCheck(name == "/settings.xhtml" || "settings", action == "render", granted == false)
| then
| c.grant();
| modify(c);
| end;
|
I.e. a very lean rule, the user only has to be logged in. I added || "settings" because I wanted to try to check permission explicetly and use "settings" as the tag - have not tried that yet though.
I added the "no-loop", and "activation-group" from the example in CVS. Also added the "modify(c)" at the end. Don't know what they are supposed to do, but I can guess.
Then in pages.xml I have the two exception declarations:
| <!-- When NotLoggedInException occurs - redirect to login -->
| <exception class="org.jboss.seam.security.NotLoggedInException">
| <redirect view-id="/login.xhtml">
| <faces-message>You must be a member to use this feature</faces-message>
| </redirect>
| <end-conversation/>
| </exception>
|
| <!-- When AuthorizationException occurs - redirect to error page -->
| <exception class="org.jboss.seam.security.AuthorizationException">
| <redirect view-id="/security_error.xhtml">
| <faces-message>You do not have permission to do this</faces-message>
| </redirect>
| <end-conversation/>
| </exception>
| </pages>
|
(to be continued in the next post...)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010910#4010910
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010910
19Â years, 2Â months
[JBoss Seam] - Re: unexplode problems
by henrik.lindberg
On the console - I sometimes get this:
17:56:16,875 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@75a683f2 { url=file:/C:/Dev/jboss-4.0.5.GA/server/default/deploy/cssite.ear/ }
deployer: org.jboss.deployment.EARDeployer@134263a
status: null
state: FAILED
watch: file:/C:/Dev/jboss-4.0.5.GA/server/default/deploy/cssite.ear/
altDD: null
lastDeployed: 1170608165515
lastModified: 1170608164843
mbeans:
And
17:57:06,953 ERROR [MainDeployer] Could not initialise deployment: file:/C:/Dev/jboss-4.0.5.GA/server/default/deploy/cssite.ear/
org.jboss.deployment.DeploymentException: No META-INF/application.xml found
at org.jboss.deployment.EARDeployer.init(EARDeployer.java:133)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor19.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.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Usually, after having seen these exceptions it works better to build clean.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010904#4010904
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010904
19Â years, 2Â months