Apache CXF freezes when closing tomcat

I connect in CXFServlet to my application that is already connected to the dispatcher servlet. The endpoint works very well, and everything works until we stop tomcat. I found that I can connect to the CXFServlet, and tomcat shuts down without problems until I connect to the bus. After which I see a problem with the shutdown hanging. To disable tomcat, I have to kill the process. Any ideas?

The threads remaining after closing tomcat are:

  • Demon Theme [Thread-2]
  • Theme [Event-1]
  • Theme [DestroyJavaVM]

Library and server versions used:

  • Apache CXF 3.0.1
  • Spring 4.0.3.RELEASE
  • Spring Security 3.2.0.RELEASE
  • Spring Java-config
  • Apache Tomcat 7.0.47

My pom.xml has the following dependencies on the cxf library and servlet-api library:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-jaxws</artifactId>
    <version>3.0.1</version>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>3.0.1</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>

CXFServlet:

@Order(3)
public class IMSWebServicesApplicationInitializer implements WebApplicationInitializer
{
@Override
public void onStartup(ServletContext servletContext) throws ServletException
{
    ServletRegistration.Dynamic servlet = servletContext.addServlet("CXFServlet", new CXFServlet());
    servlet.setLoadOnStartup(1);
    servlet.addMapping("/services/*");
}

, :

import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

import com.verisk.underwriting.id_access_api.api.authentication.AuthenticationService;
import com.verisk.underwriting.id_access_api.token.DefaultTokenInfo;
import com.verisk.underwriting.id_access_api.token.TokenService;
import com.verisk.underwriting.ims.web.service.LoginWebService;
import com.verisk.underwriting.ims.web.service.LoginWebServiceImpl;
import com.verisk.underwriting.modules.appbase.status.ServerStatusService;

@Configuration
@ImportResource({"classpath:META-INF/cxf/cxf.xml"})
public class IMSWebServicesConfiguration
{           
    @Bean
    @Autowired
    public EndpointImpl login(Bus bus, LoginWebService loginWebService)
    {       
        EndpointImpl endpointImpl = new EndpointImpl(bus, loginWebService);
        endpointImpl.setAddress("/login");
        endpointImpl.publish();
        return endpointImpl;
    }

    @Bean
    @Autowired
    public LoginWebService loginWebService(TokenService<DefaultTokenInfo> tokenService,     AuthenticationService authenticationService, 
            ServerStatusService<DefaultTokenInfo> serverStatusService)
    {
        return new LoginWebServiceImpl(tokenService, authenticationService,     serverStatusService);
    }
}

LoginWebService:

@WebService(name="login")
@SOAPBinding(style=Style.RPC, use=Use.LITERAL)
public interface LoginWebService
{
...
}

LoginWebService:

@WebService(endpointInterface="com.verisk.underwriting.ims.web.service.LoginWebService", serviceName="login")
public class LoginWebServiceImpl implements LoginWebService
{ 
...
}
+4
1

:

  • .
  • .
  • 60 shutdown,
  • 120 .

/ .

, , , , , , - .

+1

All Articles