Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Ram A
Recover Liferay Application after DB is available
15 de febrero de 2013 6:42
Respuesta

Ram A

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 16 de enero de 2013

Mensajes recientes

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
Hitoshi Ozawa
RE: Recover Liferay Application after DB is available
15 de febrero de 2013 7:06
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

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
RE: Recover Liferay Application after DB is available
21 de febrero de 2013 6:41
Respuesta

Ram A

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 16 de enero de 2013

Mensajes recientes

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
RE: Recover Liferay Application after DB is available
6 de marzo de 2013 6:01
Respuesta

Ram A

Ranking: Junior Member

Mensajes: 76

Fecha de incorporación: 16 de enero de 2013

Mensajes recientes

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
Mika Koivisto
RE: Recover Liferay Application after DB is available
6 de marzo de 2013 15:19
Respuesta

Mika Koivisto

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 1498

Fecha de incorporación: 7 de agosto de 2006

Mensajes recientes

Configure your connection pool so that it can recover from database outage.
Hitoshi Ozawa
RE: Recover Liferay Application after DB is available
6 de marzo de 2013 15:30
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7990

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

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