AnsweredAssumed Answered

Error running FirstFoundationClient SDK example

Question asked by rohit_l on Jun 30, 2006
Latest reply on Jul 13, 2006 by jmliege
Hello All,

I am new to Alfresco. I have got past the stage of running Alfresco as a tomcat web application on a MySQL repository. I then proceeded to try my hand at working with Alfresco using Eclipse. I downloaded the Alfresco SDK projects and set them up in Eclipse. I have set the runtime Java option in Eclipse to my installed JRE version 5.

I tried running the "FirstFoundationClient" example and get a huge error. The program cant seem to get past even the first line:
"ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();"

Apparently the program expects some tables to be present in the repository d/b and is trying to alter them through the statements that come up first in the console output. It seems the tables aren't there and I haven't found any reference to them in the online documentation on running the SDK examples. I wonder if the example is not being able to connect to the MySQL d/b; but I have given the details of the database in the custom-repository.properties file as:

dir.root=./MySQL Datafiles
db.username=alfresco
db.password=alfresco
db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/alfresco

I wonder if the "dir.root" value is correct. Should it point to the directory on the file system where the MySQL repository data is stored? If for example my directory was on c:\dbdata, how would I give the value against "dir.root"? The error starts as follows:

10:52:35,796 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF3274173FF4 (child_node_id), add constraint FKC6EFFF3274173FF4 foreign key (child_node_id) references node (id)
10:52:35,796 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:35,859 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF328E50E582 (parent_node_id), add constraint FKC6EFFF328E50E582 foreign key (parent_node_id) references node (id)
10:52:35,859 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:35,921 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table node_aspects add index FK2B91A9DE7F2C8017 (node_id), add constraint FK2B91A9DE7F2C8017 foreign key (node_id) references node (id)
10:52:35,937 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:35,984 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table node_assoc add index FK5BAEF398B69C43F3 (source_node_id), add constraint FK5BAEF398B69C43F3 foreign key (source_node_id) references node (id)
10:52:35,984 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:36,062 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table node_assoc add index FK5BAEF398A8FC7769 (target_node_id), add constraint FK5BAEF398A8FC7769 foreign key (target_node_id) references node (id)
10:52:36,062 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:36,109 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table node_properties add index FKC962BF907F2C8017 (node_id), add constraint FKC962BF907F2C8017 foreign key (node_id) references node (id)
10:52:36,109 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:36,156 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table node_status add index FK38ECB8CF7F2C8017 (node_id), add constraint FK38ECB8CF7F2C8017 foreign key (node_id) references node (id)
10:52:36,156 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:36,218 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table store add index FK68AF8E122DBA5BA (root_node_id), add constraint FK68AF8E122DBA5BA foreign key (root_node_id) references node (id)
10:52:36,218 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table '.\alfresco\#sql-1a0_1.frm' (errno: 150)
10:52:38,609 ERROR [transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert "C:\DOCUME~1\rohitlal\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_source_41268.gif"  "C:\DOCUME~1\rohitlal\LOCALS~1\Temp\Alfresco\ImageMagickContentTransformer_init_target_41269.png"
Jun 30, 2006 10:52:39 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Jun 30, 2006 10:52:40 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
Jun 30, 2006 10:52:40 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Jun 30, 2006 10:52:41 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
10:52:41,562 ERROR [hibernate.util.JDBCExceptionReporter] Field 'guid' doesn't have a default value
Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: Bootstrap failed
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:427)
   at org.alfresco.repo.importer.ImporterBootstrap.onApplicationEvent(ImporterBootstrap.java:654)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:40)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:63)
Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [org.alfresco.repo.domain.hibernate.NodeImpl]; uncategorized SQLException for SQL [insert into node (protocol, identifier, uuid, type_qname, acl_id) values (?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1364]; Field 'guid' doesn't have a default value; nested exception is java.sql.SQLException: Field 'guid' doesn't have a default value
   at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:96)
   at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257)
   at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
   at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:411)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:370)
   at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:612)
   at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.newNode(HibernateNodeDaoServiceImpl.java:264)
   at org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.createStore(HibernateNodeDaoServiceImpl.java:167)
   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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(TransactionalDaoInterceptor.java:60)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy1.createStore(Unknown Source)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.createStore(DbNodeServiceImpl.java:184)
   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.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:213)
   at $Proxy2.createStore(Unknown Source)
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:343)
   … 8 more
Caused by: java.sql.SQLException: Field 'guid' doesn't have a default value
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
   at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1124)
   at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676)
   at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1166)
   at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1082)
   at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1067)
   at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
   at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
   at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
   at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
   at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
   at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
   at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
   at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
   at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:615)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)
   … 30 more

Outcomes