Message Boards

Liferay 6.2 - Mobile Device Rule Errors

Frank Wang, modified 7 Years ago.

Liferay 6.2 - Mobile Device Rule Errors

New Member Posts: 3 Join Date: 2/1/16 Recent Posts
Hello,

I created the mobile device rule for certain pages.
Firstly, it shows that
"There is no device recognition provider installed. It will not be possible to determine the characteristics of the devices accessing the portal. Please contact the portal administrator or install it from the Liferay Marketplace."
But I didn't find a working plugin for 6.2 in the marketplace.

Then, I created the rules for one page, in the console, I got the error below. Did someone encounter this issue before? Or please give me some advices for modifying liferay mobile devices rules.

Thanks.

21:40:06,918 ERROR [http-bio-8080-exec-8][IncludeTag:129] Current URL /group/control_panel/manage?p_p_auth=aXafdG5b&p_p_id=156&p_p_lifecycle=2&p_p_state=maximized&p_p_mode=view&p_p_cacheability=cacheLevelPage&doAsGroupId=26302&refererPlid=23486&controlPanelCategory=sites&_156_treeId=layoutsTree&_156_groupId=26302&_156_tabs1=public-pages&_156_viewLayout=true&_156_struts_action=%2Fgroup_pages%2Fedit_layouts&_156_selPlid=26310&_156_historyKey= generates exception: null
java.lang.NullPointerException
at org.apache.jsp.html.portlet.layouts_005fadmin.layout.mobile_005fdevice_005frules_005frule_005fgroup_005finstance_005faction_jsp._jspService(mobile_005fdevice_005frules_005frule_005fgroup_005finstance_005faction_jsp.java:740)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portal.kernel.dao.search.JSPSearchEntry.print(JSPSearchEntry.java:64)
at org.apache.jsp.html.taglib.ui.search_005fiterator.page_jsp._jspService(page_jsp.java:1070)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.portlet.layouts_005fadmin.layout.mobile_005fdevice_005frules_jsp._jspx_meth_liferay_002dui_005fsearch_002diterator_005f0(mobile_005fdevice_005frules_jsp.java:2152)
at org.apache.jsp.html.portlet.layouts_005fadmin.layout.mobile_005fdevice_005frules_jsp._jspService(mobile_005fdevice_005frules_jsp.java:1669)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
thumbnail
Claudio Carlenzoli, modified 7 Years ago.

RE: Liferay 6.2 - Mobile Device Rule Errors

New Member Posts: 12 Join Date: 12/31/14 Recent Posts
Hi Frank,

I don't know if is still an open issue but I faced same error and correct it creating an hook on file

layouts_admin/layout/mobile_device_rules_rule_group_instance_action.jsp

Error occurs since code like this

String taglibActionHandler = renderResponse.getNamespace() + "mobileDeviceActionHandler('" + viewRuleGroupInstanceActionsURL.toString() + "');";


gives an NPE since renderResponse is null.

So as workaround I just modified the first part of the JSP file as described


SearchContainer searchContainer = (SearchContainer)request.getAttribute("liferay-ui:search:searchContainer");

String redirect = searchContainer.getIteratorURL().toString();

String closeRedirect = ParamUtil.getString(request, "closeRedirect");

ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);

MDRRuleGroupInstance mdrRuleGroupInstance = (MDRRuleGroupInstance)row.getObject();

MDRRuleGroup mdrRuleGroup = MDRRuleGroupLocalServiceUtil.getMDRRuleGroup(mdrRuleGroupInstance.getRuleGroupId());

/*WORKAROUND */
PortletResponse responseAvailable = renderResponse;
if (renderResponse == null)
	responseAvailable = liferayPortletResponse; //6.2 GA6 was not defined!!!



and changing all 'renderResponse' references to the new variable 'responseAvailable'.

You can follow issue LPS-70077 .


In any case we still are looking for a working plugin for 6.2 after we tried all the marketplace solutions on 6.2 GA6.

Best