[
https://issues.apache.org/jira/browse/SHIRO-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15670668#comment-15670668
]
Brian Demers commented on SHIRO-602:
------------------------------------
The logging implementation is up to you, we typically suggest using
{{jcl-over-slf4j}} instead of commons-logging, as the Shiro itself uses `slf4j`
for all logging.
Some of the samples use log4j:
https://github.com/apache/shiro/blob/master/samples/quickstart/pom.xml#L63-L78
And others use logback (my personal preference)
https://github.com/apache/shiro/blob/master/samples/jaxrs/pom.xml#L83-L93
That said, as you are describing this is less obvious, and we could probably do
something better to make the initial experience better. Any ideas?
> Missing dependency commons-logging
> ----------------------------------
>
> Key: SHIRO-602
> URL: https://issues.apache.org/jira/browse/SHIRO-602
> Project: Shiro
> Issue Type: Bug
> Affects Versions: 1.4.0-RC2
> Environment: Apache Tomcat 8.5.x with shiro-servlet-plugin
> Reporter: Björn Raupach
>
> While playing around with Apache Shiro 1.4.0-RC2 I happened to remove a
> dependency that relied on commons-logging.
> In
> [0c49ef7|https://github.com/apache/shiro/blob/77c59622b0b25651f2afbb7f45d86cee0e810d6c/pom.xml]
> commons-logging was excluded in the pom.xml.
> Unfortunately commons-beanutils needs commons-loggings. So I now end up with
> a project that needs commons-logging, but doesn't declare it since besides
> Shiro no other dependency needs it.
> {noformat}
> 16-Nov-2016 14:22:10.611 SEVERE [http-nio-8080-exec-2]
> org.apache.catalina.core.StandardContext.listenerStart Exception sending
> context initialized event to listener instance of class
> org.apache.shiro.web.env.EnvironmentLoaderListener
> java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
> at
> org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:154)
> at
> org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:113)
> at
> org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:64)
> at
> org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:60)
> at
> org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:154)
> at
> org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:76)
> at
> org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:107)
> at
> org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:498)
> at
> org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:418)
> {noformat}
> To fix this I had to add commons-logging in my project's pom.xml
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)