[JBoss JIRA] (GTNPORTAL-3564) ContainerLifecyclePlugin errors on shutdown
by Juraci Paixão Kröhling (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3564?page=com.atlassian.jira.pl... ]
Juraci Paixão Kröhling commented on GTNPORTAL-3564:
---------------------------------------------------
So, I'm not sure what could be done on this case. If I remember correctly, this happens only with H2 database, as it also traps the signal sent by Ctrl+C. One obvious solution is to add the flag ";DB_CLOSE_ON_EXIT=FALSE" to the JDBC URL. Another possible solution could be to catch this exception and ignore it at WSRP level, as there's not much that can be done at this point (ie, the server is shutting down and WSRP couldn't deregister the producer). A third solution is to dig into JCR and check what can be done there.
Ignoring the exception is bad, IMO, as it could affect real production databases. Digging into JCR could be a solution, but I'm not sure the effort is worth it, considering that H2 is not supposed to be used in production environments. So, I've prepared a PR with the first option, which seems to me to be the best solution for this case, at this time. If anyone disagrees, let me know :-)
https://github.com/gatein/gatein-portal/pull/921
> ContainerLifecyclePlugin errors on shutdown
> -------------------------------------------
>
> Key: GTNPORTAL-3564
> URL: https://issues.jboss.org/browse/GTNPORTAL-3564
> Project: GateIn Portal
> Issue Type: Bug
> Affects Versions: 3.8.9.Alpha01
> Reporter: Lucas Ponce
> Assignee: Juraci Paixão Kröhling
> Fix For: 3.8.9.Alpha03
>
> Attachments: server.log
>
>
> After shutdown a GateIn instance from command line using a CTRL+C signal we can see an Exception like this:
> {code}
> 11:48:19,555 WARN [exo.kernel.container.ExoContainer] (Thread-69) An error occurs with the ContainerLifecyclePlugin 'org.gatein.integration.wsrp.WSRPContainerLifecyclePlugin': java.lang.IllegalStateException: Cannot close the session as it hasn't been opened first!
> at org.gatein.wsrp.jcr.BaseChromatticPersister.getOpenedSessionOrFail(BaseChromatticPersister.java:145)
> at org.gatein.wsrp.jcr.BaseChromatticPersister.closeSession(BaseChromatticPersister.java:121)
> at org.gatein.wsrp.producer.config.JCRProducerConfigurationService.getPersistedLastModifiedForConfiguration(JCRProducerConfigurationService.java:135)
> at org.gatein.wsrp.producer.config.impl.AbstractProducerConfigurationService.getConfiguration(AbstractProducerConfigurationService.java:48)
> at org.gatein.wsrp.producer.WSRPProducerImpl.getProducerConfiguration(WSRPProducerImpl.java:346)
> at org.gatein.wsrp.producer.WSRPProducerImpl.getProducerRegistrationRequirements(WSRPProducerImpl.java:193)
> at org.gatein.wsrp.producer.WSRPProducerImpl.stop(WSRPProducerImpl.java:417)
> at org.gatein.integration.wsrp.WSRPServiceIntegration.stopProducer(WSRPServiceIntegration.java:397)
> at org.gatein.integration.wsrp.WSRPServiceIntegration.stopContainer(WSRPServiceIntegration.java:391)
> at org.gatein.integration.wsrp.WSRPContainerLifecyclePlugin.stopContainer(WSRPContainerLifecyclePlugin.java:39)
> at org.exoplatform.container.ExoContainer.stopContainerInternal(ExoContainer.java:332) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.ExoContainer.stop(ExoContainer.java:290) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.PortalContainer.stop(PortalContainer.java:690) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_67]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_67]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_67]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_67]
> at org.exoplatform.container.LifecycleVisitor.traverse(LifecycleVisitor.java:100) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.LifecycleVisitor.stop(LifecycleVisitor.java:179) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.ConcurrentPicoContainer.stop(ConcurrentPicoContainer.java:569) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.management.ManageableContainer.stop(ManageableContainer.java:266) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.ExoContainer.stop(ExoContainer.java:291) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.RootContainer.stop(RootContainer.java:1326) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.RootContainer$ShutdownThread$1.run(RootContainer.java:1316) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.RootContainer$ShutdownThread$1.run(RootContainer.java:1313) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.commons.utils.SecurityHelper.doPrivilegedAction(SecurityHelper.java:290) [exo.kernel.commons-2.4.10-GA.jar:2.4.10-GA]
> at org.exoplatform.container.RootContainer$ShutdownThread.run(RootContainer.java:1312) [exo.kernel.container-2.4.10-GA.jar:2.4.10-GA]
> {code}
> This behaviour appears randomly.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)