0 Replies Latest reply on Oct 18, 2005 5:31 PM by neeraj_tiwari

    Configuring Permissions\Security on a Portlet

    neeraj_tiwari Newbie

      I want to create role based permissions for my JBoss Wiki Portlet. As a simple experiment I added following xml ro jboss-portlet.xml in wiki.war to allow the User role to read only permission and Admin to read\write permissions.

      <portlet-app>
       <portlet>
       <portlet-name>WikiPortlet</portlet-name>
       <!--<security></security> -->
      
       <!--Code Added-->
      
       <security>
       <model>
       <permission-description>
       <permission-name>write</permission-name>
       <description>Writing permission</description>
       <implies>read</implies>
       </permission-description>
       <permission-description>
       <permission-name>read</permission-name>
       <description>Reading permission</description>
       </permission-description>
       </model>
       <scheme>
       <domain></domain>
       <item>
       <path>/</path>
       <permission>
       <permission-name>read</permission-name>
       <role-name>User</role-name>
       </permission>
       <!--For non logged users -->
       <permission>
       <permission-name>read</permission-name>
       <role-name></role-name>
       </permission>
       <permission>
       <permission-name>write</permission-name>
       <role-name>Admin</role-name>
       </permission>
       </item>
       </scheme>
       </security>
      
       <!--End of Added Code-->
       </portlet>
      </portlet-app>


      Now I am getting following exception and wiki.war does not get deployed.
      Not Sure what additional configuration is missing. Please Advise.


      Code:
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.server.impl.ServerManagerImpl] Instantiated plugin A
      C with class org.jboss.portal.core.plugins.security.AccessController
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.server.kernel.Kernel.(instance.wikiportlet.WikiPortl
      et.WikiPortletInstance-AC)] registered
      2005-10-18 14:37:10,081 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying
       portlet-instances.xml
      2005-10-18 14:37:10,081 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/C
      :/jboss-4.0.2/server/Portal/deploy/wiki.war/WEB-INF/portlet.xml
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Parsing
      jboss-portlet.xml/wiki
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Found sp
      ecific deployment descriptor fragment for portlet WikiPortlet
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.server.impl.config.ConfigurationImpl] Loaded config
      resource for name = /standardjboss-portlet.xml the result is java.io.FileInputStream@1f33aef
      2005-10-18 14:37:10,081 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Copied p
      ortlet.tld file
      2005-10-18 14:37:10,101 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Creating
       portlet WikiPortlet metadata
      2005-10-18 14:37:10,111 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parent
      TraceEnabled=true
      2005-10-18 14:37:10,111 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nested
      TraceEnabled=false
      2005-10-18 14:37:10,111 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detect
      DuplicateNesting=true
      2005-10-18 14:37:10,111 ERROR [org.jboss.deployment.MainDeployer] could not create deployment: file:
      /C:/jboss-4.0.2/server/Portal/deploy/wiki.war/WEB-INF/portlet.xml
      org.jboss.deployment.DeploymentException: Cannot deploy portlet application; - nested throwable: (or
      g.jboss.portal.common.util.NoSuchElementException: Missing child scheme of element model)
       at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.create(PortletAppDeployment.java:
      184)
       at org.jboss.portal.server.deployment.jboss.ServerDeployer.create(ServerDeployer.java:171)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:910)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.ja
      va:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy56.deploy(Unknown Source)
       at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:255)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy31.deploy(Unknown Source)
       at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:49)
       at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:1
      37)
       at org.jboss.mx.modelmbean.XMBean.handleNotification(XMBean.java:485)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
       at $Proxy38.handleNotification(Unknown Source)
       at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadc
      asterSupport.java:112)
       at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcas
      terSupport.java:93)
       at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:238)
       at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:206)
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:410)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
       at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.ja
      va:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentSc
      anner.java:204)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.ja
      va:277)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:418)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.ja
      va:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
       at org.jboss.Main.boot(Main.java:195)
       at org.jboss.Main$1.run(Main.java:463)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.portal.common.util.NoSuchElementException: Missing child scheme of element mode
      l
       at org.jboss.portal.common.util.XML.getUniqueChild(XML.java:401)
       at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.buildSecurityMetaData(PortletAppDepl
      oyment.java:168)
       at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.buildPortletMetaData(PortletAppDeplo
      yment.java:73)
       at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.create(PortletAppDeployment.java:
      155)
       ... 110 more
      2005-10-18 14:37:10,111 ERROR [org.jboss.deployment.MainDeployer] could not create deployment: file:
      /C:/jboss-4.0.2/server/Portal/deploy/wiki.war/WEB-INF/
      org.jboss.deployment.DeploymentException: Cannot deploy portlet application; - nested throwable: (or
      g.jboss.portal.common.util.NoSuchElementException: Missing child scheme of element model)
       at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.create(PortletAppDeployment.java:
      184)
       at org.jboss.portal.server.deployment.jboss.ServerDeployer.create(ServerDeployer.java:171)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:910)