|
| Apache Geronimo > Discussion Forums | User List | Dev List | Wiki | Issue Tracker |
|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
security constraint questionIn my web.xml file I have a security constraint which is intended simply to block direct access to the jsp, jspx, xhtml files directly. Here is the snippet from web.xml
|
|
|
RE: security constraint questionRecently, I am working on Geronimo WADI clustering but I have encountered some problems when I configured the WADI over static member configuration following the link http://cwiki.apache.org/GMOxDOC22/wadi-clustering.html Steps: 1.Setup 2 nodes in the same physical workstation one is 8080 which is the master node and another is 8090. 2.Change the module <module name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car" in the config.xml to NODE1 is like this: <module name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car"> <gbean name="DefaultBackingStrategyFactory"> <attribute name="nbReplica">${ReplicaCount}</attribute> </gbean> <gbean name="DefaultDispatch erHolder"> <attribute name="endPointURI">${EndPointURI}</attribute> <attribute name="clusterName">${WADIClusterName}</attribute> </gbean> <gbean name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car,j2eeType=GBean,name=firstStaticMember" gbeanInfo="org.apache.geronimo.clustering.wadi.WadiStaticMember"> <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute> <attribute name="port">4003</attribute> <attribute name="securePort">-1</attribute> <attribute name="domain">test-domain</attribute> <attribute name="UniqueId">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</attribute> <attribute name="host">9.123.233.67</attribute> <reference name="nextWadiStaticMember"></gbean> </module> NODE2 is like this: <module name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car" load="false"> <gbean name="DefaultBackingStrategyFactory"> <attribute name="nbReplica">${ReplicaCount}</attribute> </gbean> <gbean name="DefaultDispatcherHolder"> <attribute name="disableMCastService">tr ue</attribute> <attribute name="receiverPort">4003</attribute> <reference name="staticMember"> <pattern> <groupId>org.apache.geronimo.configs</groupId> <artifactId>wadi-clustering</artifactId> <version>2.2-SNAPSHOT</version>   ; <type>car</type> <name>firstStaticMember</name> </pattern> </reference> </gbean> <gbean name="org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car,j2eeType=GBean,name=secondStaticMember" gbeanInfo="org.apache.geronimo.clustering.wadi.WadiStaticMember"> <attribute name="className">org.apache.catalina.tribes.membership.StaticMember</attribute>   ; <attribute name="port">4001</attribute> <attribute name="securePort">-1</attribute> <attribute name="domain">test-domain</attribute> <attribute name="UniqueId">0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1</attribute> <attribute name="host">9.123.233.67</attribute> <reference name="nextWadiStaticMember"/> </gbean> </module> But when I start the module org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car of the NODE 2 then I got a failure which is Lifecycle operation failed. And the exceptions are org.apache.geronimo.kernel.config.LifecycleException: start of org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car failed at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:562) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:527) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:130) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:815) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) at org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$79d07ec2.startConfiguration(<generated>) at org.apache.geronimo.console.configmanager.ConfigManagerPortlet.processAction(ConfigManagerPortlet.java:157) at org.apache.pluto.core.PortletServle t.dispatch(PortletServlet.java:218) at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488) at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.j ava:167) at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85) at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217) at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:121) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.geronimo.console.filter.PlutoURLRebuildFilter.doFilter(PlutoURLRebuildFilter.java:48) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.geronimo.console.filter.XSSXSRFFilter.doFilter(XSSXSRFFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.geronimo.tomcat.security.SecurityValve.invoke(SecurityValve.java:88) at org.apache.geronimo.tomcat.security.jacc.JACCSecurityValve.invoke(JACCSecurityValve.java:54) at org.apache.geronimo.tomcat.GeronimoStandardContext$Sys temMethodValve.invoke(GeronimoStandardContext.java:420) at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$SocketProc essor.run(JIoEndpoint.java:361) at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214) at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:735) Caused by: org.apache.geronimo.kernel.config.InvalidConfigException: Unable to resolve reference "staticMember" in gbean org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car,j2eeType=GBean,name=DefaultDispatcherHolder to a gbean matching the pattern [org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?name=firstStaticMember#] at org.apache.geronimo.kernel.conf ig.ConfigurationUtil.preprocessGBeanData(ConfigurationUtil.java:380) at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:438) at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:190) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:546) ... 55 more Caused by: org.apache.geronimo.kernel.GBeanNotFoundException: No matches for referencePatterns: [org.apache.geronimo.configs/wadi-clustering/2.2-SNAPSHOT/car?name=firstStaticMember#] at org.apache.geronimo.kernel.config.Configuration.findGBeanData(Configuration.java:688) at org.apache.geronimo.kernel.config.Configuration.findGBean(Configuration.java:661) at org.apache.geronimo.kernel.config.Configuration.findGBea n(Configuration.java:656) at org.apache.geronimo.kernel.config.ConfigurationUtil.preprocessGBeanData(ConfigurationUtil.java:375) ... 58 more I really need your help to figure out the errors. Thanks Ben 与任何您希望的人分享您的回忆。 任何您希望的人。 |
|
|
Re: security constraint questionHi Ray, sorry for the delay.
On Sep 19, 2009, at 5:35 PM, Ray Clough wrote: In my web.xml file I have a security constraint which is intended simply to block direct access to the jsp, jspx, xhtml files directly. Here is the snippet from web.xml I'm quite surprised at this. I would expect you would get the same message as you get with an ear. Now when I'm trying to deploy as an EAR, it won't deploy with message "web.xml for web app XXX.war includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly." I have tried various different contents in geronimo-application.xml, but I always get the same error. The app uses custom security, and I do not have any security realm defined on Geronimo. Can I do this, and if so, how? Thanks, - Ray Clough I'm pretty sure you need the <security/> element but I don't think you need anything inside. I don't recall if you need a security realm or not. As you say, you shouldn't really. I think I remember making this scenario work in 2.2 some time ago: it may not work in 2.1.x. I don't suppose you have a simple app to demonstrate the behavior? thanks david jencks
|
|
|
Re: security constraint questionHi Ben,
First of all, you appear to have replied to a message with questions on completely unrelated subjects. In the future please start a new thread instead. On Sep 21, 2009, at 8:33 PM, LiangBen wrote:
The documentation is not entirely clear to me, but: 1. GBean references only work within the VM geronimo is running in. So in Node1, all the references need to be to gbeans deployed in node1, and in node2, all the references need to be to gbeans deployed in node2. In Node1 your firstStaticMember gbean refers to a secondStaticMember with is not deployed on node1. Similarly, on node2 DefaultDispatcherHolder has a reference to a firstStaticMember but the gbean is called secondStaticMember. This is the immediate cause of the exception. 2. the documentation is not at all clear but you might need a staticMember gbean for the node itself, i.e. 2 staticMember gbeans on each node. Hope this helps david jencks |
|
|
Re: security constraint questionDavid, thanks for your reply,
I'm using Geronimo 2.1.4, the latest. When you mention that you think it works in 2.2, is that speaking of the future, or a typo? Here is the a portion of the geronimo-application.xml file: <module> <web>RiskPortal_Kamakura_v3.1.00_b4667.war</web> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0" > <naming:resource-ref> <naming:ref-name>jdbc/RP_DB</naming:ref-name> <naming:resource-link>RPSystemDB</naming:resource-link> </naming:resource-ref> </web-app> </module> <sec:security></sec:security> The security element is the same as in geronimo-web.xml which deploys properly. The security element in web.xml just prevents direct access to the specified resources, and is: <security-constraint> <display-name>Unavailable_Raw_Pages</display-name> <web-resource-collection> <web-resource-name>RawPages</web-resource-name> <url-pattern>*.xhtml</url-pattern> <url-pattern>*.jsp</url-pattern> <url-pattern>*.jspx</url-pattern> <url-pattern>*.tiles</url-pattern> <http-method>POST</http-method> <http-method>GET</http-method> <http-method>PUT</http-method> <http-method>DELETE</http-method> </web-resource-collection> <auth-constraint> </auth-constraint> </security-constraint> I make no claims to understanding geronimo deployment descriptors in detail, but this seems like this should work. Am I missing something? Thanks, - Ray Clough
|
| Free embeddable forum powered by Nabble | Forum Help |
