On 7/2/05, Christine Gerstenmayer <[EMAIL PROTECTED]> wrote: > I use OJB in a batch-program. > > The batch-program is in a different project to the OBJ-Classes and > -properties. > > All OJB-classes and -repository-files are included in a jar-File which is in > the classpath of the batch-program when running it. > > When running it as a Java-Application in Eclipse with the OJB-Project in > Java Build Path everything works fine. > > If I run it outside Eclipse in a shellskript I get the following exception > while initializing OJB: > > 2005-06-30 20:18:37,714 [ERROR] at.rit.cpm.azvimport.AZVImport - There was > no default-PBKey specified > org.apache.ojb.broker.PBFactoryException: There was no default-PBKey > specified > at > org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersisten > ceBroker(Unknown Source) > at > org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn > own Source) > at > at.rit.cpm.persistency.AbstractPersistency.getNewBroker(AbstractPersistency. > java:45) > at > at.rit.cpm.persistency.AbstractPersistency.selectOrderedByCriteria(AbstractP > ersistency.java:428) > at > at.rit.cpm.factory.BankTypeFactory.getAllBankTypes(BankTypeFactory.java:48) > at at.rit.cpm.azvimport.AZVImport.main(AZVImport.java:33) > > > If I include the contents of repository.database.xml and > repository_internal.xml into repository_base.xml at place "&database" and > "&internal" and I copy all contents of all table-repository-files into > repository.xml (at "&adminlog;&banktype;..") it also works fine. > > Why OJB doesn't find the files represented by the placeholders like > "&internal" or "&database" or "&<tablename>" when I run it in batch-mode ?
This is a problem of the XML parser, not OJB, because the resolution of these entities is done by the XML parser which probably does not search the classpath or jars in it. You chould include the contents of the files referenced by the entities directly in the repository.xml, eg. using Ant's replace task. Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
