Page 2 of 2

Re: running "maven install" problem

Posted: Wed Mar 03, 2010 2:07 pm
by bradford.taylor
Please try the following commands:

cd ~/broadleafcommerce/src
mvn install

Running the maven install from the root of the source will build the libraries in the order they are needed.

Also, in case you haven't seen it we have a Quickstart Guide.

Re: running "maven install" problem

Posted: Wed Mar 03, 2010 5:00 pm
by vector1083q5w2
I'm well aware of the quickStartGuide. Without it I'd be completely lost. With it, I'm partially lost. :)

I did what you suggested and got mvn to install from the src directory

Code: Select all

...
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] [install:install]
[INFO] Installing /home/user/broadleafcommerce/src/BroadleafCommerceAdmin/target/broadleaf-admin-1.0.1.jar to /home/user/.m2/repository/org/broadleafcommerce/broadleaf-admin/1.0.1/broadleaf-admin-1.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building BroadleafCommerceAdminWeb
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] [install:install]
[INFO] Installing /home/user/broadleafcommerce/src/BroadleafCommerceAdminWeb/target/BroadleafCommerceAdminWeb-1.0.1.jar to /home/user/.m2/repository/org/broadleafcommerce/BroadleafCommerceAdminWeb/1.0.1/BroadleafCommerceAdminWeb-1.0.1.jar
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] BroadleafCommerce ..................................... SUCCESS [2:09.002s]
[INFO] BroadleafCommerceProfile .............................. SUCCESS [3:57.484s]
[INFO] BroadleafCommerceProfileWeb ........................... SUCCESS [27.860s]
[INFO] BroadleafCommerceFramework ............................ SUCCESS [7.770s]
[INFO] BroadleafCommerceFrameworkWeb ......................... SUCCESS [1.720s]
[INFO] BroadleafCommerceUSPSSchemas .......................... SUCCESS [8.271s]
[INFO] BroadleafCommerceUSPS ................................. SUCCESS [1.350s]
[INFO] BroadleafCommerceIntegrationTests ..................... SUCCESS [1:19.791s]
[INFO] BroadleafCommerceDemo ................................. SUCCESS [15.390s]
[INFO] BroadleafCommerceAdmin ................................ SUCCESS [47.341s]
[INFO] BroadleafCommerceAdminWeb ............................. SUCCESS [0.240s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 minutes 17 seconds
[INFO] Finished at: Wed Mar 03 15:51:40 EST 2010
[INFO] Final Memory: 23M/61M
[INFO] ------------------------------------------------------------------------


I then went into the BroadleafCommerceDemo directory and did an 'mvn install' and it worked as well (below).

Code: Select all

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building BroadleafCommerceDemo
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] [install:install]
[INFO] Installing /home/user/broadleafcommerce/src/BroadleafCommerceDemo/target/broadleaf-demo-1.0.1.jar to /home/user/.m2/repository/org/broadleafcommerce/broadleaf-demo/1.0.1/broadleaf-demo-1.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10 seconds
[INFO] Finished at: Wed Mar 03 15:53:30 EST 2010
[INFO] Final Memory: 12M/30M
[INFO] ------------------------------------------------------------------------


Now, when I run 'ant deploy-exploded-war' from within the BroadleafCommerceDemo directory I get the following:

Code: Select all

user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ ant deploy-exploded-war
Buildfile: build.xml

war:

package:

deploy-exploded-war:
     [copy] Copying 78 files to /usr/share/tomcat6/webapps/broadleafdemo

BUILD SUCCESSFUL
Total time: 6 seconds
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$




Code: Select all

user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ ant start-tomcat-debug
Buildfile: build.xml

start-tomcat-debug:
     [java] Listening for transport dt_socket at address: 8000
     [java] Mar 3, 2010 4:47:23 PM org.apache.catalina.startup.Catalina load
     [java] WARNING: Can't load server.xml from /usr/share/tomcat6/conf/server.xml
     [java] Mar 3, 2010 4:47:23 PM org.apache.catalina.startup.Catalina load
     [java] WARNING: Can't load server.xml from /usr/share/tomcat6/conf/server.xml
     [java] Mar 3, 2010 4:47:23 PM org.apache.catalina.startup.Catalina start
     [java] INFO: Server startup in 0 ms
     [java] java.lang.reflect.InvocationTargetException
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
     [java]     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
     [java] Caused by: java.lang.NullPointerException
     [java]     at org.apache.catalina.startup.Catalina.await(Catalina.java:642)
     [java]     at org.apache.catalina.startup.Catalina.start(Catalina.java:602)
     [java]     ... 6 more

BUILD SUCCESSFUL
Total time: 6 seconds
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$


Then, I attempted to get the database loaded, with no luck (below). Note that the 'ant start-tomcat-debug' command didn't seem to start tomcat, as I grepped the processes and tomcat wasn't running. So, I manually started tomcat (first started apache, followed by tomcat).

