本文介绍了Mule中的Jetty仅在Studio的早期版本中有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Mule中的Jetty连接器时遇到问题.

I'm having problems using the Jetty connectors in Mule.

在我的mule配置中:

<jetty:connector name="JettyRest" configFile="jetty-rest.xml" doc:name="Jetty" />
<jetty:connector name="JettySoap" configFile="jetty-soap.xml" doc:name="Jetty" />

在Mule Studio中运行(使用Mule Server Runtime 3.4.0 CE)完全没有问题.但是,将项目导入到Anypoint Studio中并在其中运行(使用Mule Server Runtime 3.5.0 CE)后,出现以下错误:

There is no problem at all when running in Mule Studio (using Mule Server Runtime 3.4.0 CE). However, after importing the project to and running in Anypoint Studio (using Mule Server Runtime 3.5.0 CE), I get the following error:

Cannot load class 'org.mortbay.jetty.Server'

即使我手动将 Jetty JAR从此处添加到构建路径中,我收到此错误:

Even if I manually include the Jetty JAR from here to the build path, I get this error:

Object of class 'org.eclipse.jetty.server.Server' is not of type 'org.mortbay.jetty.Server'. Object Class and type Class are from different loaders.

与Mule独立版3.4.0 CE3.5.0 CE一起运行时,存在相同的问题.

The same issue is present when running with Mule standalone 3.4.0 CE vs 3.5.0 CE.

jetty-rest.xml中:

<Configure id="Server" class="org.mortbay.jetty.Server">

jetty-soap.xml中:

<Configure id="ServerForSlow" class="org.mortbay.jetty.Server">

我想念什么或做错什么了?

What am I missing or doing wrong?

推荐答案

我设法发现了导致此问题的原因.现在,Mule 3.5.0 CE Jetty传输使用Jetty 8,而我以前将Jetty 6与Mule 3.4.0 CE一起使用.

I managed to discover what causes the issue. The Mule 3.5.0 CE Jetty transport now uses Jetty 8, and I was previously using Jetty 6 with Mule 3.4.0 CE.

MIGRATION.txt内:

MULE-7061: Jetty transport is now using Jetty 8. Applications using a custom jetty.xml configuration file must update the Jetty classes referenced in this file due to package names changed from version 6 to 7, as explained here: http://wiki.eclipse.org/Jetty/Starting/Porting_to_Jetty_7/Packages_and_Classes

按照提供的链接中的说明进行操作后,我将文件转换为码头8.

After following the instructions in the link provided I converted my files to use Jetty 8.

这篇关于Mule中的Jetty仅在Studio的早期版本中有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 11:41