[Cyclos 3.7.1] Testbed - Troubles with DB

Bug and problem reporting

Moderators: hugo, alexandre, rmvanarkel

Post Reply
mraxai
Posts: 18
Joined: Mon Aug 01, 2011 2:28 pm

[Cyclos 3.7.1] Testbed - Troubles with DB

Post by mraxai »

Hi All,

we've followed all the guides related to functional testing, we're trying to run the first db-test and we get the following output (error in bold):

Code: Select all

2012-12-21 11:26:05 INFO  Initializing ...
2012-12-21 11:26:05 INFO  Log file: log/cyclos3_testbed.log
2012-12-21 11:26:05 INFO  
2012-12-21 11:26:05 INFO  ######## Cyclos properties ######## 
2012-12-21 11:26:05 INFO  	hibernate.connection.url = jdbc:mysql://10.0.2.37/cyclos
2012-12-21 11:26:05 INFO  
2012-12-21 11:26:05 INFO  ******** Testbed properties ******** 
2012-12-21 11:26:05 INFO  	members = 1000.0 / 1000.0
2012-12-21 11:26:05 INFO  	membersBufferSize = 50
2012-12-21 11:26:05 INFO  	imagesPerMember = 0.0 / 0.0
2012-12-21 11:26:05 INFO  	adsPerMember = 0.0 / 0.0
2012-12-21 11:26:05 INFO  	imagesPerAd = 0.0 / 0.0
2012-12-21 11:26:05 INFO  	transactionsPerMember = 1.0 / 2.0
2012-12-21 11:26:05 INFO  	initialCredit = 1000000.0 / 1000000.0
2012-12-21 11:26:05 INFO  	creditLimit = 0.0 / 0.0
2012-12-21 11:26:05 INFO  	transactionAmount = 10.0 / 100.0
2012-12-21 11:26:05 INFO  	createDatabase = true
2012-12-21 11:26:05 INFO  	createMemberAccounts = true
2012-12-21 11:26:05 INFO  	groupIds = [5]
2012-12-21 11:26:05 INFO  	debitAccountIds = [1]
2012-12-21 11:26:05 INFO  	memberAccountTypeIds = [5]
2012-12-21 11:26:05 INFO  	transferTypeId = 13
2012-12-21 11:26:05 INFO  	customFieldValuesGens = {}
2012-12-21 11:26:05 INFO  	adCategories = null
2012-12-21 11:26:05 INFO  ************************************ 
2012-12-21 11:26:05 INFO  
2012-12-21 11:26:05 WARN  To generate test data, the current database at 'jdbc:mysql://10.0.2.37/cyclos' will be removed. Ensure the database exists before proceding.
2012-12-21 11:26:05 WARN  Are you sure to continue? 
y
2012-12-21 11:26:30 INFO  Creating database...
2012-12-21 11:27:09 INFO  Database created
2012-12-21 11:27:19 INFO  Initilization took 0:01:13.827 (hours:minutes:seconds.milliseconds)
2012-12-21 11:27:19 INFO  Advertisements will be created for all categories.
2012-12-21 11:27:19 INFO  Members that will be generated by each group (<groupId, members_count>): <5, 1000>
2012-12-21 11:27:20 ERROR Error generating the database
[b]java.lang.IllegalArgumentException: Group with id '5' not found[/b]
	at nl.strohalm.cyclos.testbed.TestBed.createMembersByGroup(TestBed.java:383)
	at nl.strohalm.cyclos.testbed.TestBed.createMembers(TestBed.java:373)
	at nl.strohalm.cyclos.testbed.TestBed.access$500(TestBed.java:113)
	at nl.strohalm.cyclos.testbed.TestBed$3.doInTransactionWithoutResult(TestBed.java:240)
	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:242)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:236)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThreadWithResult(TransactionHelperImpl.java:236)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThread(TransactionHelperImpl.java:197)
	at nl.strohalm.cyclos.testbed.TestBed.execute(TestBed.java:234)
	at nl.strohalm.cyclos.testbed.TestBed.main(TestBed.java:133)
Do you have any idea why this happens? How come we get java.lang.IllegalArgumentException ?


Thanks in advance
Last edited by mraxai on Fri Dec 21, 2012 2:26 pm, edited 1 time in total.

alexandre
Posts: 913
Joined: Wed Sep 06, 2006 9:06 am

Re: [Cyclos 3.7.1] Testbed - GroupID 5 not found

Post by alexandre »

Hi,

Probably your mysql was not in the default config, maybe the auto increment parameter are different. Because these your database may have the group, account and transactions with different ids.
You will need to make a select on your database to math what is the correct ids and put in the testbed config file.
Use:
select id, name from account_types;
and fill the correspondent parameters with debit and member account:
#cyclos.testbed.debitAccountIds=1
#cyclos.testbed.memberAccountTypeIds=5

select id, name from groups;
And fill the parameter with the full member group id.
#cyclos.testbed.groupIds=5

select id, name from transfer_types;
And fill with the trade transfer id.
#cyclos.testbed.transferTypeId=13

Regards
Alexandre Caurrinhos
Cyclos development team.

mraxai
Posts: 18
Joined: Mon Aug 01, 2011 2:28 pm

