Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Alex Mol
LR6: after an eclipse restart occurs runtime error - init.vm is not valid
October 4, 2010 8:27 AM
Answer

Alex Mol

Rank: New Member

Posts: 4

Join Date: July 13, 2010

Recent Posts

i've created a custom theme project in lifray ide for Eclipse and copied css-, images-, js- and templates- folders from classic-theme to <my_custom_theme_folder>/_diffs and then i've modified custom.css, portal_normal.vm (added some html tags) and some images. That was succesfully deployed and correctly functional until the Eclipse restart, after that do the page refresh in my browser (ie8) nothing, but occurs the following exception:

14:57:32,451 ERROR [ServletVelocityResourceListener:74] _SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm is not valid because  does not map to a servlet context
14:57:32,453 ERROR [velocity:151] ResourceManager : unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm' in any resource loader.
14:57:32,453 ERROR [velocity:151] #parse(): cannot find template '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm', called at wess-2-guest-theme_SERVLET_CONTEXT_/templates/portal_normal.vm[line 3, column 1]
14:57:32,454 ERROR [IncludeTag:231] Current URL /web/guest generates exception: Unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm'
14:57:32,456 ERROR [IncludeTag:154] 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:155)
    at com.liferay.portal.velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:165)
    at com.liferay.portal.kernel.velocity.VelocityEngineUtil.mergeTemplate(VelocityEngineUtil.java:71)
    at com.liferay.taglib.util.ThemeUtil.includeVM(ThemeUtil.java:329)
    at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:75)
    at com.liferay.taglib.theme.IncludeTag.include(IncludeTag.java:38)
    at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:223)
    at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:58)
    at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_liferay_002dtheme_005finclude_005f1(portal_jsp.java:822)
    at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_c_005fotherwise_005f0(portal_jsp.java:794)
    at org.apache.jsp.html.common.themes.portal_jsp._jspService(portal_jsp.java:730)


A restart the server without of restart Eclipse clears the problem temporally, but i must every time restart the server if i restart the eclipse.
Is there any solution for it?
Corné Aussems
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
October 5, 2010 4:10 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1106

Join Date: October 3, 2006

Recent Posts

There is a lot of talk about this issue

I think this ticket is about the same and this

and this has some hints on a solution
Alex Mol
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
October 6, 2010 12:23 AM
Answer

Alex Mol

Rank: New Member

Posts: 4

Join Date: July 13, 2010

Recent Posts

Thank you Corné
Denis Signoretto
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
January 5, 2011 3:41 AM
Answer

Denis Signoretto

Rank: Junior Member

Posts: 88

Join Date: April 21, 2009

Recent Posts

Hi Alex,

I'm facing with the same issue (I'm working with Liferay IDE 1.1 and LR6 with plugins-sdk-6.0.5). I have minimized the problem opening the server (F3) and disabling "Update context path" under the "Publisihng" options.

If it could help. In the mean while, did you find a soloution?

Thanks,
Denis.
Shawn G
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
January 28, 2011 7:20 AM
Answer

Shawn G

Rank: New Member

Posts: 20

Join Date: August 28, 2009

Recent Posts

I'm experiencing the same issue with a custom theme. My theme so far is very light:
  1. Created a new theme using the Liferay IDE
  2. Imported the Classic theme's diff folders (to give me a better starting point for customization)

As others have reported, the error is generated when I first start Eclipse and launch the Liferay server. Restarting the Liferay server (but not Eclipse) resolves the issue. The Update Context Path workaround that Denis suggested unfortunately did not work for me.

One thing I notice in the console log was that upon the first start of the server, I see the following log entries:

Jan 28, 2011 3:02:49 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 57493 ms
15:02:49,571 WARN  [ThemeLocalServiceImpl:121] No theme found for specified theme id new_WAR_newtheme. Returning the default theme.
15:02:49,572 WARN  [ThemeLocalServiceImpl:121] No theme found for specified theme id new_WAR_newtheme. Returning the default theme.

A few lines later, the logs show all of my plugins being undeployed, then redeployed (I only included the lines concerning the theme plugin below):

Jan 28, 2011 3:02:59 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/new-theme]
Jan 28, 2011 3:02:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor new-theme.xml
Jan 28, 2011 3:02:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\liferay-portal-6.0.5\tomcat-6.0.26\webapps\new-theme inside the host appBase has been specified, and will be ignored
15:02:59,849 INFO  [ThemeHotDeployListener:78] Registering themes for new-theme
15:03:01,916 INFO  [ThemeHotDeployListener:89] 1 theme for new-theme is available for use


