MySQL Migration in 3.0 GA version

Forum for questions and issues related to 3.0 migration.

Those wishing to upgrade should start by looking at the migration documents published on the Broadleaf Commerce documentation site.

Moderator: jocanas

Sambhav
Newbie
Newbie
Posts: 10
Joined: Wed Mar 20, 2013 5:55 am

MySQL Migration in 3.0 GA version

Postby Sambhav » Mon Jul 08, 2013 1:58 pm

Hi

I am using 3.0 GA version of broadleaf.
After following instruction at http://docs.broadleafcommerce.org/current/Switch-To-MySQL-Tutorial.html,

I am getting these errors:-

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'broadleaf.blc_sku' doesn't exist
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'system_sequences' in information_schema
    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '-1' for key 'PRIMARY'

this is how my common-shared.properties file looks like:-

Code: Select all

# Settings for the default persistence unit
blPU.hibernate.hbm2ddl.auto=create
#blPU.hibernate.dialect=org.hibernate.dialect.HSQLDialect
blPU.hibernate.show_sql=true
blPU.hibernate.cache.use_second_level_cache=true
blPU.hibernate.cache.use_query_cache=true
blPU.hibernate.hbm2ddl.import_files=null

# Settings for the CMS storage persistence unit
blCMSStorage.hibernate.hbm2ddl.auto=create
#blCMSStorage.hibernate.dialect=org.hibernate.dialect.HSQLDialect
blCMSStorage.hibernate.show_sql=false
blCMSStorage.hibernate.cache.use_second_level_cache=true
blCMSStorage.hibernate.cache.use_query_cache=true
blCMSStorage.hibernate.hbm2ddl.import_files=null


# Settings for the secure persistence unit
blSecurePU.hibernate.hbm2ddl.auto=create
#blSecurePU.hibernate.dialect=org.hibernate.dialect.HSQLDialect
blSecurePU.hibernate.show_sql=true
blSecurePU.hibernate.cache.use_second_level_cache=false
blSecurePU.hibernate.cache.use_query_cache=false
blSecurePU.hibernate.hbm2ddl.import_files=null

auto.correct.sequence.generator.inconsistencies=true

# ##################################### #
# Thymeleaf View Resolver               #
# ##################################### #

thymeleaf.view.resolver.cache=true

blPU.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
blSecurePU.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
blCMSStorage.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect



Plese help me to overcome these.

Thanks

phillipuniverse
Team Member
Team Member
Posts: 1563
Joined: Tue Dec 20, 2011 12:11 pm

Re: MySQL Migration in 3.0 GA version

Postby phillipuniverse » Mon Jul 08, 2013 2:15 pm

Check to make sure that the Hibernate dialect is not being overridden in development-shared.properties or development.properties.

Sambhav
Newbie
Newbie
Posts: 10
Joined: Wed Mar 20, 2013 5:55 am

Re: MySQL Migration in 3.0 GA version

Postby Sambhav » Tue Jul 09, 2013 11:36 am

Hi

The dialect properties are correct.

The problem starts with this exception:-

[ERROR] 21:54:32 SchemaUpdate - HHH000319: Could not get database metadata
[artifact:mvn] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'system_sequences' in information_schema

Why that table is unknown and how come it works with HSQL db configuration?


Thanks

phillipuniverse
Team Member
Team Member
Posts: 1563
Joined: Tue Dec 20, 2011 12:11 pm

Re: MySQL Migration in 3.0 GA version

Postby phillipuniverse » Tue Jul 09, 2013 12:50 pm

That error means that Hibernate is trying to use the HSQLDB dialect. HSQL uses that table (system_sequences) internally.

Somewhere a Hibernate dialect was not overridden. Did you redo a maven install on the whole project (core included) after updating the properties files?

cygnusxo
Newbie
Newbie
Posts: 4
Joined: Thu Jul 11, 2013 8:26 pm

Re: MySQL Migration in 3.0 GA version

Postby cygnusxo » Thu Jul 11, 2013 8:28 pm

I have the same problem.

Also when i try to : ant build-create-sql, i get an error like this:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blVariableExpressionEvaluator': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'blVariableExpressions' is defined
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:306)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.broadleafcommerce.common.extensibility.context.MergeFileSystemAndClassPathXMLApplicationContext.<init>(MergeFileSystemAndClassPathXMLApplicationContext.java:94)
at org.broadleafcommerce.common.util.sql.HibernateToolTask.execute(HibernateToolTask.java:143)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'blVariableExpressions' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1102)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:442)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:416)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:550)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:150)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:303)
... 28 more

cygnusxo
Newbie
Newbie
Posts: 4
Joined: Thu Jul 11, 2013 8:26 pm

Re: MySQL Migration in 3.0 GA version

Postby cygnusxo » Thu Jul 11, 2013 8:31 pm

OK... the mvn install on the parent did it...!!!

Thanks for this...

You have any idea why the build-create-sql does not works?

priyeshgpatel
Newbie
Newbie
Posts: 7
Joined: Tue Apr 24, 2012 10:32 am

Re: MySQL Migration in 3.0 GA version

Postby priyeshgpatel » Mon Jul 22, 2013 11:50 am

Hi,
The fix was committed in 3.0x, so it should be in next GA.

The build-create-sql and build-update-sql should work now. There were missing applicationContext files, so the hibernatetool would not come up.

cygnusxo
Newbie
Newbie
Posts: 4
Joined: Thu Jul 11, 2013 8:26 pm

Re: MySQL Migration in 3.0 GA version

Postby cygnusxo » Tue Jul 23, 2013 10:19 am

Great thanks

mathias.lin
Newbie
Newbie
Posts: 8
Joined: Mon Sep 26, 2011 12:57 am
Contact:

Re: MySQL Migration in 3.0 GA version

Postby mathias.lin » Fri Aug 01, 2014 6:10 am

There is a related issue in this forum: viewtopic.php?f=14&t=607


Return to “3.0 Upgrade and Migration”

Who is online

Users browsing this forum: No registered users and 1 guest