Message Boards

Document and media portlet gives nothing but permissions bugs

Ra Jo Ga Cha, modified 7 Years ago.

Document and media portlet gives nothing but permissions bugs

Junior Member Posts: 77 Join Date: 1/19/17 Recent Posts
I've imported a database from 6.2 (imported from 6.1) and it's working flawlessly but this portlet. It doesn't show up, no errors on display, but some errors in the logs. This is happening with classic theme in blank pages so I think this must be a bug or maybe something in the database about old Document and Media Viewer is breaking this.

Here is the error log:
13:47:31,068 ERROR [http-nio-8080-exec-7][runtime:60] Error executing FreeMarker template
FreeMarker template error:
Java method "com.liferay.portal.kernel.portlet.toolbar.PortletToolbar.getPortletTitleMenus(String, javax.portlet.PortletRequest, javax.portlet.PortletResponse)" threw an exception when invoked on com.liferay.portal.kernel.portlet.toolbar.PortletToolbar object "com.liferay.portal.kernel.portlet.toolbar.PortletToolbar@1228d399"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign portlet_title_menus = portlet... [in template "classic-theme_SERVLET_CONTEXT_/templates/portlet.ftl" at line 16, column 17]


This line is:
<#assign portlet_title_menus = portlet_toolbar.getPortletTitleMenus(portlet_display_root_portlet_id, renderRequest, renderResponse)>


More logs:
Caused by: java.lang.IllegalArgumentException: Someone may be trying to circumvent the permission checker: {companyId=10154, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10300, scope=4}

Caused by: com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=10154, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10300, scope=4}

13:47:31,074 ERROR [http-nio-8080-exec-7][IncludeTag:128] Current URL /web/guest/test generates exception: javax.servlet.jsp.JspException: com.liferay.portal.kernel.template.TemplateException: Unable to process template classic-theme_SERVLET_CONTEXT_/templates/portlet.ftl
com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=10154, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10300, scope=4}
Ra Jo Ga Cha, modified 7 Years ago.

RE: Document and media portlet gives nothing but permissions bugs

Junior Member Posts: 77 Join Date: 1/19/17 Recent Posts
Update:

I've removed all results searching for "document_library_web_portlet" in ResourcePermission table of the database and restarted, so permission have been reseted but problem persists :/
Ra Jo Ga Cha, modified 7 Years ago.

RE: Document and media portlet gives nothing but permissions bugs

Junior Member Posts: 77 Join Date: 1/19/17 Recent Posts
Anyone? This problem is happening too when trying to access publications -> Document Library in administrative menus, I'm getting:

13:49:37,924 ERROR [http-nio-8080-exec-2][IncludeTag:128] Current URL /group/guest/~/control_panel/manage?p_p_id=com_liferay_document_library_web_portlet_DLAdminPortlet&p_p_lifecycle=0&p_p_state=maximized generates exception: java.lang.IllegalArgumentException: Someone may be trying to circumvent the permission checker: {companyId=10154, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10300, scope=4}
com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=10154, name=com.liferay.document.library.kernel.model.DLFileEntryType, primKey=10300, scope=4}


I have changed scope value to 1 where primKey is 10300 in ResourcePermission table in the database, cleared all caches, removed tomcat/work and /temp folders, restarted... But I'm still getting the same error! Scope isn't changing...

Any help or idea is welcome, i'm stuck for days right now.
Ra Jo Ga Cha, modified 7 Years ago.

RE: Document and media portlet gives nothing but permissions bugs (Answer)

Junior Member Posts: 77 Join Date: 1/19/17 Recent Posts
Through NoSuchPermissionException I reached doCheckPermission method. I seeked the breadcrumb to countByC_N_S_P method and found it was actually searching for a row where all that values coincide, but this didn't existed because of the changes in roles IDs and "contract", "marketing banner", etc primkeys. Additionally they had to have the ownerId of the default user, so I just created the spected default values. It worked like a charm!