Howto re-create the WSO2 ESB BasicAuth-handler sample using WSO2 Developer Studio - wso2

I need to create something like the BasicAuthHandler proposed on the WSO2 ESB documentation but using the WSO2 Developer Studio. On the WSO2 ESB documentation they suggest downloading one existing example but don't gives any clue about howto make it using WSO2 Developer Studio. Is not the WSO2 Developer Studio the right way of developing custom code for the WSO2 Carbon platform?

Steps:
Download the code
Run mvn clean install -e
Import the code as a maven project using the WSO2 Developer Studio 3.8.0
It work fine for me.
Please check that you have org.apache.synapse:synapse-core:jar:2.1.1-wso2v2 in your maven repo. you can add a wso2 maven repo to your pom.xml file:
<repositories>
<repository>
<id>wso2-maven2-repository</id>
<url>http://dist.wso2.org/maven2</url>
</repository>
</repositories>

Related

Publish azure webjob from dotnet cli

I am trying to publish an azure webjob from the command line but it does not actually deploy to azure.
I am able to successfully publish using Visual Studio 2019 using the Publish... option. VS2019 builds, publishes and deploys.
My command line attempt seems to build and publish, but no deploy.
The command line I am using is:
dotnet.exe publish Events.WebJob.csproj --verbosity n /p:PublishProfile="hssedapi-dev-webdeploy" /p:Password="${apipwd}" /p:UseAppHost=true
dotnet --version returns "2.2.202"
I found "Develop and deploy WebJobs using Visual Studio - Azure App Service" which is fairly current. It has a link to "Enabling Command-line or Continuous Delivery of Azure WebJobs" but it is from 2014.
The following Publish methods are currently supported by the Publish package:
·Folder Publish
·MsDeploy Publish
·MsDeploy Package Publish
According to the code you provided, you use the MsDeploy Publish. Profile can be added to the following location in the project /Properties/PublishProfiles/<MsDeployProfile.pubxml>. Here is sample MsDeploy Publish Profile:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://webappwithdb.azurewebsites.net</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<MSDeployServiceURL>webappwithdb.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>webappwithdb</DeployIisAppPath>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>$vramakwebappwithdb</UserName>
<Password>DeployPassword</Password>
</PropertyGroup>
</Project>

WSO2: Where to get a working Eclipse plugin from to start WSO2 from within Eclipse?

I have an Eclipse Luna installation and want to start the already installed WSO2 5.2.1 from within Eclipse. How can I do this and where can I get a plugin which is able to be installed successfully? I tried to install it via Eclipse Marketplace but always get an error
An error occurred while collecting items to be installed session
context was:(profile=epp.package.jee,
phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=,
action=). Unable to read repository at
http://dist.wso2.org/p2/developer-studio/releases/3.6.0/plugins/org.wso2.developerstudio.eclipse.libraries-3.6.0.jar.
Connection reset
I also tried to download the WSO2 Developer Studio 3.7.0 (wso2-developer-studio_3.7.0.zip) but it also doesn't work.
In the end I want to start the WSO2 Application Server from within Eclipse and to debug the implemented web service.
Well, first I ran Eclipse under jdk 1.6.30. Now with jdk 1.7.45 I see a lot of WSO2 features...
Correction:
I had to install WSO2 Developer Studio 3.6.0 via Eclipse Marketplace first and have to update to version 3.7.0 afterwards because http://dist.wso2.org/p2/developer-studio/releases/3.7.0/plugins/org.wso2.developerstudio.eclipse.libraries-3.7.0.jar is not readable.

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?

root-artifact.xml does not automatically generate when create CApp project (wso2 carbon studio v2.0.1)

I installed wso2 carbon studio 2.0.1 (ref: http://wso2.org/project/developer-studio/2.0.1/docs/install_guide.html, https://wso2.org/jira/browse/TOOLS-739), but root-artifact.xml does not automatically generate when CApp project creating. And a pom.xml file has been created over here. Could I build a root-artifact.xml manually?
WSO2 Developer Studio 2.0.0 and later versions no longer uses the root-artifact.xml and the previous C-App model.
There are fundamental changes between Dev Studio 2.x.x versions and 1.0.x versions such as dropping root-artifact.xml, introducing pom.xml and using pom.xml for metadata management, new project structure, etc.
So it is not a bug in Dev Studio 2.0.0 but rather how it is designed.
well, wso2 carbon studio v1.0.14 is working. It seems a new bug for v2.0.1.

Deploying web app on Stratos Live

I Need to deploy a web application on Stratos server. I went through this blog post http://dakshithar.blogspot.com/2011/08/how-to-deploy-web-application-in.html and this slideshow http://engwar.com/p/java-paas-gs/#wa01. They have information on deploying a web app to Stratos using Eclipse and Carbon Studio.
I have already created my web application on Netbeans IDE, so is there anyway to configure Carbon Studio with Netbeans?
Is it necessary to use Carbon Studio with Eclipse application deployment, or can I run web applications that I have developed in Netbeans on Stratos Live server? Or is migrating from Netbeans to Eclipse the only option?
Carbon studio is a Eclipse-based SOA development environment for the Carbon platform.Here are the Answers for your questions.
Q :- Is there anyway to configure Carbon Studio with Netbeans?
A :- NO,since carbon studio is eclipse based tooling environment it can not be configured with Netbeans.
Q :- Is it necessary to use Carbon studio with Eclipse application deployment can I run web applications that I have developed in Netbeans on Stratos Live server?
A :- When it comes to web application development,it is not necessary to use Carbon studio for Stratos Live or WSO2 Application server deployment.But if you going to develop any other SOA components with WSO2 products life will be easier with Carbon Studio.
As an alternative you can import your .war file (that you already have) in to carbon studio by using New Web Application wizard.