At this point, the portal won't work as the theme generates the error. Restarting the server, everything works fine and the last line in the log is "Server startup..."

I have no idea why upon the first startup my plugins are being redeployed, and why it wouldn't do it on the second startup, but it sure seems like this is related to the problem.
neelam bhandari
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
December 13, 2011 6:26 AM
Answer

neelam bhandari

Rank: Junior Member

Posts: 99

Join Date: August 16, 2011

Recent Posts

Hi all,
I am also facing this problem 14:23:11,849 ERROR [ServletVelocityResourceListener:74] _SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm is not valid because does not map to a servlet context. I am working on Liferay 6 and spring portlets. Is there any solution for this problem except from restarting the server?

Many thanks
Neelam Bhandari
Corné Aussems
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
December 13, 2011 6:56 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1106

Join Date: October 3, 2006

Recent Posts

change the order of listeners in your properties;


##
## Hot Deploy
##

    #
    # Input a list of comma delimited class names that implement
    # com.liferay.portal.kernel.deploy.hot.HotDeployListener. These classes are
    # used to process the deployment and undeployment of WARs at runtime.
    #
    # Note: PluginPackageHotDeployListener must always be first.
    #
    hot.deploy.listeners=\
        com.liferay.portal.deploy.hot.PluginPackageHotDeployListener,\
        com.liferay.portal.deploy.hot.ExtHotDeployListener,\
        com.liferay.portal.deploy.hot.HookHotDeployListener,\
        com.liferay.portal.deploy.hot.LayoutTemplateHotDeployListener,\
        com.liferay.portal.deploy.hot.PortletHotDeployListener,\
        com.liferay.portal.deploy.hot.ThemeHotDeployListener,\
        com.liferay.portal.deploy.hot.ThemeLoaderHotDeployListener,\
        com.liferay.portal.deploy.hot.MessagingHotDeployListener


to


   hot.deploy.listeners=\
        com.liferay.portal.deploy.hot.PluginPackageHotDeployListener,\
        com.liferay.portal.deploy.hot.ExtHotDeployListener,\
        com.liferay.portal.deploy.hot.HookHotDeployListener,\
        com.liferay.portal.deploy.hot.PortletHotDeployListener,\
        com.liferay.portal.deploy.hot.ThemeHotDeployListener,\
        com.liferay.portal.deploy.hot.ThemeLoaderHotDeployListener,\
        com.liferay.portal.deploy.hot.LayoutTemplateHotDeployListener,\
        com.liferay.portal.deploy.hot.MessagingHotDeployListener
neelam bhandari
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
December 13, 2011 7:32 AM
Answer

neelam bhandari

Rank: Junior Member

Posts: 99

Join Date: August 16, 2011

Recent Posts

Hey Corne,
Many thanks for your reply. I have already added these lines in my portal-ext.properties file.do I need to change portal.properties file too?

Neelam Bhandari
Corné Aussems
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
December 13, 2011 7:51 AM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1106

Join Date: October 3, 2006

Recent Posts

neelam bhandari:
Hey Corne,
Many thanks for your reply. I have already added these lines in my portal-ext.properties file.do I need to change portal.properties file too?

Neelam Bhandari


portal-ext.properties should be set , portal.properties is in the portal.impl.jar and never needs to be set.
neelam bhandari
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
December 13, 2011 8:00 AM
Answer

neelam bhandari

Rank: Junior Member

Posts: 99

Join Date: August 16, 2011

Recent Posts

I have already implemented this solution but no success. Also have done this

a possible temporary fix is to copy the "init.vm" inside your custom theme _diffs directory and point to it using the following code:

#parse ("$fullTemplatesPath/init.vm")

in my custom theme.Any other solution?

Thanks
Neelam
Adil KABBALI
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
January 16, 2012 6:48 AM
Answer

Adil KABBALI

Rank: New Member

Posts: 1

Join Date: January 12, 2012

Recent Posts

Hey Horn,
I added the properties in portal-ext.properties, but the problem is not solved.
If you have any other solutions?!!!
Аdil KABBALi
Chris Miller
RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val
February 22, 2012 1:48 PM
Answer

Chris Miller

Rank: New Member

Posts: 3

Join Date: March 30, 2010

Recent Posts

Changing the order does not fix this.