Hello,
I am trying to ensure that the configuration for my application on local
and live servers is as quick and painless as possible to switch over.
To this end I've created different rep/config files for the two
situations with a common core set of config included by both. So far so
good. I also have two different sets of postgresql details for the two
servers, so I create the XML for my rep/datasources.xml thus:
<datasources>
<datasource name="postgresql_local">
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/test</url>
<user>postgres</user>
<password>thepassword</password>
<poolsize>5</poolsize>
</datasource>
<datasource name="postgresql_live">
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://ct_tomcat:5432/ito</url>
<user>tomcat</user>
<password>thepassword</password>
<poolsize>5</poolsize>
</datasource>
</datasources>
Then in config_local.xml (for my local server) I do:
<config>
<param name="DATASOURCE">postgresql_local</param>
<include file="rep/config_common.xml"/>
</config>
and similarly for config_live.xml. The participants file looks like:
<rep>
<participant
param="rep/config_local.xml">ParticipantConfig</participant>
<participant
param="rep/datasources.xml">ParticipantDatasources</participant>
<participant param="sites/locreport.xml">ParticipantSite</participant>
</rep>
However, on running the app, I get a "datasource can't be null" message
during RIFE's setup phase thus:
java.lang.IllegalArgumentException
datasource can't be null.
at com.uwyn.rife.database.DbQueryManagerFactory getInstance (
DbQueryManagerFactory.java : 76 )
at com.uwyn.rife.database.DbQueryManagerFactory getInstance (
DbQueryManagerFactory.java : 53 )
at
com.uwyn.rife.authentication.sessionmanagers.DatabaseSessionsFactory
getInstance ( DatabaseSessionsFactory.java : 22 )
at
com.uwyn.rife.authentication.elements.PurgingDatabaseAuthenticatedDeployer
deploy ( PurgingDatabaseAuthenticatedDeployer.java : 61 )
at com.uwyn.rife.engine.ElementInfo deploy ( ElementInfo.java :
253 )
at com.uwyn.rife.engine.SiteBuilder setupElements (
SiteBuilder.java : 974 )
at com.uwyn.rife.engine.SiteBuilder setupData ( SiteBuilder.java
: 1590 )
at com.uwyn.rife.engine.SiteBuilder finish ( SiteBuilder.java :
253 )
at com.uwyn.rife.engine.SiteBuilder process ( SiteBuilder.java :
244 )
at com.uwyn.rife.engine.SiteBuilder getSite ( SiteBuilder.java :
176 )
at com.uwyn.rife.rep.participants.ParticipantSite initialize (
ParticipantSite.java : 36 )
at com.uwyn.rife.rep.participants.ParticipantSite _getObject (
ParticipantSite.java : 49 )
at com.uwyn.rife.rep.BlockingParticipant getObject (
BlockingParticipant.java : 471 )
at com.uwyn.rife.rep.BlockingParticipant _getObject (
BlockingParticipant.java : 447 )
at com.uwyn.rife.rep.BlockingParticipant getObject (
BlockingParticipant.java : 415 )
at com.uwyn.rife.engine.Site getRepInstance ( Site.java : 158 )
at com.uwyn.rife.engine.Gate obtainSite ( Gate.java : 185 )
My question is - should I be able to specify multiple postgresql
datasources as I've done here? I think so, and I even have another app
which appears to work doing this! However, I can't get this one to run
at all, and I'm at a loss. Can anyone help? I note that if I simply
return to a datasource called "postgresql" it works ok. If multiple
datasources isn't possible like this, what's the best way of handling
multiple sets of details for different servers?
Thanks,
David Herbert.
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users