0

I am trying to provide a link to navigate to control panel from my theme. I used the following piece of code.

<li><a href="$my_account_url">Manage Your Profile</a></li>

This worked fine in my local test environment. But when I move this to production , I got following error.

10:10:13,998 ERROR [IncludeTag:231] Current URL /group/control_panel/manage?p_p_auth=9AUrwzDp&p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_count=1&refererPlid=25014&_2_struts_action=%2Fmy_account%2Fedit_user&_2_backURL=%2Fgroup%2F19765%2Fdashboard generates exception: An exception occurred processing JSP page /html/portlet/enterprise_admin/init.jsp at line 221

218: boolean isHavingUpdatePermission = false;
219: boolean isHavingAssignUserRolesPermission = false;
220:
221: boolean isOrganization = GroupLocalServiceUtil.getGroup(themeDisplay.getDoAsGroupId()).isOrganization();
222: long orgId = GroupLocalServiceUtil.getGroup(themeDisplay.getDoAsGroupId()).getOrganizationId();
223:
224: List<Role> objRolesList = RoleLocalServiceUtil.getUserGroupRoles(themeDisplay.getUserId(),themeDisplay.getDoAsGroupId());


Stacktrace:
10:10:13,999 ERROR [IncludeTag:154] com.liferay.portal.NoSuchGroupException: No Group exists with the primary key 0
at com.liferay.portal.service.persistence.GroupPersistenceImpl.findByPrimaryKey(GroupPersistenceImpl.java:723)
at com.liferay.portal.service.impl.GroupLocalServiceImpl.getGroup(GroupLocalServiceImpl.java:517)
at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.service.GroupLocalServiceUtil.getGroup(GroupLocalServiceUtil.java:166)
at org.apache.jsp.html.portlet.enterprise_005fadmin.edit_005fuser_jsp._jspService(edit_005fuser_jsp.java:1162)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:175)

Please help me to solve this issue . Thanks In advance

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • I've adjusted the formatting, so that your link can be seen - you say that you're linking to control panel, but show the $my_account_url. I've not tried it, but does it happen to be not working for users that are not signed in? – Olaf Kock Sep 03 '14 at 12:45

1 Answers1

0

I don't see how do you construct the link, but here is my code which I use for the same task:

#if($themeDisplay.getPermissionChecker().isOmniAdmin())
    <a href="$themeDisplay.getURLControlPanel()">Control Panel</a>
#end
Artem Khojoyan
  • 857
  • 1
  • 6
  • 11
  • Hi Thanks for Your answer. But the problem is that I want to provide this feature to every user not only admin. my_account_url is a pre defined variable available in liferay velocity . This is working fine in my local environment. – Krishna Mohan Mathakala Sep 04 '14 at 06:23