Spring Boot:Tomcat嵌入了HTTP / 2和TLS

时间:2016-12-07 14:08:07

标签: tomcat spring-boot tomcat8

我尝试在Windows 10机器上配置带有HTTP / 2和TLS的Tomcat Embedded 8.5.8。 PATH环境变量都包含tcnative-1.dll和openssl.exe。 但是,我得到了以下堆栈跟踪。任何提示都表示赞赏。

... 12:31:39.418 INFO [o.a.t.u.n.NioSelectorPool] [main] Using a shared selector for servlet write/read 12:31:39.424 INFO [o.a.c.h.Http11NioProtocol] [main] The ["https-openssl-nio-8444"] connector has been configured to support negotiation to [h2] via ALPN 12:31:39.424 INFO [o.a.c.h.Http11NioProtocol] [main] Initializing ProtocolHandler ["https-openssl-nio-8444"] 12:31:39.462 ERROR [o.a.c.c.StandardService] [main] Failed to start connector [Connector[HTTP/1.1-8444]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8444]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225) [tomcat-embed-core-8.5.8.jar:8.5.8] at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:233) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:178) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:297) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:145) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) [spring-context-5.0.0.M3.jar:5.0.0.M3] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) [spring-boot-1.4.2.RELEASE.jar:1.4.2.RELEASE] at de.hska.kunden.Microservice.main(Microservice.java:53) [main/:?] Caused by: java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.Pool.create(J)J at org.apache.tomcat.jni.Pool.create(Native Method) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.openssl.OpenSSLEngine.<clinit>(OpenSSLEngine.java:72) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.openssl.OpenSSLUtil.getImplementedProtocols(OpenSSLUtil.java:61) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.SSLUtilBase.<init>(SSLUtilBase.java:53) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.openssl.OpenSSLUtil.<init>(OpenSSLUtil.java:41) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.openssl.OpenSSLImplementation.getSSLUtil(OpenSSLImplementation.java:36) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:91) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:81) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:245) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:875) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:213) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:558) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:65) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.catalina.connector.Connector.initInternal(Connector.java:968) ~[tomcat-embed-core-8.5.8.jar:8.5.8] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) ~[tomcat-embed-core-8.5.8.jar:8.5.8] ... 13 more

1 个答案:

答案 0 :(得分:0)

虽然这可能无法解决您的问题,但您使用的是哪个版本的Spring Boot? 我试图将Tomcat从8.5.6升级到8.5.8时遇到了问题,类似于已经在使用的端口。您可以使用默认版Tomcat Spring Boot正在使用吗?