activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlus <>
Subject How to get DataSouce from JNDI ?
Date Thu, 28 Jan 2010 08:02:36 GMT

I want to create JAAS Authentication Plugin.

This plugin module get login date through javax.sql.DataSource.

In activemq.xml, I set ....

<bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource">
      <property name="serverName" value="localhost"/>
      <property name="databaseName" value="activemq"/>
      <property name="portNumber" value="0"/>
      <property name="user" value="activemq"/>
      <property name="password" value="activemq"/>
      <property name="dataSourceName" value="postgres"/>
      <property name="initialConnections" value="1"/>
      <property name="maxConnections" value="10"/>

In plugin module class,

Context initCtx = new InitialContext();
Object obj = initCtx.lookup(postgres-ds);
DataSouce ds = (DataSouce)obj.

Plugin Module class can't get DataSouce from JNDI !!

How can I get DataSouce from JNDI ?

Thank you.

View raw message