When I finally got my connection string correct, I realized I had (at least) one more issue - the demo's embedded Tomcat configuration vs. running Tomcat on a server. The demo will not run with the project's out-of-the-box settings on AWS! Here's how I figured this out:
If you look at the suggested Ant task in the Broadleaf documentation, the writer suggests that you use an embedded version (this is a copy/paste from the documentation)
Code: Select all
<target name="tomcat-demo" depends="start-db">
<delete dir="war/WEB-INF/lib"/>
<artifact:mvn mavenHome="${maven.home}" fork="true" jvmargs="-DbroadleafCoreDirectory=${broadleafCoreDirectory} -DbroadleafWorkspaceDirectory=${broadleafWorkspaceDirectory} -XX:MaxPermSize=256M -Xmx512M">
<arg value="compile"/>
<arg value="war:exploded"/>
<arg value="tomcat7:run-war"/> <!-- this is the command to run embedded -->
</artifact:mvn>
</target>
During development I once made the mistake of running the instance in server-mode (i.e. <arg value="tomcat7:run"/>) and got the following error.
Code: Select all
[ERROR] 09:19:28 ContextLoader - Context initialization failed
[artifact:mvn] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in resource loaded from byte array: Cannot resolve reference to bean 'blPersistenceUnitManager' while setting bean property 'persistenceUnitManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blPersistenceUnitManager' defined in resource loaded from byte array: Invocation of init method failed;
I realized my mistake and changed it back to embedded-mode (i.e. <arg value="tomcat7:run-war"/>). All was good. I thought of trying to figure out why the project did not run in server-mode, but running in embedded-mode solved the problem so I moved on.
Now I have deployed the application to Amazon AWS and, guess what?, I get the same error message! I guess I now have to figure out why the demo will not run in server-mode. Any ideas on what project settings need to change to run the demo in Tomcat7 server-mode vs. the documented embedded-mode? Thanks.