When using the sql-maven-plugin to generate the databases, we have to
explicitly close the databases otherwise the unit tests won't be able
to open the database. This can be done with the snippet below, these
changes are needed in both tutorial-store-db and
tutorial-store-supplier :
<!-- Shutdown DB in order to be able to run unit tests -->
<execution>
<id>shutdown-database-sothat-test-can-run</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
<url>jdbc:derby:${basedir}/target/cart-db;shutdown=true</url>
<skipOnConnectionError>true</skipOnConnectionError>
</configuration>
</execution>
I have committed a fix for this issue under svn revision #654416.
On Tue, May 6, 2008 at 3:57 PM, Jean-Sebastien Delfino
<[EMAIL PROTECTED]> wrote:
> Graham Charters wrote:
>>
>> I updated this morning and also saw the Segmentation Fault. I've
>> since re-run and now only see the Exception. Further up on the build
>> there's also the following SQL Exception:
>>
>> INFO: Starting node: http://localhost:9990/node-config/StoreClientNode
>> Connecting to database:
>> jdbc:derby:directory:C:\Tuscany\java\sca\tutorial\store-
>> test/../store-supplier/target/cart-db
>> 06-May-2008 15:44:59 org.apache.catalina.core.StandardWrapperValve invoke
>> SEVERE: Servlet.service() for servlet /ShoppingCart/Cart/* threw exception
>> SQL Exception: Failed to start database
>> 'directory:C:\Tuscany\java\sca\tutorial\
>> store-test/../store-supplier/target/cart-db', see the next exception for
>> details
>> .
>
> I'm not getting the seg fault but I'm getting the SQL exception too,
> randomly, in 1 out of 3 build environments.
>
> I had seen the SQL exception before and thought I had implemented a good
> workaround for it in store-supplier/pom.xml (copying cart-db as the Maven
> SQL plugin doesn't seem to release the db properly in store-supplier,
> preventing store-test to open it later)...
>
> It doesn't look like the workaround is working.
>
> I've temporarily commented store-test out of the build. I'm at JavaOne today
> and will try to investigate later this evening. If I can't get around the
> database issue I'll just take it out as it's not really relevant to the test
> anyway.
> --
> Jean-Sebastien
>
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/