Page 1 of 1

Probles with Broadleaf Commerce Demo

Posted: Mon Mar 22, 2010 8:29 pm
by damiansoriano
Hi all!

I have some problems with the Broadleaf Commerce Demo.

I download the "-with-dependencies" version and following the Quick Start Guide (http://broadleafcommerce.org/trac/wiki/quickStartGuide) everything when as expected, until I run the command "ant start-tomcat-debug", for stating Tomcat. The shell throws lots of exceptions, and when I visit the url with the Demo, Tomcat prints lots of errors, starting with:

HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception

org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:375)
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy52.findNextId(Unknown Source)
org.broadleafcommerce.profile.service.CustomerServiceImpl.createCustomerFromId(CustomerServiceImpl.java:128)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy53.createCustomerFromId(Unknown Source)
org.broadleafcommerce.profile.web.security.CustomerStateFilter.doFilterHttp(CustomerStateFilter.java:114)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:109)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

I am using Tomcat 6.0.18, Ant 1.7.1, Maven 2.2.1 and MySql 5.

In the build.properties I specified
mysql.db.url=jdbc:mysql://localhost:6295/broadleafcommerce?autoReconnect=true&useUnicode=true&characterEncoding=UTF8
mysql.db.user=root
With the corresponding pass.

Can anybody help me?

Re: Probles with Broadleaf Commerce Demo

Posted: Tue Mar 23, 2010 8:22 am
by bradford.taylor
The application cannot create a connection to your mySQL database. Can you connect using an SQL client using the same information in your .properties file?

Re: Probles with Broadleaf Commerce Demo

Posted: Tue Mar 23, 2010 5:28 pm
by damiansoriano
Yes! the command

mysql --user=root -p --host=localhost --port=6295 broadleafcommerce

start the mysql client correctly. I even try leaving the default port (3306) in the .properties, which also works for the SQL client, and I still have the same problem.

Re: Probles with Broadleaf Commerce Demo

Posted: Mon Apr 05, 2010 1:20 pm
by damiansoriano
Finally Broadleaf Commerce compiles and Tomcat runs the demo.... but, the last command for populating the database ("ant load-data") doesn't work. When executing the command I get the following output:

Buildfile: build.xml

load-data:
[copy] Copying 1 file to /home/damian/Broadleaf Commerce/BroadleafCommerce/src/BroadleafCommerceDemo/config/mysql/stage
[sql] Executing resource: /home/damian/Broadleaf Commerce/BroadleafCommerce/src/BroadleafCommerceDemo/config/mysql/stage/load_data.sql
[sql] Failed to execute: LOAD DATA INFILE '/home/damian/Broadleaf Commerce/BroadleafCommerce/src/BroadleafCommerceDemo/config/mysql/admin_user.txt' INTO TABLE broadleafcommerce.BLC_ADMIN_USER FIELDS TERMINATED BY '|' ENCLOSED BY "" (ADMIN_USER_ID, EMAIL, LOGIN, NAME, PASSWORD)

BUILD FAILED
java.sql.SQLException: Access denied for user 'broadleaf'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:734)
at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:565)
at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:535)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:776)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:706)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:449)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 3 seconds

Does anybody knows what happen here?

Damián

Re: Probles with Broadleaf Commerce Demo

Posted: Tue Apr 06, 2010 4:03 pm
by damiansoriano
I finally manage to completely install the demo version.

The problem was in the file BroadleafCommerceDemo/config/mysql/stage/load_data.sql. There are a bunch of SQL statements of the form "LOAD DATA INFILE ....". When executing "ant load-data", the file is created and the SQL statements executed.

I solved the problem by first making a copy of load_data.sql called load_data2.sql and replacing "LOAD DATA INFILE ...." with "LOAD DATA LOCAL INFILE ...." in load_data2.sql. Then I edit the build.xml and include

<target name="load-data-2">
<sql driver="${mysql.db.driver}"
url="${mysql.db.url}"
userid="${mysql.db.user}"
password="${mysql.db.pw}"
encoding="UTF-8"
classpathref="build.runtime.classpath">
<transaction src="config/mysql/stage/load_data2.sql"/>
</sql>
</target>

Finally I execute "ant load-data-2" instead of "and load-data" and the database became populated.

The problem is with the "LOAD DATA INFILE ...." sql statement that doesn't work and the "LOAD DATA LOCAL INFILE ...." that does work. I don't know why this happened. The user I am using has permissions to connect from any host.

Hope this can help someone.

Damián