You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shiro.apache.org by "Lenny Primak (Jira)" <ji...@apache.org> on 2022/08/14 05:35:00 UTC

[jira] [Commented] (SHIRO-602) Missing dependency commons-logging

    [ https://issues.apache.org/jira/browse/SHIRO-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17579327#comment-17579327 ] 

Lenny Primak commented on SHIRO-602:
------------------------------------

I just ran into this as well. The dependency needs to be documented, or there needs to be some other way to bring in jcl-over-slf4j (as default) so no runtime errors happen

> 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
>            Priority: Major
>
> 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
> *Edit*
> Here is a dependency:tree from my previous version:
> # Shiro 1.3.2 with Tomahawk 2.1 Core
> {noformat}
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ gastroapp-admin ---
> [INFO] de.e2n.gastroapp:gastroapp-admin:war:1.0
> [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
> [INFO] +- org.glassfish:javax.faces:jar:2.2.13:compile
> [INFO] +- org.apache.myfaces.tomahawk:tomahawk21:jar:1.1.14:compile
> [INFO] |  +- commons-logging:commons-logging:jar:1.1.1:compile
> [INFO] |  +- commons-validator:commons-validator:jar:1.3.1:compile
> [INFO] |  |  \- commons-digester:commons-digester:jar:1.6:compile
> [INFO] |  |     \- xml-apis:xml-apis:jar:1.0.b2:compile
> [INFO] |  +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
> [INFO] |  +- commons-io:commons-io:jar:1.3.2:runtime
> [INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile
> [INFO] |  +- commons-codec:commons-codec:jar:1.3:compile
> [INFO] |  +- oro:oro:jar:2.0.8:compile
> [INFO] |  +- commons-lang:commons-lang:jar:2.4:compile
> [INFO] |  +- javax.servlet:jstl:jar:1.2:compile
> [INFO] |  \- batik:batik-awt-util:jar:1.6-1:compile
> [INFO] |     \- batik:batik-util:jar:1.6-1:compile
> [INFO] |        \- batik:batik-gui-util:jar:1.6-1:compile
> [INFO] |           \- batik:batik-ext:jar:1.6-1:compile
> [INFO] |              \- xml-apis:xmlParserAPIs:jar:2.0.2:compile
> [INFO] +- org.omnifaces:omnifaces:jar:2.5.1:compile
> [INFO] +- org.jboss.weld.servlet:weld-servlet:jar:2.4.0.Final:compile
> [INFO] +- org.mybatis:mybatis:jar:3.4.1:compile
> [INFO] +- org.mybatis:mybatis-typehandlers-jsr310:jar:1.0.1:compile
> [INFO] +- org.mybatis:mybatis-cdi:jar:1.0.0-beta3:compile
> [INFO] +- org.apache.shiro:shiro-core:jar:1.3.2:compile
> [INFO] |  \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
> [INFO] +- org.apache.shiro:shiro-web:jar:1.3.2:compile
> [INFO] +- org.apache.shiro:shiro-faces:jar:2.alpha.0-SNAPSHOT:compile
> [INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
> [INFO] \- org.slf4j:slf4j-jdk14:jar:1.7.21:compile
> {noformat}
> And here is the recent one where we upgraded to 1.4.0-RC2 and dropped Tomahawk
> {noformat}
> [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ gastroapp-admin ---
> [INFO] de.e2n.gastroapp:gastroapp-admin:war:1.0
> [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
> [INFO] +- org.glassfish:javax.faces:jar:2.2.13:compile
> [INFO] +- org.omnifaces:omnifaces:jar:2.5.1:compile
> [INFO] +- org.jboss.weld.servlet:weld-servlet:jar:2.4.0.Final:compile
> [INFO] +- org.mybatis:mybatis:jar:3.4.1:compile
> [INFO] +- org.mybatis:mybatis-typehandlers-jsr310:jar:1.0.1:compile
> [INFO] +- org.mybatis:mybatis-cdi:jar:1.0.0-beta3:compile
> [INFO] +- org.apache.shiro:shiro-servlet-plugin:jar:1.4.0-RC2:compile
> [INFO] |  \- org.apache.shiro:shiro-web:jar:1.4.0-RC2:compile
> [INFO] |     \- org.apache.shiro:shiro-core:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-lang:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-cache:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-crypto-hash:jar:1.4.0-RC2:compile
> [INFO] |        |  \- org.apache.shiro:shiro-crypto-core:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-crypto-cipher:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-config-core:jar:1.4.0-RC2:compile
> [INFO] |        +- org.apache.shiro:shiro-config-ogdl:jar:1.4.0-RC2:compile
> [INFO] |        |  \- commons-beanutils:commons-beanutils:jar:1.9.3:compile
> [INFO] |        |     \- commons-collections:commons-collections:jar:3.2.2:compile
> [INFO] |        \- org.apache.shiro:shiro-event:jar:1.4.0-RC2:compile
> [INFO] +- org.apache.shiro:shiro-faces:jar:2.alpha.0-SNAPSHOT:compile
> [INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
> [INFO] \- org.slf4j:slf4j-jdk14:jar:1.7.21:compile
> {noformat}
> If I add commons-logging or jcl-over-slf4j the projects starts as expected. So it looks like I was just lucky that it started in the first place ;) 
> Did I miss the part in the documentation that says a briding api is needed? 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@shiro.apache.org
For additional commands, e-mail: issues-help@shiro.apache.org