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

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?

Related

org.osgi.framework.BundleException: Could not resolve module: org.wso2.carbon.capp.monitor

I am using WSO2 Integration Studio 8.1.0 to develop an API on my machine, and when trying to run on Micro Integrator, I get the following error :
ERROR {Framework} - FrameworkEvent ERROR org.osgi.framework.BundleException: Could not resolve module: org.wso2.carbon.capp.monitor [170]
Unresolved requirement: Import-Package: org.wso2.carbon.application.deployer
at org.eclipse.osgi.container.Module.start(Module.java:457)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
But after the error appears in the console the application runs fine.
Any ideas why I get this error and how to avoid it ?
This issue is happening due to a bug[1] in the Integration Studio. Due to this bug, the Studio was using the configuration of the older MI version to run/debug CApps. To fix this you will need to update the Integration Studio and manually remove some configurations as follows,
Remove the server configurations under ESB Mediation Debugger and Generic Server in Debug Configurations,
If the org.wso2.carbon.capp.monitor-3.0.0 jar is already present in IntegrationStudio/runtime/microesb/dropins folder remove it as well.
Restart the Integration Studio to load the new configurations shipped with the latest updates.
Please refer Get the latest updates to install the latest updates to Integration Studio.
[1] - https://github.com/wso2/api-manager/issues/772
The components of the MI product are activated as OSGI bundles at the kernel level during the server startup process. In this case, the OSGI bundle related to org.wso2.carbon.capp.monitor module is not activated because the org.wso2.carbon.application.deployer module is not available at the time when the OSGI bundle related to org.wso2.carbon.capp.monitor module is activated. As a result, the bundle activation issue will be visible during the initial server startup process.
However, once the bundle related to org.wso2.carbon.application.deployer is successfully activated, the OSGI bundle related to org.wso2.carbon.capp.monitor module will also be successfully re-activated, even if the bundling exception occurred during the initial bundle activation process.
We can check whether the OSGI bundle related to the org.wso2.carbon.capp.monitor module was successfully activated by looking for the org.wso2.carbon.capp.monitor-3.0.0.jar file in the <Integration_STUDIO_INSTALLED_LOCATION>/runtime/microesb/dropins directory after starting the MI server; additionally, the CAR application will not be deployed successfully if the OSGI bundle was not properly activated during the server startup process.
You can also validate it by redeploying the CAR application into the MI server. You will not notice the issue during the CAR application redeployment process because it occurs due to the order in the bundle activation process during the server startup.
This issue has been reported:
https://github.com/wso2/api-manager/issues/772
Please take the latest update by following the official guide:
https://apim.docs.wso2.com/en/latest/integrate/develop/installing-wso2-integration-studio/#get-the-latest-updates
Cheers!
Nadun.

MSBuild doesn't create a package for a Web Service project?

We're running the following command for building and packaging Visual Studio Solutions:
MSBuild.exe *slnfile* /p:DeployOnBuild=true /p:CreatePackageOnPublish=true
It appears this creates packages for Web Applications but not Web Services. I don't even see a "Publish" option in Visual Studio for Web Service projects. How do I package these for deployment?
It turns out the developer didn't create a Web Application project, they created a simple empty C# project. I converted the project to Web Application and it works.

WS02 CAR deployment to Carbon and ESB server : No artifacts found to be deployed in this server

I created test.car in WSO2 Developer Studio 3.5.0. CAR contains your default example SimpleStockQuoteSample. I can deploy this CAR into WS02 ESB Server 4.8.1. successfully. CAR is listed in CarbonAplication and works correctly.
When I try to deploy same CAR into SW02 Carbon Server 4.2.0, it fails on
No artifacts found to be deployed in this server. Ignoring Carbon Application : test.car
Can you help me?
This is because the Server Role for the artifacts inside your CAR is "EnterpriseServiceBus" : edit the pom.xml of your Carbon app in Dev Studio and look at Dependencies -> artifact / Server Role
Actually you need to do 2 steps:
Modify the wso2esb carbon.xml file in config folder.
location: {base}wso2esb-4.9.0\repository\conf -- carbon.xml
Add the ApplicationServer as role in the tag ServerRoles.
<Role>ApplicationServer</Role>
Modify in your eclipse develop studio the Role of your application to ApplicationServer, this is into Dependencies->artifact and modify the Role.

can wso2 carbon 4.1 run as a web app (war)?

I'm limited to what applications I can deploy in my environment, however, standard WAR files are usually not a problem.
Can carbon 4.1.0 run as a web app?
This link describes how it can be done for carbon 3.2.2. Are these steps still valid for 4.1.0?
According to the answer in this link some functionality is limited in webapp mode for 3.2.2. What functionality is limited if 4.1.0 is deployed in webapp mode?
EDIT:
A webapp-mode folder is available in $CARBON_HOME
C:\Users\snowc\Desktop\wso2carbon-4.1.0>type webapp-mode\README.txt
Running WSO2 Carbon in Webapp mode
-------------------------------------
Standalone mode is the recommended way of running All WSO2 Carbon products. However you have the
option of running WSO2 Carbon products in Webapp mode (hosted as a web-app in an application
server).
1. The 'WEB-INF' directory contains the webapp archive
2. The 'bundles' directory contains the additional jars that needs, during the web-app mode
deployment.
Please refer the WSO2 Carbon documentation for step-by-step guide on web-app mode deployment of the
product.
"Can carbon 4.1.0 run as a web app?"
No, we stopped supporting webapp deployment in later 4.x.x carbon versions

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.