1

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

Within my mule configuration:

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

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'

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.

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

In jetty-rest.xml:

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

In jetty-soap.xml:

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

What am I missing or doing wrong?

EmPak5
  • 1,205
  • 2
  • 10
  • 11
  • Are you using Jetty transport or is it a third party connector? The link about the instructions doesn't work. – Ale Sequeira May 27 '14 at 15:16
  • @AleSequeira It's the Mule Jetty connector. And it appears that instruction page I linked has been removed within the last 20 minutes. – EmPak5 May 27 '14 at 15:20
  • 1
    Why not to use Jetty Transport, which is a Mule supported transport? – Ale Sequeira May 27 '14 at 15:29
  • @AleSequeira I meant the Jetty transport. If I don't include the Jetty JAR, I get the error `Cannot load class 'org.mortbay.jetty.Server'`. This doesn't happen at all in the earlier version of Mule. – EmPak5 May 27 '14 at 15:38

2 Answers2

1

You should not need to add the Jetty JAR yourself: they should be brought in your project as part of the Mule Jetty Transport, which is very much an officially supported core transport:

Was the Jetty transport added to your build path / POM file by Studio?

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • In the original project using Mule Studio (Mule Server `3.4.1`), I did not have to add the Jetty JAR. However, after importing that project to Anypoint Studio (Mule Server `3.5.0`), I get the error `Cannot load class 'org.mortbay.jetty.Server'`. That's why I tried to add the Jetty JAR, which now gives the error indicated in my question. – EmPak5 May 27 '14 at 18:03
  • The Jetty transport should have brought this JAR. Is the Jetty transport in your project build path / POM? – David Dossot May 27 '14 at 21:59
  • The `Mule Server 3.5.0 EE` library contains a number of Jetty JARs... However, `pom.xml` doesn't seem to contain any Jetty configurations. – EmPak5 May 28 '14 at 01:37
  • Not even the Jetty transport with `provided` scope? – David Dossot May 28 '14 at 15:09
  • No, the only `provided` scope is for groupId `org.apache.httpcomponents`. – EmPak5 May 29 '14 at 13:37
  • Another question: does the application run on Mule itself? Or does it fail also when you deploy on Mule? – David Dossot May 29 '14 at 13:56
  • It doesn't start the app; shortly after `Initializing app 'project-name'`, I get the error. The same result for both. – EmPak5 May 29 '14 at 14:32
  • Feels like a bug then: open a JIRA or contact MuleSoft support directly. – David Dossot May 29 '14 at 15:36
1

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.

Within 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

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

EmPak5
  • 1,205
  • 2
  • 10
  • 11