Author: objectiser
Date: 2009-10-20 10:14:47 -0400 (Tue, 20 Oct 2009)
New Revision: 194
Modified:
trunk/distribution/pom.xml
trunk/distribution/src/main/assembly/bin.xml
trunk/distribution/src/main/release/db/datasource/bpel-derby-ds.xml
trunk/distribution/src/main/release/db/hibernate/derby.properties
trunk/distribution/src/main/release/install/build.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/db/DatabaseInitializer.java
Log:
Applied changes to get derby deploy working.
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2009-10-20 06:07:02 UTC (rev 193)
+++ trunk/distribution/pom.xml 2009-10-20 14:14:47 UTC (rev 194)
@@ -39,6 +39,7 @@
<mysql.connector.version>5.0.8</mysql.connector.version>
<postgresql.version>8.3-603.jdbc3</postgresql.version>
<jtds.version>1.2.2</jtds.version>
+ <derby.version>10.4.1.3</derby.version>
</properties>
<dependencies>
@@ -86,6 +87,16 @@
<artifactId>jtds</artifactId>
<version>${jtds.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derbytools</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
<!--
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2009-10-20 06:07:02 UTC (rev 193)
+++ trunk/distribution/src/main/assembly/bin.xml 2009-10-20 14:14:47 UTC (rev 194)
@@ -129,6 +129,8 @@
<include>net.sourceforge.jtds:jtds</include>
<include>postgresql:postgresql</include>
<include>mysql:mysql-connector-java</include>
+ <include>org.apache.derby:derby</include>
+ <include>org.apache.derby:derbytools</include>
</includes>
</dependencySet>
Modified: trunk/distribution/src/main/release/db/datasource/bpel-derby-ds.xml
===================================================================
--- trunk/distribution/src/main/release/db/datasource/bpel-derby-ds.xml 2009-10-20
06:07:02 UTC (rev 193)
+++ trunk/distribution/src/main/release/db/datasource/bpel-derby-ds.xml 2009-10-20
14:14:47 UTC (rev 194)
@@ -19,7 +19,7 @@
<driver-class>@driver@</driver-class>
<!-- The login and password -->
- <user-name>@usernmae@</user-name>
+ <user-name>@username@</user-name>
<password>@password@</password>
<!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on
first use -->
Modified: trunk/distribution/src/main/release/db/hibernate/derby.properties
===================================================================
--- trunk/distribution/src/main/release/db/hibernate/derby.properties 2009-10-20 06:07:02
UTC (rev 193)
+++ trunk/distribution/src/main/release/db/hibernate/derby.properties 2009-10-20 14:14:47
UTC (rev 194)
@@ -1 +1,4 @@
-dialect=org.hibernate.dialect.DerbyDialect
\ No newline at end of file
+dialect=org.hibernate.dialect.DerbyDialect
+
+username=sa
+password=
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2009-10-20 06:07:02 UTC (rev
193)
+++ trunk/distribution/src/main/release/install/build.xml 2009-10-20 14:14:47 UTC (rev
194)
@@ -92,9 +92,10 @@
<echo message="Undeploy the BPEL runtime from JBoss ESB server" />
<delete dir="${deployers.dir}/${bpel-deployer}" />
<delete dir="${deploy.dir}/${bpel-runtime}" />
- <delete file="${deploy.dir}/${jbossesb-bpel}" />
- <delete file="${server.lib.dir}/derby-10.4.1.3.jar"/>
- <delete file="${server.lib.dir}/derbytools-10.4.1.3.jar"/>
+ <delete file="${deploy.dir}/${jbossesb-bpel}" />
+
+ <!--install appropriate db driver-->
+ <antcall target="internal.uninstall.riftsaw.into.jboss.db.${database}"
/>
<!--
https://jira.jboss.org/jira/browse/RIFTSAW-24 -->
<move file="${deployers.dir}/esb.deployer/lib/xbean-2.2.0.tmp"
@@ -122,6 +123,14 @@
<!-- install database specific driver -->
<target name="internal.install.riftsaw.into.jboss.db.hsql" />
+ <target name="internal.install.riftsaw.into.jboss.db.derby">
+ <copy todir="${server.lib.dir}" overwrite="true">
+ <fileset dir="../db/drivers">
+ <include name="derby*.jar"/>
+ </fileset>
+ </copy>
+ </target>
+
<target name="internal.install.riftsaw.into.jboss.db.mysql">
<copy todir="${deploy.dir}/${bpel-runtime}/lib"
overwrite="true">
<fileset dir="../db/drivers">
@@ -130,4 +139,14 @@
</copy>
</target>
+ <!-- uninstall database specific driver -->
+ <target name="internal.uninstall.riftsaw.into.jboss.db.hsql" />
+
+ <target name="internal.uninstall.riftsaw.into.jboss.db.derby">
+ <delete file="${server.lib.dir}/derby-10.4.1.3.jar"/>
+ <delete file="${server.lib.dir}/derbytools-10.4.1.3.jar"/>
+ </target>
+
+ <target name="internal.uninstall.riftsaw.into.jboss.db.mysql" />
+
</project>
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/db/DatabaseInitializer.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/db/DatabaseInitializer.java 2009-10-20
06:07:02 UTC (rev 193)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/db/DatabaseInitializer.java 2009-10-20
14:14:47 UTC (rev 194)
@@ -134,8 +134,13 @@
{
tx = (UserTransaction)new InitialContext().lookup("UserTransaction");
tx.begin();
+
+ log.info("Execute SQL from resource: "+resource);
URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
+
+ log.info("Execute SQL from resource URL: "+url);
+
String sql = getStringFromStream(url.openStream());
sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all
commented lines
final String[] statements ;