2
votes

Here's a stacktrace I get when trying to run a portlet in Liferay Portal 6.0.6.

Anyone has a clue what is going on?

12:40:00,146 ERROR [PortletServlet:96] javax.portlet.PortletException: javax.servlet.ServletException: javax.servlet.jsp
  .JspException: com.liferay.taglib.aui.LayoutTag cannot be cast to javax.servlet.jsp.tagext.Tag
  javax.portlet.PortletException: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.liferay.taglib.aui.L
  ayoutTag cannot be cast to javax.servlet.jsp.tagext.Tag
    at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:110)
    at org.springframework.web.portlet.DispatcherPortlet.doRender(DispatcherPortlet.java:1137)
    at org.springframework.web.portlet.DispatcherPortlet.render(DispatcherPortlet.java:1092)
    at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:755)
    at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:522)
    at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:470)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
    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.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:638)
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:723)
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:425)
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1440)
    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.portal.util.PortalImpl.renderPortlet(PortalImpl.java:3740)
    at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1180)
    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:160)
    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:94)
    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:256)
    at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:181)
    at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:821)
    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.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:370)
    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:629)
    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:232)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:153)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:508)
2
What were you doing to get this sexy piece of a stacktrace?rp.
Deploying and running a portlet (Spring MVC)...Christopher

2 Answers

6
votes

Stacktraces like this typically come from classes being on the classpath twice. I even saw "com.something.SomeClass cannot be cast to java.lang.Object" once - when someone managed to get two rt.jar on the classpath at the same time (ancient history).

Check for the servlet api or jsp api, those shouldn't be in your webapp, but only on the global classpath that tomcat (which seems to be what you're using) brings with it. If it's not that, check any other jars that contain classes that are also contained in the global classpath.

And based on Troubleshooting java.lang.AbstractMethodError in portlet development you really have some classpath issues.

2
votes

The problem is solved. As stated above, the problem was a 100% classpath issue. Though I scanned all the directories with jarscan, I couldn't find any redundancies.. It turned out, that my co-worker used many unnecessary JARs in his part, that unnecessarily were added to my WAR.

It's working now!

Thank you all, too ;-)