The only log I see in my shiro.log is just Shiro configuration stuff.
Check this snippet:
2012-05-18 16:59:57,277 TRACE
[org.apache.commons.beanutils.BeanUtils]: Target name = dataSource
2012-05-18 16:59:57,278 TRACE
[org.apache.commons.beanutils.PropertyUtils]: setSimpleProperty:
Invoking method public void
org.apache.shiro.realm.jdbc.JdbcRealm.setDataSource(javax.sql.DataSource) with
value JDBC URL = jdbc:mysql://localhost:3306/simple_shiro_web_app,
Username = root, partitions = 1, max (per partition) = 0, min (per
partition) = 0, helper threads = 3, idle max age = 60 min, idle test
period = 240 min (class com.jolbox.bonecp.BoneCPDataSource)
2012-05-18 16:59:57,304 TRACE
[org.apache.commons.beanutils.BeanUtils]:
setProperty(org.apache.shiro.web.mgt.DefaultWebSecurityManager@76e4000d,
realms, [org.apache.shiro.realm.jdbc.JdbcRealm@7c7c86ed])
2012-05-18 16:59:57,305 TRACE
[org.apache.commons.beanutils.BeanUtils]: Target bean =
org.apache.shiro.web.mgt.DefaultWebSecurityManager@76e4000d
2012-05-18 16:59:57,305 TRACE
[org.apache.commons.beanutils.BeanUtils]: Target name = realms
2012-05-18 16:59:57,305 TRACE
[org.apache.commons.beanutils.PropertyUtils]: setSimpleProperty:
Invoking method public void
org.apache.shiro.mgt.RealmSecurityManager.setRealms(java.util.Collection) with
value [org.apache.shiro.realm.jdbc.JdbcRealm@7c7c86ed] (class
java.util.ArrayList)
After this and while using the applications, nothing shows up.
I've been googling about Shiro in applications servers like Glassfish,
but so far, nothing interesting came up.
PP
On 18/05/12 17:05, Jared Bunting wrote:
> Still not seeing anything in the log?
>
> Are you running in Glassfish? I'm not overly familiar with it, but I
> wouldn't be surprised if it sets logging configuration itself, and
> therefore ignoring your local log4j.properties. Maybe there is
> somewhere else that you need to configure logging in Glassfish?
>
> Nothing about your shiro configuration jumps out at me, but hooking a
> debugger in and putting breakpoints in FormAuthenticationFilter and
> JdbcRealm may be enlightening.
>
> -Jared
>
>
> On Fri 18 May 2012 10:51:00 AM CDT, Paulo Pires wrote:
>> I added to the POM properties the following:
>> <slf4j.version>1.6.4</slf4j.version>
>>
>> Then I added two more dependencies:
>> <dependency>
>> <groupId>org.slf4j</groupId>
>> <artifactId>slf4j-api</artifactId>
>> <version>${slf4j.version}</version>
>> </dependency>
>> <dependency>
>> <groupId>org.slf4j</groupId>
>> <artifactId>slf4j-log4j12</artifactId>
>> <version>${slf4j.version}</version>
>> </dependency>
>>
>> I rebuilt and redeployed the WAR but there were no changes.
>> I also haven't removed any other dependencies.
>>
>> Any hints?
>>
>> Cheers,
>> PP
>>
>> On 18/05/12 16:37, Jared Bunting wrote:
>>> My first thought after looking at your pom - shiro uses slf4j, which
>>> means you will probably want slf4j-log4j12 to bridge between slf4j and
>>> log4j. (http://www.slf4j.org/manual.html#binding)
>>>
>>> On Fri 18 May 2012 10:19:56 AM CDT, Paulo Pires wrote:
>>>> Hi all,
>>>>
>>>> First of all, thanks to the project contributors for putting such an
>>>> effort in this project.
>>>>
>>>> Now, I'm struggling to get a simple Web application (just JSP 'stolen'
>>>> from Shiro samples code) to authenticate against a JDBC realm backed by
>>>> MySQL. Everytime I try to log-in the page just reloads again and doesn't
>>>> throw any kind of error.
>>>>
>>>> I've made the project source-code public, so that anyone can look at it,
>>>> and eventually it may become the basis for a tutorial on this. You can
>>>> check it at https://github.com/pires/simple-shiro-web-app
>>>>
>>>> I've tried to debug it, but somehow, my log4j configuration is not
>>>> working properly. I can see a 'shiro.log' file being generated and with
>>>> some output from commons.beanutils, but nothing about Shiro. I only get
>>>> error messages in Glassfish 'server.log' when some property in
>>>> 'shiro.ini' is wrongly configured.
>>>>
>>>> Any help will be highly appreciated.
>>>>
>>>> Thanks!
>>>>
>
--
Paulo Pires