Foros de discusión

Liferay cannot find theme resources after bad plugin deployment

Jen Fong, modificado hace 13 años.

Liferay cannot find theme resources after bad plugin deployment

New Member Mensajes: 10 Fecha de incorporación: 20/05/10 Mensajes recientes
Hi, there--

We have a custom theme created with the Plugins SDK and we have some portlets, also plugins.

Occasionally, if we deploy a portlet and then someone visits a page with that portlet on it in a very particular timeframe, notaly while the portlet is being hot-deployed and replaced in tomcat, something odd happens.

First, when that someone visits the page, the portlet reports "this portlet has been undeployed..". This is likely before the portlet is ready, however the portlet claims to finish deploying successfully, as we see the following in the logs:
12:59:54,452 INFO  [AutoDeployDir:183] Processing event-video-portlet-5.2.3.1.war
12:59:54,458 INFO  [PortletAutoDeployListener:77] Copying portlets for LIFERAY-PATH/deploy/event-video-portlet-5.2.3.1.war
  Expanding: LIFERAY-PATH/deploy/event-video-portlet-5.2.3.1.war into LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478
  Copying 1 file to LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478/WEB-INF
  Copying 1 file to LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478/WEB-INF/cl
asses
  Copying 1 file to LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478/WEB-INF/cl
asses
  Copying 1 file to LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478/META-INF
  Copying 41 files to LIFERAY-PATH/tomcat-6.0.18/webapps/event-video-portlet
  Copying 1 file to LIFERAY-PATH/tomcat-6.0.18/webapps/event-video-portlet
  Deleting directory LIFERAY-PATH/tomcat-6.0.18/temp/20101117125954478
12:59:54,659 INFO  [PortletAutoDeployListener:87] Portlets for /LIFERAY-PATH/depl
oy/event-video-portlet-5.2.3.1.war copied successfully. Deployment will start in
 a few seconds.
Nov 17, 2010 1:00:04 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/event-video-portlet]
13:00:04,305 INFO  [PortletHotDeployListener:381] Unregistering portlets for eve
nt-video-portlet
13:00:04,316 INFO  [PortletHotDeployListener:412] 1 portlet for event-video-port
let was unregistered
13:00:04,494 INFO  [PortletHotDeployListener:227] Registering portlets for event
-video-portlet
13:00:04,534 INFO  [PluginPackageUtil:1347] Checking for available updates
13:00:04,540 INFO  [PluginPackageUtil:1391] Finished checking for available upda
tes in 1 ms
13:00:04,608 INFO  [PortletHotDeployListener:346] 1 portlet for event-video-port
let is available for use


We see an error in the logs if we try to visit the page again, complaining that a jsp is not found, so obviously the portlet was not deployed correctly:

13:00:24,332 ERROR [PortletRequestDispatcherImpl:316] javax.servlet.ServletException: File "/videolist.jsp" not found


Then, somehow the entire site goes down, displaying only a blank white page for any url, and this is what is always found in our logs:

13:01:38,263 ERROR [ServletVelocityResourceListener:85] _SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm is not valid because  does not map to a servlet context
13:01:38,287 ERROR [velocity:151] ResourceManager : unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm' in any resource loader.
13:01:38,308 ERROR [velocity:151] #parse(): cannot find template '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm', called at msri-internal-theme_SERVLET_CONTEXT_/templates/portal_normal.vm[line 3, column 1]
13:01:38,327 ERROR [IncludeTag:79] Current URL /group/msri-internal/videopage generates exception: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm'
13:01:38,360 ERROR [IncludeTag:165] org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm'
        at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:483)
        at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
        at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
        at org.apache.velocity.runtime.directive.Parse.render(Parse.java:198)
        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.Template.merge(Template.java:328)
        at org.apache.velocity.Template.merge(Template.java:235)
        at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
        at com.liferay.portal.velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:179)
        at com.liferay.portal.velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:150)
        at com.liferay.portal.kernel.velocity.VelocityEngineUtil.mergeTemplate(VelocityEngineUtil.java:75)
        at com.liferay.taglib.util.ThemeUtil.includeVM(ThemeUtil.java:201)
        at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:68)
        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:59)
        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:374)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
13:01:43,264 ERROR [ServletVelocityResourceListener:85] _SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm is not valid because  does not map to a servlet context
13:01:43,290 ERROR [velocity:151] ResourceManager : unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm' in any resource loader.
13:01:43,310 ERROR [velocity:151] #parse(): cannot find template '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm', called at msri-theme_SERVLET_CONTEXT_/templates/portal_normal.vm[line 3, column 1]
13:01:43,328 ERROR [IncludeTag:79] Current URL /web/msri generates exception: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm'
...


At this point the only solution is to restart Liferay.

We are using 5.2.3 still.

Has anyone seen this particular chain of events? A bad deployment of a portlet taking down the whole site because liferay can no longer find the theme resources?

