留言板

Recover Liferay Application after DB is available

Ram A,修改在11 年前。

Recover Liferay Application after DB is available

Junior Member 帖子: 76 加入日期: 13-1-16 最近的帖子
Hi,

I am new to Liferay.
I am using lifera 6.0.6.

I am using SQL Server in my Liferay Application for DB.
My Application was unavailable because of DB is not available for long time.It is trying to connect to DB
and giving the connection timeout issue and my Application portal is down.

After sometime my DB connection is available and i checked my Application .But still it is not available eventhough DB is available and it is showing empty blank(white) screen.
I think It is trying to load the resouce files but failed to load init.vm file.

Below is the error stacktrace i am getting after the DB is avilable .

13:44:41,726 ERROR [ServletVelocityResourceListener:74] _SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm is not valid because does not map to a servlet context
13:44:41,727 ERROR [velocity:151] ResourceManager : unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm' in any resource loader.
13:44:41,728 ERROR [velocity:151] #parse(): cannot find template '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm', called at hondatheme_SERVLET_CONTEXT_/templates/portal_normal.vm[line 2, column 1]
13:44:41,729 ERROR [IncludeTag:334] Current URL /c/portal/layout?p_l_id=10160 generates exception: Unable to find resource '_SERVLET_CONTEXT_/html/themes/_unstyled/templates/init.vm'

13:44:41,730 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 com.liferay.portal.velocity.LiferayResourceManager.getResource(LiferayResourceManager.java:48)
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:166)
at com.liferay.portal.velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:176)
at com.liferay.portal.kernel.velocity.VelocityEngineUtil.mergeTemplate(VelocityEngineUtil.java:71)
at com.liferay.taglib.util.ThemeUtil.includeVM(ThemeUtil.java:330)
at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:76)
at com.liferay.taglib.theme.IncludeTag.include(IncludeTag.java:38)
at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:326)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:82)
at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_liferay_002dtheme_005finclude_005f1(portal_jsp.java:777)
at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_c_005fotherwise_005f0(portal_jsp.java:749)


After this i restarted the liferay server and then my Application is up.

Is it posible to implement a way such that there is no need of restarting the Liferay server after the DB connection is available again?

If possible can any body please help me implement a recovery mechanism after DB is available such that no need of restarting the server.


Thanks in advance
Ram A
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Recover Liferay Application after DB is available

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
From what I've experimented, unless you cluster you database server or make it fault tolerant, you'll need to restart liferay after database becomes available again.
Ram A,修改在11 年前。

RE: Recover Liferay Application after DB is available

Junior Member 帖子: 76 加入日期: 13-1-16 最近的帖子
Hitoshi Ozawa:
From what I've experimented, unless you cluster you database server or make it fault tolerant, you'll need to restart liferay after database becomes available again.


Hi Hitoshi,

Thanks for Reply.

As you mentioned ,may i know why we have to restart Liferay after database becomes available.
We are not modifying any files or property files .But once the database is available after connectivity issue it is not able to find/load the files like init.vm file.

Can you please let me know why it is not finding those files.



Thanks in advance
Ram A
Ram A,修改在11 年前。

RE: Recover Liferay Application after DB is available

Junior Member 帖子: 76 加入日期: 13-1-16 最近的帖子
Hitoshi Ozawa:
From what I've experimented, unless you cluster you database server or make it fault tolerant, you'll need to restart liferay after database becomes available again.



Hi Hitoshi,

Thanks for reply.

I am using Liferay 6.0.
Please let us know why we have to restart the server after DB is available again.
Does Custom theme causes this issue?
The properties files and other files were already loaded and application is running fine and once DB is unavilable and it is back it is trying to load the files like init.vm.

do we need to restart the server if we upgraded the liferay from 6.0 to 6.1?

Please help me.



Thanks in advance
Ram A
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Recover Liferay Application after DB is available

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
As Mika replied, this is just a connection pool issue which hibernate - liferay uses. It doesn't autoconnect by default.

Check the following page may help you. Search "autoReconnect"
http://www.mindfiresolutions.com/How-to-configure-C3P0-connection-pooling-in-Hibernate-1649.php
thumbnail
Mika Koivisto,修改在11 年前。

RE: Recover Liferay Application after DB is available

Liferay Legend 帖子: 1519 加入日期: 06-8-7 最近的帖子
Configure your connection pool so that it can recover from database outage.