[esb-java-user] pooled db connection error on win2k

Schmilinsky, Remsy Remsy.Schmilinsky at cbsa-asfc.gc.ca
Fri Oct 10 05:59:53 PDT 2008


Hi. I get  "No suitable driver" sql exception on win2k when trying to get a pooled connection inside a mediator.

However it works fine on ubuntu. Do you know what might be wrong ? 

This is the content of my synapse.properties for pooled connection:

synapse.datasources=sampleds
synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory
synapse.datasources.providerUrl=rmi://localhost:2199
synapse.datasources.providerPort=2199

synapse.datasources.sampleds.type=PerUserPoolDataSource
synapse.datasources.sampleds.cpdsadapter.factory=org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
synapse.datasources.sampleds.cpdsadapter.className=org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
synapse.datasources.sampleds.cpdsadapter.name=cpds
synapse.datasources.sampleds.dsName=sample
synapse.datasources.sampleds.driverClassName=org.apache.derby.jdbc.ClientDriver
synapse.datasources.sampleds.url=jdbc:derby://localhost:1527/esbdb;create=false
synapse.datasources.sampleds.username=esb
synapse.datasources.sampleds.password=esb
synapse.datasources.sampleds.maxActive=100
synapse.datasources.sampleds.maxIdle=20
synapse.datasources.sampleds.maxWait=10000

having the following initializer in the custom mediator:

	public DBHandler() throws SynapseException {
		try {
			System.out
					.println("\n *** INITIALIZING DATABASE CONTEXT ***\n");
			InitialContext initCtx = createContext();
			String jndiName = "sample";
			dataSource = (PerUserPoolDataSource) initCtx.lookup(jndiName);
		} catch (Exception e) {
			throw new SynapseException(e.getMessage());
		}
	}

	private InitialContext createContext() throws NamingException {
		Properties env = new Properties();
		env.put(Context.INITIAL_CONTEXT_FACTORY,
				"com.sun.jndi.rmi.registry.RegistryContextFactory");
		env.put(Context.PROVIDER_URL, "rmi://localhost:2199");
		
		InitialContext context = new InitialContext(env);
		return context;
	}



More information about the Esb-java-user mailing list