Code: Select all

user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ sudo ps -A | grep tomcat
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ sudo /etc/init.d/apache2 start
 * Starting web server apache2apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.11.150 for ServerName
                                                                                                                                                                                                                                      [ OK ]
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ sudo /etc/init.d/tomcat6 start
 * Starting Tomcat servlet engine tomcat6                                                                                                                                                                                             [ OK ]
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ ant load-data
Buildfile: build.xml

load-data:
     [copy] Copying 1 file to /home/user/broadleafcommerce/src/BroadleafCommerceDemo/config/mysql/stage
      [sql] Executing resource: /home/user/broadleafcommerce/src/BroadleafCommerceDemo/config/mysql/stage/load_data.sql
      [sql] Failed to execute:   DELETE FROM broadleafcommerce.BLC_ADMIN_USER

BUILD FAILED
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'broadleafcommerce.BLC_ADMIN_USER' doesn't exist
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        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: 5 seconds
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$



So now it appears that the script to load MySQL fails because my version/installation of MySQL coughs up an error when someone attempts to delete a nonexistent table, as opposed to just ignoring it. Any idea how to get past this?

Re: running "maven install" problem

Posted: Wed Mar 03, 2010 5:13 pm
by bradford.taylor
It appears that you the appserver.home property is set to a Tomcat Web server instead of Apache. The line:

Code: Select all

appserver.home=/usr/share/tomcat6


needs to point your Apache servlet container and not a Tomcat web server. Also the configuration:

Code: Select all

mysql.db.url=jdbc:mysql://localhost:3306/broadleafcommerce?autoReconnect=true&useUnicode=true&characterEncoding=UTF8


needs to point to the ip address or DNS and port number of the server and port that your mySQL is on. If it is on the same box as your Apache then you can just use localhost.

Re: running "maven install" problem

Posted: Wed Mar 03, 2010 6:00 pm
by vector1083q5w2
Strange that having the appserver point to Tomcat rather than Apache would impact a script that loads data into MySQL. Its also strange because I've got an install of BroadleafCommerce under WinXP that works fine with appserver.home pointing to Tomcat (On the WinXP box, I'm having trouble getting the Admin Tool working).

Meanwhile, installing Apache's 'Open For Biz' (a competitor to BroadleafCommerce) has been a comparative walk in the park. Anyway, I took your advise, and changed build.properties to the following (below).

Code: Select all

# Ant properties for building the Broadleaf Commerce Demo app
# /dev/apps/apache-tomcat-6.0.18
# appserver.home=/Developer/Applications/apache-tomcat
appserver.home=/usr/share/apache2

# appserver.lib=/dev/apps/apache-tomcat-6.0.18/lib
deploy.path=${appserver.home}/webapps

mysql.db.driver=com.mysql.jdbc.Driver
# Uncomment the line below and comment out the localhost db.url to run load scripts on the QA box.
#mysql.db.url=jdbc:mysql://192.168.11.150:3306/broadleafdemo?autoReconnect=true&useUnicode=true&characterEncoding=UTF8
mysql.db.url=jdbc:mysql://localhost:3306/broadleafcommerce?autoReconnect=true&useUnicode=true&characterEncoding=UTF8
mysql.db.user=root
mysql.db.pw=pass


And when I run ant load-data I get the following (below).

Code: Select all

user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$ ant load-data
Buildfile: build.xml

load-data:
     [copy] Copying 1 file to /home/user/broadleafcommerce/src/BroadleafCommerceDemo/config/mysql/stage
      [sql] Executing resource: /home/user/broadleafcommerce/src/BroadleafCommerceDemo/config/mysql/stage/load_data.sql
      [sql] Failed to execute:   DELETE FROM broadleafcommerce.BLC_ADMIN_USER

BUILD FAILED
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'broadleafcommerce.BLC_ADMIN_USER' doesn't exist
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        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
user@andLinux:~/broadleafcommerce/src/BroadleafCommerceDemo$


Any other ideas as to how to resolve this? Hopefully others might learn from this as well.

Re: running "maven install" problem

Posted: Wed Mar 03, 2010 6:11 pm
by bradford.taylor
Please make sure you start your Apache and let it finish the startup before running the SQL load scripts. The demo is setup in such a way that hibernate creates the tables if they do not exist.

Re: running "maven install" problem

Posted: Tue Mar 09, 2010 2:21 pm
by vector1083q5w2
I gave up attempting to get this to work. OFBiz and OpenERP were both so much easier to get running.

Re: running "maven install" problem

Posted: Wed Mar 24, 2010 1:55 pm
by jefffischer
When Bradford mentions make sure that you launched Apache first, this may be confusing to some. He's actually referring to Apache Tomcat. You must start Tomcat first before running the load-data ant task. Otherwise, the tables will not be available in the database. Note, in the next release (near future), I'll be simplifying the process of building/launching the demo and the admin tool.