activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: How to get DataSouce from JNDI ?
Date Thu, 28 Jan 2010 08:34:29 GMT
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 <mlus@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message