cancel
Showing results for 
Search instead for 
Did you mean: 

Bootstrap failure with java.sql.BatchUpdateException

pltim79
Champ in-the-making
Champ in-the-making
Hello,

I am attempting to get Alfresco running on a development machine with the following configuration:

jdk1.5.0_06
Tomcat 5.0.28,
jakarta-tomcat-5.0.28
alfresco-war-1.2.1

My paths appear to be set correctly and Tomcat is using the following driver:
mysql-connector-java-3.0.14-production-bin.jar


I get the following stack trace in Tomcat's log file during startup:

2006-05-10 15:07:29 StandardContext[/alfresco]Exception sending context destroyed event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'versionBootstrap' defined in class path resource [alfresco/core-services-context.xml]: Initialization of bean failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: Bootstrap failed
org.alfresco.error.AlfrescoRuntimeException: Bootstrap failed
   at org.alfresco.repo.version.VersionBootstrap.bootstrap(VersionBootstrap.java:103)
   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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1093)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1063)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
   at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
   at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
   at org.apache.catalina.core.StandardService.start(StandardService.java:480)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
   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:287)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: javax.transaction.RollbackException: Transaction didn't commit: Hibernate operation: Could not execute JDBC batch update; SQL [insert into node_status (change_txn_id, deleted, protocol, identifier, guid) values (?, ?, ?, ?, ?)]; null,  message from server: "Data too long for column 'deleted' at row 1"; nested exception is java.sql.BatchUpdateException: null,  message from server: "Data too long for column 'deleted' at row 1"
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:403)
   at org.alfresco.repo.version.VersionBootstrap.bootstrap(VersionBootstrap.java:95)
   … 40 more

I can see that the following tables have been created:
'applied_patch'
'child_assoc'
'externalkeys'
'node'
'node_aspects'
'node_assoc'
'node_perm_entry'
'node_permission'
'node_properties'
'node_status'
'permission_ref'
'recipient'
'store'
'version_count'
so database connectivity doesn't appear to be the problem - with the exception of the insert statement failure in the stack trace above.

I've also verified the following:
Character set: UTF8
Table type: INNODB

The only issue similar I've seen comes from:
http://forums.alfresco.com/viewtopic.php?t=1177&highlight=mysql5

One more thing - the field "deleted" in table "node_status" is created as a "bit(1)" datatype in MySQL 5.x - not sure if Alfresco creates this field as a different datatype in MySQL 4.1 and that's why it's failing.

Hopefully, this is something simple. Any assistance/suggestions/requests for more info is greatly appreciated!
3 REPLIES 3

pltim79
Champ in-the-making
Champ in-the-making
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html contains the following:

As of MySQL 5.0.3, a BIT data type is available for storing bit-field values. (Before 5.0.3, MySQL interprets BIT as TINYINT(1).)

Since I'm using MySQL 5.0.18 I've changed all BIT(1) column types to INTEGER(1) and the application starts up correctly.  Pasted below are the table alter scripts:

ALTER TABLE applied_patch MODIFY COLUMN was_executed INTEGER(1);
ALTER TABLE applied_patch MODIFY COLUMN succeeded INTEGER(1);
ALTER TABLE child_assoc MODIFY COLUMN isPrimary INTEGER(1);
ALTER TABLE node_perm_entry MODIFY COLUMN allowed INTEGER(1) NOT NULL;
ALTER TABLE node_permission MODIFY COLUMN inherits INTEGER(1) NOT NULL;
ALTER TABLE node_properties MODIFY COLUMN multi_valued INTEGER(1) NOT NULL;
ALTER TABLE node_properties MODIFY COLUMN boolean_value INTEGER(1);
ALTER TABLE node_status MODIFY COLUMN deleted INTEGER(1) NOT NULL;

derek
Star Contributor
Star Contributor
Hi,

Thank you for digging this out.  We have been testing on MySQL 5.0.20 for a while now and haven't seen the issue.  Could you try the later driver, perhaps?


mysql-connector-java-3.1.12-bin.jar

Regards

pltim79
Champ in-the-making
Champ in-the-making
Updating the driver to mysql-connector-java-3.1.12-bin.jar  has fixed this issue. Alfresco now deploys and runs as expected.

Thanks for your help!