0
votes

I have a number of portlets that work fine after a hot deploy, but do not work after restarting Liferay (auto-deploy). The only way I can get them to work again is by rebuilding and doing another hot deploy.

I have 3 different spring-mvc portlets (org.springframework.web.portlet.DispatcherPortlet). The simplest of the 3 has no issues on restart, while the other 2 do not work. All three created from the base project generated using Eclipse-LiferayIDE -> new spring-mvc-portlet liferay module.

Their web.xml, portlet.xml, liferay-portlet.xml, liferay-plugin-package.properties, portlet-application-context.xml and spring/application-context.xml, PortletViewController.java, files are all identical, aside from name changes.

My best guess is that it's some sort of class loading issue.

I've compared the dependencies of all 3.

                                                Working                           Fail1                                      Fail2
Dependency                                      Version       Scope    Exclusions Version       Scope    Exclusions          Version       Scope    Exclusions
org.springframework.spring-webmvc-portlet       4.1.9.RELEASE compile  --         4.1.9.RELEASE compile  --                  4.1.9.RELEASE compile  --
com.liferay.portal.com.liferay.portal.kernel    2.46.1        provided --         2.46.1        provided --                  2.46.1        provided --
javax.portlet.portlet-api                       3.0.0         provided --         3.0.0         provided --                  3.0.0         provided --
javax.servlet.javax.servlet-api                 3.1.0         provided --         3.1.0         provided --                  3.1.0         provided --
org.osgi.org.osgi.service.component.annotations 1.3.0         provided --         1.3.0         provided --                  1.3.0         provided --
org.slf4j.slf4j-log4j12                         1.7.22        provided --         1.7.22        provided --                  1.7.22        provided --
commons-lang.commons-lang                       --            --       --         2.6           compile  --                  --            --       --
com.liferay.portal.com.liferay.util.taglib      --            --       --         2.8.0         compile  --                  2.8.0         compile  --
javax.servlet.javax.servlet.jsp-api             --            --       --         2.3.1         provided --                  2.3.1         provided --
oracle.ojdbc6                                   --            --       --         11.2.0.3      provided --                  11.2.0.3      provided --
org.glassfish.web.jstl-impl                     --            --       --         1.2           provided jsp-api,servlet-api 1.2           provided jsp-api,servlet-api
org.hibernate.hibernate-core                    --            --       --         4.1.3.Final   compile  --                  --            --       --
org.codehaus.jackson.jackson-mapper-asl         --            --       --         --                                         1.9.13        compile  --

I suspect the problem to be with one of the overlapping dependencies between the 2 failing portlets.

com.liferay.portal.com.liferay.util.taglib
javax.servlet.javax.servlet.jsp-api
oracle.ojdbc6
org.glassfish.web.jstl-impl

Any idea if these dependencies would be causing an issue?

Here's the stack trace for the error generated. There are no errors during the initial auto-deploy, only after I navigate to a page where the portlet is used.

15:15:29,583 ERROR [ajp-nio-8009-exec-6][DispatcherPortlet:573] Could not complete request
org.springframework.web.portlet.NoHandlerFoundException: No handler found for portlet request: mode 'view', phase 'RENDER_PHASE', parameters map[[empty]]
    at org.springframework.web.portlet.DispatcherPortlet.noHandlerFound(DispatcherPortlet.java:1031)
    at org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:730)
    at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:536)
    at org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:483)
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
    at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletExceptionAdapter.service(ServletExceptionAdapter.java:76)
    at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
    at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
    at com.liferay.portal.osgi.web.wab.extender.internal.adapter.FilterExceptionAdapter.doFilter(FilterExceptionAdapter.java:46)
    at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
    at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
    at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
    at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
    at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:531)
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:606)
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:392)
    at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.render(MonitoringInvokerPortlet.java:265)
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1584)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at sun.reflect.GeneratedMethodAccessor671.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:286)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:283)
    at java.security.AccessController.doPrivileged(Native Method)
    .....

I've cut the trace short to fit the character limit.


Liferay Installation: Liferay 7 Tomcat Bundle (liferay-ce-portal-7.0-ga5)

1

1 Answers

0
votes

In this instance, the issue seems to have been resolved by completely removing these dependencies:

com.liferay.portal.com.liferay.util.taglib
org.glassfish.web.jstl-impl

I have been porting these portlets from Liferay 6.0.6, starting with no additional dependencies and adding them one by one as needed, so at some point something lead me to believe I needed them. Hopefully I don't.