CatalogManager findet Properties-File nicht

eagle1985

Mitglied
Hallo zusammen,

ich möchte einem org.apache.xml.resolver.CatalogManager ein Properties-File übergeben wo die Config des CatalogManagers definiert ist.

Jedoch bekomme ich immer die Meldung dass das Propertiy-File nicht gefunden werden kann.

Das Propertiy-File und das Catalog-File liegen beide im Run-Verzeichnis des Programmes.

Habe bis jetzt folgenden Code Ausprobiert:

Code:
DOMParser m_Parser = new DOMParser();

m_Parser.setFeature ("http://xml.org/sax/features/validation", true);

CatalogManager cm = new CatalogManager("MyCatalogManager.properties");

CatalogResolver cr = new CatalogResolver(cm);

m_Parser.setEntityResolver(cr);

Wenn ich dem CatalogManager kein Property übergebe sondern alles im Source codiere klappt es einwandfrei:
Code:
cm.setAllowOasisXMLCatalogPI(true);
cm.setCatalogClassName("org.apache.xml.resolver.Resolver");
cm.setCatalogFiles("./mycatalog.xml");
cm.setIgnoreMissingProperties(false);
cm.setPreferPublic(true);
cm.setRelativeCatalogs(true);
cm.setUseStaticCatalog(true);
cm.setVerbosity(99);

Hat jemand eine Ahnung wie ich dem CatalogManager beibringen kann wo das Property-File liegt?

Ich möchte nicht bei jeder änderung der Catalog-Files im Property dies im Codenachführen. Finde das Property-File währe da einiges Flexibler.
 
API besagt folgendes:

CatalogManager

public CatalogManager(java.lang.String propertyFile)
Constructor that specifies an explicit property file.

habe den String bereits folgendermasen ohne Erfolg ausprobiert:

Code:
cm = new CatalogManager("c:/MyCatalogManager.properties");
cm = new CatalogManager("./MyCatalogManager.properties");
cm = new CatalogManager("MyCatalogManager.properties");
cm = new CatalogManager("file:///c:/MyCatalogManager.properties");

natürlich nicht alle gleichzeitig ;)

Weiss jemand wo da gesucht wird?
Heisst wo das property-File hin muss oder wie ich dem Manager klar verklikern kann wo er das File findet?
 
Zurück