java—同一个应用程序在两台机器上的行为不同

rbpvctlc  于 2021-07-09  发布在  Java
关注(0)|答案(1)|浏览(445)

我在启动apache flume时遇到此异常:

2021-04-20 20:04:11,463 (qtp39926397-25) [WARN - org.eclipse.jetty.server.HttpChannel.handleException(HttpChannel.java:600)] 
java.lang.NoSuchMethodError: org.eclipse.jetty.util.Attributes.unwrap(Lorg/eclipse/jetty/util/Attributes;)Lorg/eclipse/jetty/util/Attributes;
    at org.eclipse.jetty.server.Request.recycle(Request.java:1870)
    at org.eclipse.jetty.server.HttpChannel.recycle(HttpChannel.java:309)
    at org.eclipse.jetty.server.HttpChannelOverHttp.recycle(HttpChannelOverHttp.java:81)
    at org.eclipse.jetty.server.HttpConnection.onCompleted(HttpConnection.java:435)
    at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:743)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:363)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:272)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
    at java.lang.Thread.run(Thread.java:748)

我正在使用 <jetty.version>9.4.30.v20200611</jetty.version> .
问题是,它在我的本地机器上运行良好,但当我尝试在虚拟机上运行我的应用程序时,它抛出了这个错误不知道是什么问题?
我使用 mvn dependency:tree -Dincludes=org.eclipse.jetty:jetty-util 没有发现任何不同的版本。

v09wglhw

v09wglhw1#

您在apache flume上的部署使用的是早于9.4.29的jetty版本(其中 Attributes.unwrap() 是最早引进的)。
仔细检查jetty服务器的启动日志,它将宣布它认为正在运行的版本。
例子:

2021-04-20 16:37:05.615:INFO:oejs.Server:main: jetty-9.4.40.v20210413; built: 2021-04-13T20:42:42.668Z; git: b881a572662e1943a14ae12e7e1207989f218b74; jvm 11.0.10+9

or 

2021-04-20 16:37:22.790:INFO:oejs.Server:main: jetty-9.3.25.v20180904, build timestamp: 2018-09-04T16:11:46-05:00, git hash: 3ce520221d0240229c862b122d2b06c12a625732

相关问题