Hi, that definition of postgres-ds is not defined in jndi, but Spring. So you need to use Spring application context to obtain it (or register it in some kind of jndi store).
Cheers -- Dejan Bosanac - http://twitter.com/dejanb Open Source Integration - http://fusesource.com/ ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Thu, Jan 28, 2010 at 9:02 AM, mlus <m...@39596.com> wrote: > Hi. > > 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"/> > </bean> > > > 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. >