We're trying to sort out how to deploy to various environments that need slightly different configurations in spring-beans.xml (i.e. local jdbc verses jndi datasources etc.). Initially I thought that entity ref style includes would be good, but they don't seem to work.
I have the following in my spring beans xml:
<!DOCTYPE beans PUBLIC "..." "..." [
<!ENTITY datasource SYSTEM "datasource.xml">
]>
...
&datasource;
...
For junit tests we use:
context = new ClassPathApplicationContext("spring-beans.xml")
And the entity ref fails with
org.xml.sax.SAXParseException: Relative URI "datasource.xml"; can not be resolved without a base URI.
Which is because in the context construction there is no scheme (i.e. "file:///..."). The location of things is different on various machines and absolute references are not going to work. Is there some other way to set the base URI?
Any ideas on a good way to deal with this would be appreciated.
Presumably it's a fairly common problem (multiple configurations for different environments like development, cruisecontrol, testing, qa, production, etc.)
Thanks,
Derek


Reply With Quote
.