Re: [Cyclos 3.7.1] Testbed - GroupID 5 not found

Post by mraxai »

Hi Alex,

we've solved the issue. Please make sure the cyclos-testbed.properties gets updated. The IDs are partly not updated:
1. groupID
2. transferTypeId
3. accountTypeId

Hope this helps,
mraxai

mraxai
Posts: 18
Joined: Mon Aug 01, 2011 2:28 pm

Re: [Cyclos 3.7.1] Testbed - GroupID 5 not found

Post by mraxai »

Hi all,

we've being working the whole day trying to run a test on a generated DB.
We managed to create users, ads, transactions etc
But as soon as we connect the db to a cyclos instance, Tomcat crashes and Catalina logs follows:

Code: Select all

nl.strohalm.cyclos.entities.exceptions.DaoException: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [nl.strohalm.cyclos.entities.customization.translationMessages.TranslationMessage]; uncategorized SQLException for SQL [insert into translation_messages (msg_key, value) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:177)
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:155)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.insertAll(TranslationMessageServiceImpl.java:283)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.importNewAndModifiedProperties(TranslationMessageServiceImpl.java:248)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.importFromProperties(TranslationMessageServiceImpl.java:116)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.initializeService(TranslationMessageServiceImpl.java:125)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$1$1.run(TaskRunnerImpl.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at nl.strohalm.cyclos.utils.access.LoggedUser.runAsSystem(LoggedUser.java:303)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$1.doInTransactionWithoutResult(TaskRunnerImpl.java:142)
	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:242)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:236)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThreadWithResult(TransactionHelperImpl.java:236)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThread(TransactionHelperImpl.java:197)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl.doRunInitialization(TaskRunnerImpl.java:135)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$InitializationThreads.process(TaskRunnerImpl.java:63)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$InitializationThreads.process(TaskRunnerImpl.java:55)
	at nl.strohalm.cyclos.utils.ParallelTask$1.process(ParallelTask.java:61)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread$1.call(WorkerThreads.java:71)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread$1.call(WorkerThreads.java:67)
	at nl.strohalm.cyclos.utils.access.LoggedUser.runAsSystem(LoggedUser.java:303)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread.run(WorkerThreads.java:67)
Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [nl.strohalm.cyclos.entities.customization.translationMessages.TranslationMessage]; uncategorized SQLException for SQL [insert into translation_messages (msg_key, value) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
	at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:165)
	... 23 more
Caused by: java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2345)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2330)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
	at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:93)
	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:56)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2346)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2846)
	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
	at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
	at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
	at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
	at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:686)
	at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:1)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
	... 26 more
18:08:59,779 ERROR LifecycleListener - Error on LifecycleListener.contextInitialized()
nl.strohalm.cyclos.entities.exceptions.DaoException: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [nl.strohalm.cyclos.entities.customization.translationMessages.TranslationMessage]; uncategorized SQLException for SQL [insert into translation_messages (msg_key, value) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:177)
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:155)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.insertAll(TranslationMessageServiceImpl.java:283)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.importNewAndModifiedProperties(TranslationMessageServiceImpl.java:248)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.importFromProperties(TranslationMessageServiceImpl.java:116)
	at nl.strohalm.cyclos.services.customization.TranslationMessageServiceImpl.initializeService(TranslationMessageServiceImpl.java:125)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$1$1.run(TaskRunnerImpl.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at nl.strohalm.cyclos.utils.access.LoggedUser.runAsSystem(LoggedUser.java:303)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$1.doInTransactionWithoutResult(TaskRunnerImpl.java:142)
	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:242)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl$1.doInTransaction(TransactionHelperImpl.java:236)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThreadWithResult(TransactionHelperImpl.java:236)
	at nl.strohalm.cyclos.utils.TransactionHelperImpl.runInCurrentThread(TransactionHelperImpl.java:197)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl.doRunInitialization(TaskRunnerImpl.java:135)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$InitializationThreads.process(TaskRunnerImpl.java:63)
	at nl.strohalm.cyclos.utils.tasks.TaskRunnerImpl$InitializationThreads.process(TaskRunnerImpl.java:55)
	at nl.strohalm.cyclos.utils.ParallelTask$1.process(ParallelTask.java:61)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread$1.call(WorkerThreads.java:71)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread$1.call(WorkerThreads.java:67)
	at nl.strohalm.cyclos.utils.access.LoggedUser.runAsSystem(LoggedUser.java:303)
	at nl.strohalm.cyclos.utils.WorkerThreads$WorkerThread.run(WorkerThreads.java:67)
Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [nl.strohalm.cyclos.entities.customization.translationMessages.TranslationMessage]; uncategorized SQLException for SQL [insert into translation_messages (msg_key, value) values (?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
	at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
	at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)
	at nl.strohalm.cyclos.dao.BaseDAOImpl.insert(BaseDAOImpl.java:165)
	... 23 more
Caused by: java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD ba...' for column 'value' at row 1
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2624)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2127)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2427)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2345)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2330)
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
	at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:93)
	at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:56)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2346)
	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2846)
	at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
	at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
	at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
	at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
	at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:713)
	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
	at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
	at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:686)
	at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:1)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
	... 26 more
Do you have any ideas why this happens?

Thanks in advance,
M

Post Reply