Message Boards

NoSuchResourceActionException custom.model#VIEW in liferay dxp

Sudhanshu Kumar Shukla, modified 4 Years ago.

NoSuchResourceActionException custom.model#VIEW in liferay dxp

Junior Member Posts: 35 Join Date: 8/29/16 Recent Posts
Hi Folks,I am migrating liferay 6.2 portlet into liferay 7.1, I am facing issue on creating model level permission on custom model i.e is not a liferay service builder generated model.It is like custom VO object to transfer Object Data. here is my company.xml file 
<!--?xml version="1.0"?-->

<resource-action-mapping>
<model-resource>
&nbsp; &nbsp; &nbsp; &nbsp; <model-name>org.birdzi.admin.model.Company</model-name>
&nbsp; &nbsp; &nbsp; &nbsp; <portlet-ref>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <portlet-name>OrganizationManagementPortlet</portlet-name>
&nbsp; &nbsp; &nbsp; &nbsp; </portlet-ref>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<permissions>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<action-key>ADD_ENTRY</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<action-key>DELETE</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>UPDATE</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</supports>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>LIST</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>UPDATE</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</site-member-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>COPY</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</guest-defaults>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>VIEW</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<action-key>UPDATE</action-key>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</guest-unsupported>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; </permissions>
</model-resource>
</resource-action-mapping>

this file location is
src/main/resource/resources-main/company.xml
and portlet.properties file location is :
&nbsp;src/main/resource/portlet.properties
below is my portlet.properties

include-and-override=portlet-ext.properties
resource.actions.configs=resource-actions/company.xml
when i am deploying and creating roles and permission for the portlet then it is not getting created in database i.e
ResourceAction
table.
Below is the exception trace.
com.liferay.portal.kernel.exception.NoSuchResourceActionException: org.birdzi.admin.model.Company#VIEW
&nbsp;&nbsp; &nbsp;at com.liferay.portal.service.impl.ResourceActionLocalServiceImpl.getResourceAction(ResourceActionLocalServiceImpl.java:312)
&nbsp;&nbsp; &nbsp;at sun.reflect.GeneratedMethodAccessor214.invoke(Unknown Source)
&nbsp;&nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&nbsp;&nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:498)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:125)
&nbsp;&nbsp; &nbsp;at com.sun.proxy.$Proxy53.getResourceAction(Unknown Source)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl._updateResourcePermission(ResourcePermissionLocalServiceImpl.java:2108)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:1815)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.addResourcePermission(ResourcePermissionLocalServiceImpl.java:302)
&nbsp;&nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&nbsp;&nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
&nbsp;&nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&nbsp;&nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:498)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:203)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:94)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:113)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:82)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:55)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:130)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:125)
&nbsp;&nbsp; &nbsp;at com.sun.proxy.$Proxy52.addResourcePermission(Unknown Source)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.kernel.service.ResourcePermissionLocalServiceUtil.addResourcePermission(ResourcePermissionLocalServiceUtil.java:122)
&nbsp;&nbsp; &nbsp;at com.birdzi.event.BirdziHook.addResource(BirdziHook.java:636)
&nbsp;&nbsp; &nbsp;at com.birdzi.event.BirdziHook.defineRolePermission(BirdziHook.java:553)
&nbsp;&nbsp; &nbsp;at com.birdzi.event.BirdziHook.setupExpando(BirdziHook.java:447)
&nbsp;&nbsp; &nbsp;at com.birdzi.event.BirdziHook.doRun(BirdziHook.java:89)
&nbsp;&nbsp; &nbsp;at com.birdzi.event.BirdziHook.processLifecycleEvent(BirdziHook.java:80)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:98)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:106)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:332)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:766)
&nbsp;&nbsp; &nbsp;at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:385)
&nbsp;&nbsp; &nbsp;at javax.servlet.GenericServlet.init(GenericServlet.java:158)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1124)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1079)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:971)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4829)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1840)
&nbsp;&nbsp; &nbsp;at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
&nbsp;&nbsp; &nbsp;at java.util.concurrent.FutureTask.run(FutureTask.java:266)
&nbsp;&nbsp; &nbsp;at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
&nbsp;&nbsp; &nbsp;at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:525)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:424)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
&nbsp;&nbsp; &nbsp;at java.util.concurrent.FutureTask.run(FutureTask.java:266)
&nbsp;&nbsp; &nbsp;at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
&nbsp;&nbsp; &nbsp;at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
&nbsp;&nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&nbsp;&nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
&nbsp;&nbsp; &nbsp;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&nbsp;&nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:498)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
&nbsp;&nbsp; &nbsp;at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

kindly help on this or is i am doing something wrong.I had gone though with the liferay source code but didn't got any clue.....
Thanks in advanced for the help..............
sanket patel, modified 4 Years ago.

RE: NoSuchResourceActionException custom.model#VIEW in liferay dxp

New Member Posts: 2 Join Date: 10/25/19 Recent Posts
File location is incorrect. It should match with the path you mentioned in portlet.properties
Sudhanshu Kumar Shukla, modified 4 Years ago.

RE: NoSuchResourceActionException custom.model#VIEW in liferay dxp

Junior Member Posts: 35 Join Date: 8/29/16 Recent Posts
Thanks for your answer, yes file location was incorrect and there was also problem with the code.

That i figured out.The correct File Location is
src/main/resources/META-INF/resource-actions/default.xml