We *think* it only happens when someone visits the page while the portlet is being deployed, We also thought at one point that if we re-deploy the portlet too quickly after being deployed [e.g. running "ant deploy" within a second or two of being run again], we see the same problem. It's fairly consistent that this blank page effect only comes into play after a bad deployment; we never 'randomly' get this blank page problem--it's always after a hot-deploy of a portlet or the theme itself [although we haven't had to hot-deploy the theme since we finalized it].

But we can't time it exactly right to recreate the problem 100%.

Can anyone help me decipher exactly what is causing the problem?

This happens to multiple portlets, not just this particular one, and sometimes the portlets we are deploying are incredibly simple, sometimes just the sample portlet with only the code provided in the portlet.zip file, so we are assuming it is not the portlet code in particular. The theme has been pretty stable for quite some time; we never see theme-related errors/exceptions like this otherwise.

Thanks for any help.
Jen Fong, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

New Member Mensajes: 10 Fecha de incorporación: 20/05/10 Mensajes recientes
http://issues.liferay.com/browse/LPS-12683
Seems to be related, however no clarification on an "incorrect" portlet is made with that issue and our portlets only cause this issue under certain circumstances--so is it really an "incorrect" portlet if it successfully deploys 90% of the time?

Similar to Dave Weitzel's comment there, occasionally all we are doing is making minor changes to a jsp as well, so it's still not clear what the cause is.
thumbnail
ilke Muhtaroglu, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

Regular Member Mensajes: 226 Fecha de incorporación: 12/05/09 Mensajes recientes
did you find a solution I faced the similar case ...



14:05:28,234 INFO  [ThemeHotDeployListener:90] 1 theme for EPDK-Theme is available for use
14:05:35,769 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/ui/success/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,772 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/ui/success/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,776 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/portlet/communities/edit_pages.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,783 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/form/start.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,788 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,792 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,795 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,797 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,800 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,803 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,805 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,808 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,810 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,814 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,817 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,820 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,823 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,827 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,833 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/portlet/communities/edit_pages_look_and_feel.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,840 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,843 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/input/page.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,849 ERROR [IncludeTag:423] Current URL /en/web/guest/home?p_p_id=88&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_88_struts_action=%2Flayout_management%2Fedit_pages&_88_tabs1=public-pages&_88_tabs2=look-and-feel&_88_tabs3=page&_88_redirect=%2Fen%2Fweb%2Fguest%2Fhome&_88_backURL=%2Fen%2Fweb%2Fguest%2Fhome&_88_groupId=10162&_88_tabs4=regular-browsers&_88_selPlid=0 generates exception: null
14:05:35,852 ERROR [IncludeTag:154] java.lang.NullPointerException
		at org.apache.jsp.html.portlet.communities.edit_005fpages_005flook_005fand_005ffeel_jsp._jspService(edit_005fpages_005flook_005fand_005ffeel_jsp.java:1125)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:340)
	at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:415)
	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:106)
	at org.apache.jsp.html.portlet.communities.edit_005fpages_jsp._jspx_meth_liferay_002dutil_005finclude_005f5(edit_005fpages_jsp.java:4604)
	at org.apache.jsp.html.portlet.communities.edit_005fpages_jsp._jspService(edit_005fpages_jsp.java:3186)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:340)
	at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:415)
	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:106)
	at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:4117)
	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)

14:05:35,853 ERROR [ServletVelocityResourceListener:74] EPDK-Theme_SERVLET_CONTEXT_/templates//html/taglib/aui/form/end.vm is not valid because EPDK-Theme does not map to a servlet context
14:05:35,860 ERROR [ThemeUtil:300] EPDK-Theme_SERVLET_CONTEXT_/templates/portlet.vm does not exist
14:05:35,864 ERROR [ThemeUtil:300] EPDK-Theme_SERVLET_CONTEXT_/templates/portal_normal.vm does not exist

thumbnail
ilke Muhtaroglu, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

Regular Member Mensajes: 226 Fecha de incorporación: 12/05/09 Mensajes recientes
I solved it by creating a template theme by plugin-sdk 6.05
XX Brain, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

Junior Member Mensajes: 78 Fecha de incorporación: 2/03/11 Mensajes recientes
This works fine. Thank you.
Dhana Sekar, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

New Member Mensajes: 7 Fecha de incorporación: 14/02/11 Mensajes recientes
how to solve the theme problem as you faced the theme problem?

can any one tell me what is the problem? and how to solve the theme problem?
It will be very useful for me.
Thank you,
S.Dhanasekar.
thumbnail
ilke Muhtaroglu, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

Regular Member Mensajes: 226 Fecha de incorporación: 12/05/09 Mensajes recientes
It is like if you face a problem due to version upgrade

Then you should generate first the plugin at the plugin-sdk, and then merge your previous code into this new generated plugin. This should solve any version upgrade.

thanks.

ilke
Dhana Sekar, modificado hace 13 años.

RE: Liferay cannot find theme resources after bad plugin deployment

New Member Mensajes: 7 Fecha de incorporación: 14/02/11 Mensajes recientes
How to change liferay top page and bottom page with user defined jsp files?
How to change VM file?


Thanks in Advance,
Dhanasekar.S
Víctor Salvans Montesó, modificado hace 10 años.

RE: Liferay cannot find theme resources after bad plugin deployment

New Member Mensajes: 7 Fecha de incorporación: 4/12/12 Mensajes recientes
I know it's old, but it may help someone.

This error happenned to me after change instanciable portlet property over already deployed portlets to test them.

I've changed these properties back and I had no more errors.

For me wasn't important whether these portlets were istanciable or not, but if it's the case I guess it must remove these portlets from their layouts, redeploy and "rei-nsert" back to the layouts.

Regards.