Hi Roger
Apologies for delay reply!
I am not sure on when the bootstrapping of the database happens? My understanding was DB automatically is getting refreshed.
Anyways, I had tested few things as per your suggestion by keeping server running for quite long time (say for an hour) and here are my observations:
1) By keeping server up for an hour and refreshing DB (by logging in to MYSQL and refreshing DB manually); I can able to shutdown alfresco server automatically using “alf_stop” script. Though it throws some error while stopping. Below are the server log details:
#############################################################################33
14:31:44,631 INFO [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
15:03:57,568 ERROR [org.springframework.web.context.support.XmlWebApplicationContext] Exception thrown from
ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: The org.alfresco.cache.sysAdminCache Cache is not alive.
at net.sf.ehcache.Cache.checkStatus(Cache.java:1588)
at net.sf.ehcache.Cache.get(Cache.java:774)
at net.sf.ehcache.Cache.get(Cache.java:755)
at org.alfresco.repo.cache.EhCacheAdapter.get(EhCacheAdapter.java:87)
at org.alfresco.repo.cache.TransactionalCache.get(TransactionalCache.java:347)
at org.alfresco.repo.transaction.TransactionServiceImpl.isReadOnly(TransactionServiceImpl.java:82)
at org.alfresco.repo.transaction.TransactionServiceImpl.getUserTransaction(TransactionServiceImpl.java:137)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:283)
at org.alfresco.repo.transaction.RetryingTransactionAdvice.invoke(RetryingTransactionAdvice.java:73)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy172.onShutdown(Unknown Source)
at org.alfresco.linkvalidation.LinkValidationServiceBootstrap.onShutdown(LinkValidationServiceBootstrap.java:62)
at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:73)
at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:676)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:651)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:336)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:74)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3805)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:893)
at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1180)
at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1151)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1055)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1067)
at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448)
at org.apache.catalina.core.StandardService.stop(StandardService.java:510)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
###################################################################################333333333
2) After stopping the server (automatically) I cannot further execute program as I have mentioned in my previous post. Program fails with error as mentioned below. The only remedy to this which I have at the moment is to drop DB, recreate it and clear contents inside alf_data directory and then successfully execute the program.
#############################################^^^^^^^^
18:28:14,304 WARN [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
18:28:17,351 WARN [alfresco.util.OpenOfficeConnectionTester] A connection to OpenOffice could not be established.
18:28:21,085 INFO [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
18:28:25,788 INFO [domain.schema.SchemaBootstrap] Executing database script C:\DOCUME~1\AMIT~1.KAR\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-14584.sql (Generated).
18:28:31,492 ERROR [domain.schema.SchemaBootstrap] Statement execution failed:
SQL: alter table alf_access_control_entry add index FKFFF41F99B25A50BF (authority_id), add constraint FKFFF41F99B25A50BF foreign key (authority_id) references alf_authority (recipient)
Error: Can't create table '.\alfresco\#sql-460_164.frm' (errno: 150)
File: C:\DOCUME~1\AMIT~1.KAR\LOCALS~1\Temp\Alfresco\AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-14584.sql
Line: 25
18:28:31,492 ERROR [domain.schema.SchemaBootstrap] Schema auto-update failed
java.sql.SQLException: Can't create table '.\alfresco\#sql-460_164.frm' (errno: 150)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
at com.mysql.jdbc.Statement.execute(Statement.java:692)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:700)
at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:675)
at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:485)
at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:767)
at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
at org.alfresco.sample.FirstJCRClient.main(FirstJCRClient.java:28)
Caught exception org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:815)
at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
at org.alfresco.sample.FirstJCRClient.main(FirstJCRClient.java:28)
Caused by: java.sql.SQLException: Can't create table '.\alfresco\#sql-460_164.frm' (errno: 150)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
at com.mysql.jdbc.Statement.execute(Statement.java:692)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:700)
at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:675)
at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:485)
at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:767)
… 10 more
#########################################################################################################
Please let me know if you need any more information on this from my side. My Conclusion: "Server stops but after that I cannot further execute programs unless I clean DB".
Thanks n reg-
Amit.