I haven't tried putting the xml files in a jar before as I've felt that I wanted to preserve the editablity.

It sounds like the entity resolver (or some such, my xml terminology isn't the best) is only looking in the file system. From my understanding there is a way to implement custom entity resolvers, and I think even some open source ones that will load from classpath.... I think this is what you'd need to do.

Alternatively, you might look at the Spring support for OJB which should allow you to configure a bean with the datasource configuration and then propogate that where needed.

Markus Wolf wrote:

Martin Kalén wrote:

 Markus Wolf wrote:
> is there a way to reuse existing connections for the whole OJB
> setup? I've implemented a ConnectionFactory for OJB as Excalibur
> component, but when I create a new database and open it (as stated
> in the tutorials) the repository_database.xml part is always
> expected. Are there any workarounds? (Best would be a complete
> reuse of existing connections without having to specify a
> repository_database.xml) Or maybe is there some way to put the
> repository_database.xml in a jar-file (which is possible for the
> entiry repository.xml but only for the whole file...)

 Without going into the re-use issue I can just report that there is
 no problem placing the different repository*.xml files in a JAR. Just
 make sure the DTD is there to make XML-validation possible.

 The files are loaded without path so place the in the root of your
 JAR.

So doesn't this log output mean the files are not found?...
Am I missing something here? Can anybody give me a hint how to successful load the repository.xml from a jar-file?
I have all repository parts in the root (default-package) of my jar-file.


[snip console-output]
...
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB Descriptor Repository: jar:file:/home/markusw/temp/jservices/jservices-server-0.0.1.jar!/repository.xml


[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building repository from :jar:file:/home/markusw/temp/jservices/jservices-server-0.0.1.jar!/repository.xml

[org.apache.ojb.broker.metadata.RepositoryPersistor] DEBUG: RespostoryPersistor using SAXParser : org.apache.xerces.jaxp.SAXParserImpl
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: startDoc
[org.apache.ojb.broker.metadata.MetadataManager] INFO: No repository.xml file found, starting with empty metadata and connection configuration
[org.apache.ojb.broker.metadata.MetadataManager] INFO: No 'default-connection' attribute set in jdbc-connection-descriptors, thus it's currently not possible to use 'defaultPersistenceBroker()' convenience method to lookup PersistenceBroker instances. But it's possible to enable this at runtime using 'setDefaultKey' method.
...
[/snip]


Regards
Markus Wolf


-- Robert r. Sanders Chief Technologist iPOV (334) 821-5412 www.ipov.net


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to