Hi.
I've been trying to use Apache Ode in the embedded mode of ServiceMix,
but I haven't been able to make it work. I've followed a similar
approach to the one used for Camel
(http://servicemix.apache.org/servicemix-camel.html --> using
servicemix-camel in embedded mode), but it fails to startup due to an
exception caused when connecting to the embedded Derby database.
As Ode 1.1 needs the geronimo-connector to be patched, I decided to
use a Ode 1.2 snapshot, that uses geronimo-connector-2.0.1 (I can't
use Ode's version of geronimo connector because the rest of the
servicemix component will not work). When starting the jbi container I
get the mentioned exception (I'll paste it below) and I believe the
cause of it is that the database's path contains a ".", which confuses
Derby when trying to connect to the database.
Debugging I've seen that the database path is built concatenating my
project's path, the Ode component's "installationPath" and the
database name. The difference between the embedded mode and the
standard mode is that the embedded mode executes line 1099 of the
JbiContainer.java in servicemix-core (3.2.2) where a "." for the
installationPath is hardcoded. This makes it impossible to specify
another route. So, the database's path ends up being something like
"C:\projectPath\./databaseName", and Derby doesn't understand it.
Has anyone been able to make it work? I guess creating a non-embedded
derby database could work, but I'm more interested in embedding it.
Thanks in advance. Best regards.
Sebatian Gomez.
PS: I'll paste the connection exception, although I'm quite sure the
reason is the dot in the middle of the path:
javax.resource.spi.ResourceAllocationException: Unable to obtain
physical connection to jdbc:derby:C:\myWorkspace\myProject\./derby-db
at
org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection(JDBCDriverMCF.java:98)
at
org.tranql.connector.jdbc.JDBCDriverMCF.createManagedConnection(JDBCDriverMCF.java:73)
at
org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
at
org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterceptor.getConnection(LocalXAResourceInsertionInterceptor.java:41)
at
org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalGetConnection(SinglePoolConnectionInterceptor.java:67)
at
org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:78)
at
org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:46)
at
org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:96)
at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
at
org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
at
org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
at
org.apache.ode.utils.LoggingDataSourceWrapper.getConnection(LoggingDataSourceWrapper.java:42)
at
org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
at
org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:569)
at
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1221)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:476)
at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:401)
at
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:102)
at
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:82)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:861)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:852)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:630)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:169)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at
org.apache.ode.store.jpa.DbConfStoreConnectionFactory.getConnection(DbConfStoreConnectionFactory.java:49)
at
org.apache.ode.store.ProcessStoreImpl.getConnection(ProcessStoreImpl.java:550)
at
org.apache.ode.store.ProcessStoreImpl.access$300(ProcessStoreImpl.java:75)
at
org.apache.ode.store.ProcessStoreImpl$Callable.call(ProcessStoreImpl.java:699)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Database
'C:\myWorkspace\myProject\./derby-db' not found.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleDBNotFound(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
at
org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection(JDBCDriverMCF.java:96)
... 39 more