Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4.0-RC2
-
None
-
None
-
None
-
Apache Tomcat 8.5.x with shiro-servlet-plugin
Description
While playing around with Apache Shiro 1.4.0-RC2 I happened to remove a dependency that relied on commons-logging.
In 0c49ef7 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.
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)
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
[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
And here is the recent one where we upgraded to 1.4.0-RC2 and dropped Tomahawk
[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
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?