Stack Exchange
ClassNotFoundException: org.apache.shiro.web.env.EnvironmentLoaderListener
I have simple RESTful service based on Jersey and Shiro security.
But all crashed when I tried to deploy.
web.xml
<servlet>
    <servlet-name>Application</servlet-name>
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
    <init-param>
        <param-name>jersey.config.server.provider.packages</param-name>
        <param-value>alexiuscrow.ws</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Application</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>

Gradle dependencies:
dependencies {
    compile 'org.glassfish.jersey.core:jersey-server:2.19'
    compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.19'
    compile 'org.apache.shiro:shiro-core:1.2.3'
    compile 'org.apache.shiro:shiro-web:1.2.3'
}

Output:
18-Jul-2015 21:28:10.775 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class org.apache.shiro.web.env.EnvironmentLoaderListener
 java.lang.ClassNotFoundException: org.apache.shiro.web.env.EnvironmentLoaderListener
//...

What's wrong? Why it can't deploy?

How you are deploying your app ... like war?

@Garry, yes. war file

You using Shiro 1.2.4 ? and you have included slf4j-api-1.7.12 ?
(slf4j required by Shiro)
The actually problem is from slf4j-api-1.7.12
It said:
Uncaught exception from servlet
java.lang.ExceptionInInitializerError
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:149)
    ...
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createSecurityManager")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:382)

My solution
I put slf4j-api-1.7.7

It seems that jar file may not be copied to the WEB-INF/lib folder while building.
Try to use the war plugin/task, all the dependencies of the runtime configuration will be copied to WEB-INF/lib
