Foren

LR6: after an eclipse restart occurs runtime error - init.vm is not valid

thumbnail
Alex Mol, geändert vor 13 Jahren.

LR6: after an eclipse restart occurs runtime error - init.vm is not valid

New Member Beiträge: 4 Beitrittsdatum: 13.07.10 Neueste Beiträge
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?
thumbnail
Corné Aussems, geändert vor 13 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Liferay Legend Beiträge: 1313 Beitrittsdatum: 03.10.06 Neueste Beiträge
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
thumbnail
Alex Mol, geändert vor 13 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beiträge: 4 Beitrittsdatum: 13.07.10 Neueste Beiträge
Thank you Corné
thumbnail
Denis Signoretto, geändert vor 13 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Expert Beiträge: 375 Beitrittsdatum: 21.04.09 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beiträge: 20 Beitrittsdatum: 28.08.09 Neueste Beiträge
I'm experiencing the same issue with a custom theme. My theme so far is very light:
  • Created a new theme using the Liferay IDE
  • 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, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Regular Member Beiträge: 102 Beitrittsdatum: 16.08.11 Neueste Beiträge
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
thumbnail
Corné Aussems, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Liferay Legend Beiträge: 1313 Beitrittsdatum: 03.10.06 Neueste Beiträge
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,\
[color=#fc0839][b]        com.liferay.portal.deploy.hot.LayoutTemplateHotDeployListener,\[/b][/color]
        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,\
[color=#fc0839][b]        com.liferay.portal.deploy.hot.LayoutTemplateHotDeployListener,\[/b][/color]
        com.liferay.portal.deploy.hot.MessagingHotDeployListener
neelam bhandari, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Regular Member Beiträge: 102 Beitrittsdatum: 16.08.11 Neueste Beiträge
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
thumbnail
Corné Aussems, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Liferay Legend Beiträge: 1313 Beitrittsdatum: 03.10.06 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

Regular Member Beiträge: 102 Beitrittsdatum: 16.08.11 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beitrag: 1 Beitrittsdatum: 12.01.12 Neueste Beiträge
Hey Horn,
I added the properties in portal-ext.properties, but the problem is not solved.
If you have any other solutions?!!!
Аdil KABBALi
thumbnail
Chris Miller, geändert vor 12 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beiträge: 3 Beitrittsdatum: 30.03.10 Neueste Beiträge
Changing the order does not fix this.
Harilal A S, geändert vor 11 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beitrag: 1 Beitrittsdatum: 06.06.12 Neueste Beiträge
This type of theme errors are commonly getting while trying to implement customized themes. In the case of customized theme, check the content of init_cutom.vm (in \templates) file. If there is no content type the following


#set ($show_toggle_controls = false)

#set ($liferay_toggle_controls = $sessionClicks.get($request, "liferay_toggle_controls", "visible"))

#if ($liferay_toggle_controls == "visible")
#set ($css_class = $css_class + " controls-visible")
#else
#set ($css_class = $css_class + " controls-visible")
#end

and then save the file. rebuild the theme. Then deploy the new theme and restart the server. hope this will solve the error...
Rui Horta, geändert vor 11 Jahren.

RE: LR6: after an eclipse restart occurs runtime error - init.vm is not val

New Member Beiträge: 9 Beitrittsdatum: 13.09.10 Neueste Beiträge
Hi guys,

We have the same problem and the workaround that we use was:

1.Create a public hidden page with the default liferay theme;
/web/guest/blank_page for example

2.When this problem happens, we acess that page directly
http://localhost:8080/web/guest/blank_page

3.You can use again the portal until the next time that the problem happears;

Inicially we restart the server but one day we check that acessing a page with default liferay theme resolve the problem, so until have a solution for this we use always this workaround.

Regards,