Postby ktisdell » Fri Dec 07, 2012 1:02 pm
Which version of BLC are you using? This should work as you describe, without the need for a database connection. That said, I ran into this issue about a month ago as well, and it may be a bug in an older version of BLC. This ant task causes the BLC merge process to happen, allowing all entities to be available to the persistence unit for introspection. This merge process causes Spring's application context lifecycle to be invoked. We added a lifecycle event to Broadleaf that reads the database on startup (unrelated to this ant task). Of course, this will cause a problem if no database exists, as is the case here. We fixed this in version 2.1, I believe. Can you let me know which version you are having trouble with?
My guess is the best way to fix this is to create a new ant-applicationContext.xml file (not one that you will actually reference in your application). This is for the ant task only. Put it on your classpath. Add the following bean definition to it:
<bean id="blSequenceGeneratorCorruptionDetection" class="java.lang.Object"/>
Then modify your build.xml file:
Under the build-sql ant task, try adding the following:
<classPathApplicationContext path="ant-applicationContext.xml"/>
What this should do is cause the ant task to include your ant-applicationContext.xml file in the Broadleaf merge process, overriding the blSequenceGeneratorCorruptionDetection bean with a plain object that does not implement ApplicationListener, and will therefore not be invoked as part of Spring's Application Context Lifecycle events.
Hope this helps.