Failed to destroy endpoint associated with ProtocolHandler ["ajp-nio-8009"]

New in spring sqcurity, I was doing spring security with maven and mash with a bad error, I think I broke compile rule or whatever, excluding compile time. I realized I got the wrong xml configuration but couldn't find it. Here is my dispatcherservlet.xml .

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">


<context:component-scan base-package="com.mysecurity.springsecurity" />

<bean
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix">
        <value>/WEB-INF/pages/</value>
    </property>
    <property name="suffix">
        <value>.jsp</value>
    </property>
</bean>

      

spring-security.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">

<http auto-config="true">
    <intercept-url pattern="/admin**" access="ROLE_USER" />
</http>

<authentication-manager>
    <authentication-provider>
        <user-service>
            <user name="admin" password="admin" authorities="ROLE_USER" />
        </user-service>
    </authentication-provider>
</authentication-manager>

      

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<display-name>Spring Secured Application</display-name>

<servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- Loads Spring Security config file -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/spring-security.xml
    </param-value>
</context-param>

<!-- Spring Security -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

      

Tomcat server log

 `SEVERE: The required Server component failed to start so Tomcat is unable to start.
  org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at 
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Caused by: org.apache.catalina.LifecycleException: Failed to start 
component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 7 more

      

Caused by: org.apache.catalina.LifecycleException: Failed to start the [StandardEngine [Catalina]] component at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:162) at org.apache.catalina.core.StandardService. startInternal (StandardService.java:441) at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:145) ... 9 more Thrown from: org.apache.catalina.LifecycleException: child container did not fire during startup at org.apache.catalina.core.ContainerBase.startInternal (ContainerBase.java:951) at org.apache.catalina.core.StandardEngine.startInternal (StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start ( LifecycleBase.java:145) ... more 11 Jun 15, 2017 7:14:49 PM org.apache.coyote.AbstractProtocol pause INFO: pause protocol Handler ["http-nio-8080"] Jun 15,2017 7:14:49 PM org.apache.coyote.AbstractProtocol pause INFO: pause protocol Handler ["ajp-nio-8009"] Jun 15, 2017 7:14:49 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping Catalina service June 15, 2017 7:14:49 PM org.apache.coyote.AbstractProtocol destroy INFO: Handler protocol destruction ["http-nio-8080"] June 15, 2017 7:14:49 PM org.apache.coyote. AbstractProtocol destroy SEVERE: Failed to destroy endpoint associated with ProtocolHandler ["http-nio-8080"] java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.releaseCaches (NioEndpoint.java:315) at org .apache.tomcat.util.net.NioEndpoint.unbind (NioEndpoint.java:491) at org.apache.tomcat.util.net.AbstractEndpoint.destroy (AbstractEndpoint.java:883) at org.apache.coyote.AbstractProtocol.destroy (AbstractProtocol.java:551) at org.apache.catalina.connector.Connector.destroyInternal (Connector.java:1023) at org.apache.catalina.util.LifecycleBase.destroy (LifecycleBase.java:292) at org.apache.catalina.core.StandardService.destroyInternal (StandardService.java:589) at org.apache.catalina.util.LifecycleBase.destroy (LifecycleBase.java:292) at org.apache. catalina.core.StandardServer.destroyInternal (StandardServer.java:879) at org.apache.catalina.util.LifecycleBase.destroy (LifecycleBase.java:292) at org.apache.catalina.startup.Catalina.start (Catalina.java: 633) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.apache.catalina.startup.Bootstrap.start (Bootstrap.java:351) at org.apache.catalina .startup.Bootstrap.main (Bootstrap.java:485)

+3


source to share





All Articles