Many thanks for the valuable advice & insights offered in this list.
I'm afraid I'm stuck unable to get the OMDG tutorial - Tutorial2 - to run.
The stack trace is listed below.
It appears the database repository file is not getting properly read in the following initialization code
static
{
try
{
databaseName =
((PersistenceBrokerConfiguration) PersistenceBrokerFactory
.getConfigurator()
.getConfigurationFor(null))
.getRepositoryFilename();
}
catch (ConfigurationException e)
{
databaseName = "repository.xml";
}
}
This causes the database.open() attempt to fail in the Application() constructor:
try
{
db.open(databaseName, Database.OPEN_READ_WRITE);
}
catch (ODMGException ex)
{
ex.printStackTrace();
}
I was ultimately able to get the Tutorial2 to run by making the changes listed below. No one of these fixes was sufficient. I needed to make them all.
My questions are:
* Should these changes have been necessary? Did I have some other, simple configuration error that wouldn't have required me to alter any source code? I'm especially concerned about alteration number 3. Why would it be that the variable substitutions in the original repository_database.xml were not being done?
* If these changes are required to get Tutorial2 running, shouldn't the documentation be updated to include this information. It took me quite a while to piece this solution together.
Many thanks for any advice, info or references you can offer.
Cheers, Bill Bug
Required Alterations:
1) Add the patches created by Armin Waibel to the following classes:
org.apache.ojb.broker.metadata.ConnectionRepository.java
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.java
org.apache.ojb.broker.util.BrokerHelper.java
and described in the post http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb- [EMAIL PROTECTED]&msgNo=5507
2) made the following change to line 54 of org.apache.ojb.tutorial2.Application.java as described in Robert Sfeir's post http://archives.apache.org/eyebrowse/ReadMsg?listId=107&msgNo=5529
CHANGE:
db.open(databaseName, Database.OPEN_READ_WRITE);
TO:
db.open("default", Database.OPEN_READ_WRITE);
3) made the following change to repository_database.xml to point the jcd directly to the database I was using.
CHANGE:
<jdbc-connection-descriptor
jcd-alias="@JCD_ALIAS@"
default-connection="true"
platform="@DBMS_NAME@"
jdbc-level="@JDBC_LEVEL@"
driver="@DRIVER_NAME@"
protocol="@URL_PROTOCOL@"
subprotocol="@URL_SUBPROTOCOL@"
dbalias="@URL_DBALIAS@"
username="@USER_NAME@"
password="@USER_PASSWD@"
batch-mode="false"
>
TO:
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="PostgreSQL"
jdbc-level="1.0"
driver="org.postgresql.Driver"
protocol="jdbc"
subprotocol="postgresql"
dbalias="ojb"
username="img_meister"
password="doodles"
batch-mode="false"
>bin/tutorial2.sh
[org.apache.ojb.broker.metadata.ConnectionRepository] INFO: Could not found org.apache.ojb.broker.metadata.JdbcConnectionDescriptor for PBKey org.apache.ojb.broker.PBKey: repository=repository.xml, user=null, password=null
[org.apache.ojb.broker.accesslayer.ConnectionManagerFactory] ERROR: ConfigurableFactory instantiation failed for class class org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
* Factory types:
1 - Type: org.apache.ojb.broker.PersistenceBroker
* Factory arguments:
1 - Argument: [EMAIL PROTECTED]
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(ClassHelper.java:38)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance (ConfigurableFactory.java:140)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance (ConfigurableFactory.java:225)
at org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConnect ionManager(ConnectionManagerFactory.java:35)
at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.<init>(PersistenceB rokerImpl.java:195)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(ClassHelper.java:38)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBr okerInstance(PersistenceBrokerFactoryDefaultImpl.java:199)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPool ableObjectFactory.makeObject(PersistenceBrokerFactoryDefaultImpl.java:37 7)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic KeyedObjectPool.java:748)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersi stenceBroker(PersistenceBrokerFactoryDefaultImpl.java:240)
at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(P ersistenceBrokerFactory.java:138)
at org.apache.ojb.odmg.DatabaseImpl.open(DatabaseImpl.java:160)
at org.apache.ojb.tutorial2.Application.<init>(Application.java:55)
at org.apache.ojb.tutorial2.Application.main(Application.java:89)
Caused by: java.lang.NullPointerException
at org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(PlatformF actory.java:81)
at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.<init>(Connectio nManagerImpl.java:101)
... 22 more
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] ERROR: Creation of a new PB instance failed
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(ClassHelper.java:38)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBr okerInstance(PersistenceBrokerFactoryDefaultImpl.java:199)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPool ableObjectFactory.makeObject(PersistenceBrokerFactoryDefaultImpl.java:37 7)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic KeyedObjectPool.java:748)
at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersi stenceBroker(PersistenceBrokerFactoryDefaultImpl.java:240)
at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(P ersistenceBrokerFactory.java:138)
at org.apache.ojb.odmg.DatabaseImpl.open(DatabaseImpl.java:160)
at org.apache.ojb.tutorial2.Application.<init>(Application.java:55)
at org.apache.ojb.tutorial2.Application.main(Application.java:89)
Caused by: org.apache.ojb.broker.PersistenceBrokerException
at org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance (ConfigurableFactory.java:173)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance (ConfigurableFactory.java:225)
at org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConnect ionManager(ConnectionManagerFactory.java:35)
at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.<init>(PersistenceB rokerImpl.java:195)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(ClassHelper.java:38)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance (ConfigurableFactory.java:140)
... 16 more
Caused by: java.lang.NullPointerException
at org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(PlatformF actory.java:81)
at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.<init>(Connectio nManagerImpl.java:101)
... 22 more
Bill Bug Senior Analyst/Ontological Engineer
Computer Vision Laboratory for Vertebrate Brain Mapping Department of Neurobiology & Anatomy Drexel University College of Medicine 2900 Queen Lane Philadelphia, PA 19129 215 991 8430 (ph)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
