I'm using a MySQL ConnectionPoolDataSource so I've tried with
requiredType = javax.sql.ConnectionPoolDataSource and =
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource but both
failed when bootstrapping Shiro's environment.

If I comment that property, no errors are raised but I can't login in my
app. Also, I've been unable to put Shiro logging into a file.

Thanks anyway,
PP

On 18/05/12 22:54, Jared Bunting wrote:
> I believe you can do something like this: (untested)
>
> ds = org.apache.shiro.jndi.JndiObjectFactory
> ds.resourceName = jdbc/myDS
> ds.requiredType = javax.sql.DataSource # optional, but nice for early 
> failures
>
> jdbcRealm.datasource = $ds
>
> -Jared
>
> On Fri 18 May 2012 04:51:17 PM CDT, Paulo Pires wrote:
>> Hi all,
>>
>> How can one define a DataSource in 'shiro.ini' pointing to a JNDI. For
>> instance, I have the following properties set:
>>
>> ds = com.jolbox.bonecp.BoneCPDataSource
>> ds.driverClass=com.mysql.jdbc.Driver
>> ds.jdbcUrl=jdbc:mysql://localhost:3306/simple_shiro_web_app
>> ds.username = root
>> ds.password = 123qwe
>> jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
>> jdbcRealm.dataSource=$ds
>>
>> Unfortunately, everyone that has access to my WAR package is able to
>> read this configuration and eventually misuse it. And I don't want to
>> discuss here that I could create a MySQL user with read-only
>> permissions to the tables Shiro needs. That's not my point.
>>
>> What I'd really like, is to simply refer a JNDI path like this:
>> # DataSource previously configured in the container
>> ds = jdbc/myDS
>> jdbcRealm.datasource = $ds
>>
>> Is this even possible? If not, would it interest anyone else?
>>
>> Cheers,
>> --
>> Paulo Pires
>

-- 
Paulo Pires

Reply via email to