0
votes

I was trying to setup Broadleaf eCommerce in Apache Tomcat/MySQL/Win 10 environment, but I am not able to deploy the WAR. I had gone through the Broadleaf Blogs/Forums and also StackExchange for all possible solutions, but I am still not able to get the site/admin portal up and running.

Here are the steps which I had followed

Tomcat

Environment

  1. Server version: Apache Tomcat/8.0.24
  2. Server built: Jul 1 2015 20:19:55 UTC
  3. Server number: 8.0.24.0
  4. OS Name: Windows 8.1
  5. OS Version: 6.3
  6. Architecture: amd64
  7. Java Home: C:\Program Files\Java\jdk1.8.0_51\jre
  8. JVM Version: 1.8.0_51-b16
  9. JVM Vendor: Oracle Corporation
  10. CATALINA_BASE: E:\MyProject\apache-tomcat-8.0.24
  11. CATALINA_HOME: E:\MyProject\apache-tomcat-8.0.24

Updated the Apache Tomcat server.xml and context.xml

server.xml

<GlobalNamingResources>
<!-- Editable user database that can also be used by
     UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
          type="org.apache.catalina.UserDatabase"
          description="User database that can be updated and saved"
          factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />

 <Resource name="jdbc/broadleaf"
        auth="Container"
        type="javax.sql.DataSource"
        username="broadleaf"
        password="broadleaf"
        driverClassName="com.mysql.jdbc.Driver"
        description="Global Address Database"
        url="jdbc:mysql://localhost:3306/broadleaf"
        maxActive="15"
        maxIdle="3"/>

context.xml

    <Resource name="jdbc/web" auth="Container" type="javax.sql.DataSource"
           maxActive="30" maxIdle="60" maxWait="10000"
           username="broadleaf" password="broadleaf" driverClassName="com.mysql.jdbc.Driver"
           connectionProperties="useUnicode=true;characterEncoding=utf8;"
           url="jdbc:mysql://localhost:3306/broadleaf?useUnicode=true&amp;characterEncoding=utf8"/>

Downloaded the source code from Git and prior to Maven run, I had updated the build.properties

   database.user=broadleaf

database.password=broadleaf database.driver=com.mysql.jdbc.Driver database.url=jdbc:mysql://localhost:3306/broadleaf?useUnicode=true&characterEncoding=utf8

build.xml in both admin and site has been changed to reflect the MySQL URL and DB connection parameters

Updated core\src\main\resources\runtime-properties\common-shared.properties to change from HSQL to MySQl

    blPU.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

The problem that I see is that it is able to create certain tables while certain set of tables are not created. Also, both the site and admin WAR's are not deployed. Any idea on what other parameters I need to change? Here is the link to log files

1

1 Answers

1
votes

From your log messages, I think that you have duplicated datasource definitions. Look at the context.xml in your project (site/src/main/webapp/META-INF/context.xml andadmin/src/main/webapp/META-INF/context.xml). I believe you will find that that creates ajdbc/webdataSource and then on your local Tomcat server in itsconf/context.xmlit also creates ajdbc/web` datasource.

If so, remove the application-specific data sources.