Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liferay Portlet Error - "NoSuchResourceActionException <Portlet>_WAR_<PortletApp>#VIEW"

I have created a custom Liferay 6.2 portlet using Grails 2.0.4, the Portlets Plugin 0.9.2, and Liferay Portlets Plugin 0.4.

I am getting a strange error after deploying the portlet. Here is what happens:

  1. Upload the WAR file through the web interface
  2. Add the portlet to a page
  3. Receive an error that says "There was an unexpected error. Please refresh the current page."
  4. Refresh the page to find that none of the portlets on the page work anymore, and the following error is displayed: "Internal Server Error - An error occurred while accessing the requested resource." (see the image below)

The logs indicate the following error:

com.liferay.portal.NoSuchResourceActionException: <Portlet>_WAR_<PortletApp>#VIEW

I've seen other instances where the "#VIEW" says "#ADD_TO_PAGE". Please note that the portlet is deploying and working just fine on my vanilla version of Liferay 6.2 that I use for development.

Does anyone know what the issue could possibly be? Thank you.

Stacktrace:

Jan 16, 2014 10:42:40 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
com.liferay.portal.NoSuchResourceActionException: <Portlet>_WAR_<PortletApp>#VIEW
    at com.liferay.portal.service.impl.ResourceActionLocalServiceImpl.getResourceAction(ResourceActionLocalServiceImpl.java:196)
    at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
    at com.sun.proxy.$Proxy85.getResourceAction(Unknown Source)
    at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.doUpdateResourcePermission(ResourcePermissionLocalServiceImpl.java:1190)
    at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.updateResourcePermission(ResourcePermissionLocalServiceImpl.java:1312)
    at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.setOwnerResourcePermissions(ResourcePermissionLocalServiceImpl.java:1038)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
    at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)

The error after adding the portlet and refreshing the page

like image 913
grantmcconnaughey Avatar asked Oct 02 '22 20:10

grantmcconnaughey


1 Answers

The problem ended up being higher in the stacktrace. I was receiving the following error:

net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.store.DefaultElementValueComparator

I was able to fix the problem by reading this link. Here are the steps I took:

  1. Navigate to $liferay_home/tomcat/webapps/ROOT/WEB-INF/lib/
  2. Copy ehcache.jar somewhere to back it up (like the root $liferay_home directory)
  3. Copy ehcache.jar again somewhere to work with it (like the desktop)
  4. Change the name ehcache.jar to ehcache.zip
  5. Unzip the ehcache.zip file
  6. Copy the updated ClassLoaderUtil.class file to the folder's net/sf/ehcache/util/ directory, replacing the current ClassLoaderUtil.class file.
  7. Zip the ehcache directory
  8. Change the name ehcache.zip to ehcache.jar
  9. Put this new ehcache.jar file in $liferay_home/tomcat/webapps/ROOT/WEB-INF/lib/, replacing the current ehcache.jar
like image 136
grantmcconnaughey Avatar answered Oct 19 '22 23:10

grantmcconnaughey