我正在尝试在我的服务器上部署Spring Boot 1.3.1.RELEASE
服务。我在本地运行时没有任何问题,当我在服务器上运行它时,我遇到了这个例外:
2015-12-22 10:45:36, 232 [-] [ main] INFO omcat.util.net.NioSelectorPool l180 - Using a shared selector for servlet write/read
2015-12-22 10:45:36, 261 [-] [ main] INFO TomcatEmbeddedServletContainer l159 - Tomcat started on port(s): 9290 (http)
2015-12-22 10:45:36, 266 [-] [ main] INFO e.webservice.ApplicationRunner l56 - Started ApplicationRunner in 100.827 seconds (JVM running for 128.605)
2015-12-22 10:45:36, 366 [-] [nio-9290-exec-1] ERROR oyote.http11.Http11NioProtocol l182 - Error reading request, ignored
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/apache/coyote/http11/AbstractHttp11Processor.asyncDispatch(Lorg/apache/tomcat/util/net/SocketStatus;)Lorg/apache/tomcat/util/net/AbstractEndpoint$Handler$SocketState; @80: invokeinterface
Reason:
Type 'java/lang/Object' (current frame, stack[2]) is not assignable to 'java/lang/Throwable'
Current Frame:
bci: @80
flags: { }
locals: { 'org/apache/coyote/http11/AbstractHttp11Processor', 'org/apache/tomcat/util/net/SocketStatus', 'java/lang/Object' }
stack: { 'org/apache/juli/logging/Log', 'java/lang/String', 'java/lang/Object' }
Bytecode:
0x0000000: 2bb2 04a4 a600 632a b401 04b6 04a8 c600
0x0000010: 592a b402 30b6 04ab 2ab4 00f1 b604 ae99
0x0000020: 0019 2ab4 00f1 03b6 04b1 9900 0e2a b400
0x0000030: f1b6 04b4 b203 65b0 a700 7d4d 2ab6 0087
0x0000040: b901 cb01 0099 0010 2ab6 0087 1304 b62c
0x0000050: b902 9903 00b2 04b9 4c2a b401 2c13 04bb
0x0000060: 2cb6 04bf a700 512b b202 74a6 004a 2ab4
0x0000070: 012c b604 c3c6 0040 2ab4 0230 b602 5399
0x0000080: 000a 2ab4 0230 b604 aba7 002c 4d2a b600
0x0000090: 87b9 01cb 0100 9900 102a b600 8713 04c5
0x00000a0: 2cb9 0299 0300 b204 c84c 2ab4 012c 1304
0x00000b0: bb2c b604 bf2a b401 2cb6 02d7 4d2c 06b6
0x00000c0: 02dc 2ab6 0321 2ab4 012c 2ab4 0104 2bb9
0x00000d0: 04cb 0400 9a00 0b2a b201 fb01 b601 c62a
0x00000e0: b604 cea7 002f 4e2a b201 fb2d b601 c6a7
0x00000f0: 0023 4e2d b803 102a b201 fb2d b601 c62a
0x0000100: b600 87b2 01d0 1303 47b6 01d8 2db9 034a
0x0000110: 0300 2c10 07b6 02dc 2ab6 0217 b602 1a99
0x0000120: 000e 2ab4 012c b603 50b2 0362 b02a b602
0x0000130: f299 0007 b203 65b0 2ab4 012c b603 502a
0x0000140: b400 509a 0007 b203 62b0 2ab6 016e b603
0x0000150: 562a b601 7ab6 0357 b203 71b0
Exception Handler Table:
bci [17, 55] => handler: 59
bci [17, 55] => handler: 59
bci [120, 137] => handler: 140
bci [189, 227] => handler: 230
bci [189, 227] => handler: 242
Stackmap Table:
same_frame(@56)
same_locals_1_stack_item_frame(@59,Object[#711])
append_frame(@85,Object[#711])
chop_frame(@103,1)
same_frame(@137)
same_locals_1_stack_item_frame(@140,Object[#1185])
append_frame(@166,Object[#1185])
chop_frame(@181,1)
append_frame(@223,Object[#729])
same_locals_1_stack_item_frame(@230,Object[#721])
same_locals_1_stack_item_frame(@242,Object[#719])
same_frame(@274)
same_frame(@301)
same_frame(@312)
same_frame(@330)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.createProcessor(Http11NioProtocol.java:265)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.createProcessor(Http11NioProtocol.java:140)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
我对这里发生的事情一无所知。我对一些相关的问题(比如this one)有所了解,这个错误可能与某些编译问题有关。所以,我在服务器和本地验证了两个JDK:
server@ic-rs-user-00:~/data$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
server@ic-rs-user-00:~/data$ javac -version
javac 1.8.0_60
local@user:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
local@user:~$ javac -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
javac 1.8.0_45
正如你所看到的,这些版本并不相同,但我不认为可能存在问题,因为两者都是1.8。此外,我已经检查了依赖联盟但显然一切都很好:
local@user:~/Documents/project$ mvn dependency:tree -Dincludes=org.apache*
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ project-webservice ---
[INFO] com.business.project:project-webservice:jar:0.0.1-SNAPSHOT
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:1.3.1.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.1.RELEASE:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.30:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.30:compile
[INFO] +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.30:compile
[INFO] \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.30:compile
有什么想法吗?