Jetty in Mule only works in earlier version of Studio - jetty

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?

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:
http://www.mulesoft.org/documentation/display/current/Jetty+Transport+Reference
https://github.com/mulesoft/mule/tree/mule-3.x/transports/jetty
Was the Jetty transport added to your build path / POM file by Studio?

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.

Related

Publish .net Core web app as Web Deploy Package (MSDeploy) fails in Visual Studio 2017

I have created multiple sample project following the VS2017 .Net Core Web App template, targeting .Net Core and .NET Framework.
I have tested in all last three cumulative updates of VS2017; (i.e. Version 15.3.2, 15.3.3, 15.3.4)
Publishing to Web Deploy Package fails with the following error:
Target: .NET Core
Web deployment task failed. (Could not find file '\PublishTestNetCore.Parameters.xml'.) PublishTestNetCore C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets 88
Target: .NET Framework 461
Web deployment task failed. (Could not find file '\TestPublish461.Parameters.xml'.) TestPublish461 C:\Program Files\dotnet\sdk\1.1.0\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets 88
I am able to publish to IIS server though, but building the MSDeploy package always fail.
Thanks for any hint.
Mamrez
The issue was that the publish to package with latest VS 2017 cumulative updates required .NET Core 2.0 installed and that's odd!
I had to follow this link to install .NET Core 2.0 on my developer laptop to be able to publish MSDeploy packages that target non-.NET Core 2.0!!
[https://www.microsoft.com/net/core#windowscmd]

WSO2 AS 5.3.0 Linkage Error with slf4j

I try to deploy a war web application into WSO2 AS (5.3.0) and get an unexpected error regarding to slf4j as below,
The application is working well in both Tomcat 8.0.32 and Wildfly 10 Application Server.
Thanks,
Sean
If Carbon runtime environment is not needed, you may add the webapp-classloading.xml into your webapp, and configure it to use Tomcat runtime as explained in "Webapp Classloading" document.

Using Web Application created with Netbeans in Tomcat?

Sorry I newbie.
How to use Web Application ( with Web Services) created with Netbeans in my Tomcat that was manually installed?
I want to use my WA in my Tomcat (this tomcat wasn't installed with Netbeans).
My Tomcat is 8.0.3 version...
My Netbeans is:
Product Version: NetBeans IDE 8.0 (Build 201403101706)
Updates: Updates available to version NetBeans 8.0 Patch 2
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb)
I was following http://docs.huihoo.com/netbeans/6.0/kb/60/websvc/jax-ws.html.
I decided to use this old version because this link (newer version) https://netbeans.org/kb/docs/websvc/jax-ws.html is oriented to Glassfish.
Now I want to test my Web Services in Tomcat, I was thinking that I need to copy my folder named: CalculatorWSApplication to webapps\ROOT tomcat's folder, trying to do smothing like:
IPofMyHost:8080/CalculatorWSApplication/
or
IPofMyHost:8080/CalculatorWSApplication/CalculatorWS
I'm very lost
you can tell netebans you have tomcat (menu->tools->server->add server...)
and then configure you project to run with tomcat (project->properties->run->server...)
Or, after building you app in netbeans, just copy the .war file to the tomcat "webapps" folder.
Tomcat will do the deploy for you.

camel-example-cxf Not Deployed in ServiceMix 4.4.2

I was trying to run the camel-example-cxf example project which I downloaded from Camel website. (downloaded apache-camel-2.10.2)
I built the project using the pom.xml & the build was successful.
However when I tried to deploy it in servicemix (apache-servicemix-4.4.2) I am getting the following error.
karaf#root> ERROR: Bundle org.apache.camel.camel-example-cxf [43] Error starting file:/C:/apache-servicemix-4.4.2/deploy
/camel-example-cxf-2.10.2.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.camel.camel-example-cxf [43]: Unable to resolve 43.0: missing requirement [43.0] package; (&(package=org.apache.activemq.broker)(version>=5.7.0)(!(version>=6.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.camel.camel-example-cxf [43]: Unable to resolve 43.0: missing requirement [43.0] package; (&(package=org.apache.activemq.broker)(version>=5.7.0)(!(version>=6.0.0)))
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3446)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1734)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
at java.lang.Thread.run(Thread.java:619)
Please help
Apache ServiceMix 4.4.2 does not support Camel 2.10. You need to use the Camel version that it's shipped with, which is Camel 2.8.
Apache ServiceMix 4.5.0 will ship with Camel 2.10 and ActiveMQ 5.7. This release is in the works currently.
I had the same issue (but with activemq jar) and found that while running maven build i was using a different version than what servicemix had. you can find the version of jar file that are used by servicemix by using "exports" command (type export on servicemix command line) and you would come to know the version. if that is different than what you used for maven build then you would get that error. You have two option then
1. install different bundle in servicemix (with same version as used for maven build)
2. change the pom.xml to build maven build.

Cannot export Web Application to WSO2 Application Server with Developer Studio 2.1.0

I downloaded the latest version of WSO2 Developer Studio:
developer-studio-eclipse-jee-helios-linux-gtk-x86_64-2.1.0.zip
and the WSO2 Carbon 4 based Application Server version:
wso2as-5.0.1.zip
unzipped both and started Developer Studio. As I want to deploy a Maven
webapp project, I installed m2e on top of WSO2 Developer Studio.
Then I followed this article:
http://wso2.org/library/articles/2012/09/develop-deploy-web-applications-using-wso2-developer-studio#section3
apart from the fact that the WSO2 Carbon and WSO2 AS versions are different and that I already
have a maven war project which is imported into my workspace.
After creating a distribution project for my web app project, I add the webapp project
to it. Afterwards I add that distribution project to the Carbon Server (wit 'Add/Remove').
The WSO2 Carbon server is started, but then a message is shown 'Can't find export handler for war'.
We repeated the steps several times, sometimes this stack trace appears on the console:
java.lang.Exception: Can't find export handler for war
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.buildProject(ExportUtil.java:84)
at org.wso2.developerstudio.eclipse.distribution.project.export.CarExportHandler.exportArtifact(CarExportHandler.java:184)
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.buildProject(ExportUtil.java:81)
at org.wso2.developerstudio.eclipse.platform.core.project.export.util.ExportUtil.BuildCAppProject(ExportUtil.java:105)
at org.wso2.developerstudio.eclipse.distribution.project.ui.wizard.DistributionProjectExportWizard.performFinish(DistributionProjectExportWizard.java:181)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.wso2.developerstudio.eclipse.distribution.project.ui.action.ExportDistributionAction.run(ExportDistributionAction.java:36)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
What is the correct way of deploying a mavenized web app to the WSO2 Carbon Application Server from WSO2 Developer Studio?
Thanks
Can you paste the content of the Eclipse error log here for more inspection? Though it says it cannot find the Handler for WebApp, i suspect the real error is something else.
You can find the Eclipse Error log at /.metadata/.log file.
Regarding the correct way to deploy a Web-App to WSO2AS from WSO2 Developer Stidio, this article you referred explains the correct approach.
/Harshana
Maybe m2e on top of WSO2 Developer Studio is the problem. As I can deploy WARs into WSO2AS without running into any exception, but I don't have installed m2e in my WSO2 Developer Studio.
Have you compared your existing POM with the POM generated for a webproject by the WSO2 Developer Studio?