deploy BPEL Process on WSO2 Server - wso2

I am trying to deploy my BPEL Process on WSO2 server, after generating the .zip file i am trying to upload it on the server using the administration page, but the upload fails and this error appears in the Log file :
File upload failed :BPEL Compilation Failure!
TID[-1234] [BPS] [2015-10-26 05:50:36,550] ERROR
{org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor} - File upload
failed :BPEL Compilation Failure!
org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor.validateBPELPackage(BPELUploadExecutor.java:295)
org.wso2.carbon.bpel.ui.fileupload.BPELUploadExecutor.execute(BPELUploadExecutor.java:103)
org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor.executeGeneric(AbstractFileUploadExecutor.java:104)
org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager$CarbonXmlFileUploadExecHandler.execute(FileUploadExecutorManager.java:392)
org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager$FileUploadExecutionHandlerManager.startExec(FileUploadExecutorManager.java:276)
org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager.execute(FileUploadExecutorManager.java:125)
org.wso2.carbon.ui.transports.FileUploadServlet.doPost(FileUploadServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
org.eclipse.equinox.http.helper.ContextPathServletAdaptor.service(ContextPathServletAdaptor.java:37)
org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:695)
I even tried to manually add the file to repository/deploymen/server/bpel
but the process still doesn't appear in the List of deployed processes.
I have searched around the web and couldn't find an answer.Any help ?
EDIT
This is what i have when i unzip the bpel pack :

Please check the structure of your .zip file. Did you edit an existing bpel pack and re zip it again? If that is the case make sure, that when you unzip it the files are directly listed like below (instead of having another folder within the zip file) . For example if A.zip,
A-|
a.bpel
a.wsdl...

Please check your BPEL process again. Specially deploy.xml file. Check the ports are assign correctly.

Related

When trying to send email using Gmail connector FileNotFoundException is occurred

I'm using WSO2-Integration-Studio-7.0.2-linux-gtk-x86_64.
I tried the steps in https://ei.docs.wso2.com/en/latest/micro-integrator/use-cases/tutorials/using-the-gmail-connector/
When I execute the POST request in the tutorial from Micro Integrator, I got below execption.
[2020-07-11 00:38:22,317] ERROR {org.wso2.micro.integrator.registry.MicroIntegratorRegistry} - Metadata file cannot be found at /data/wso2-products/WSO2-Integration-Studio-7.0.2-linux-gtk-x86_64/IntegrationStudio/runtime/microesb/registry/governance/connectors/Gmail/.metadata/accessToken.meta java.io.FileNotFoundException: /data/wso2-products/WSO2-Integration-Studio-7.0.2-linux-gtk-x86_64/IntegrationStudio/runtime/microesb/registry/governance/connectors/Gmail/.metadata/accessToken.meta (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileReader.<init>(FileReader.java:72)
at org.wso2.micro.integrator.registry.MicroIntegratorRegistry.getMetadata(MicroIntegratorRegistry.java:1027)
at org.wso2.micro.integrator.registry.MicroIntegratorRegistry.readNonXML(MicroIntegratorRegistry.java:877)
at org.wso2.micro.integrator.registry.MicroIntegratorRegistry.lookup(MicroIntegratorRegistry.java:206)
at org.apache.synapse.registry.AbstractRegistry.getResource(AbstractRegistry.java:66)
at org.apache.synapse.mediators.GetPropertyFunction.evaluate(GetPropertyFunction.java:326)
at org.apache.synapse.mediators.GetPropertyFunction.call(GetPropertyFunction.java:115)
at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:181)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:675)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:215)
at org.jaxen.BaseXPath.evaluate(BaseXPath.java:175)
at org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:405)
at org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:371)
at org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:110)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:133)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:148)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:84)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:260)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:805)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:303)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:578)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:195)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:284)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
When I checked the directory of "/data/wso2-products/WSO2-Integration-Studio-7.0.2-linux-gtk-x86_64/IntegrationStudio/runtime/microesb/registry/governance/connectors/Gmail/", there is no .metadata folder. Is there any step missed in the document?
It worked with Micro Integrator 1.2.0.
Best way is Download Integration Studio 7.1.0 which has inbuilt 1.2.0.
Open your existing workspace with new Studio. Dont forget to copy your existing configurations from deployment.toml file.

wso2 API Manager with Analytics

I installed wso2 API Manager with Analytics onto my windows laptop.
I get the below exception when I run the bat file
TID: [-1234] [] [2016-11-08 20:31:02,357] INFO {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer} - Deploying spark script: APIM_LAST_ACCESS_TIME_SCRIPT.xml for tenant : -1234 {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer}
TID: [-1234] [] [2016-11-08 20:31:02,473] INFO {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager} - Task scheduled: [-1234][ANALYTICS_SPARK][APIM_LAST_ACCESS_TIME_SCRIPT] {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager}
TID: [-1234] [] [2016-11-08 20:31:02,478] ERROR {org.wso2.carbon.application.deployer.internal.ApplicationManager} - Error while deploying stored cApp : org.wso2.carbon.application.deployer.internal.ApplicationManager$PendingApplication#74bf5355 {org.wso2.carbon.application.deployer.internal.ApplicationManager}
java.lang.RuntimeException: Invalid input path generated, the input cannot contain backtracking path elements
at org.wso2.carbon.analytics.datasource.core.util.GenericUtils.checkAndReturnPath(GenericUtils.java:787)
at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataPurgingDeployer.registerPurgingTasks(AnalyticsDataPurgingDeployer.java:147)
at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataPurgingDeployer.deployArtifacts(AnalyticsDataPurgingDeployer.java:79)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:263)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.tryDeployPendingCarbonApps(ApplicationManager.java:131)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.registerDeploymentHandler(ApplicationManager.java:122)
at org.wso2.carbon.application.deployer.internal.AppDeployerServiceComponent.setAppHandler(AppDeployerServiceComponent.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:444)
at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
Second time, I tried wso2server.bat -Dsetup and I am still getting the same issue.
Is this is a known issue? How to fix this.
This is a known issue in APIM-Analytics server in windows. The same issue is fixed in DAS 3.1.0, but not in APIM-Analytics 2.0.0.
But you have 3 options to get rid of this.
1) Use DAS 3.1.0 instead of APIM-Analytics server, and configure it for APIM analytics. Then you can install car file in it.
2) Disable purging by commenting out <!-- purging --> section of ./artifacts.xml inside car file. Please note that disable purging will accumulate data over time.
3) Use the online version of API Manager - WSO2 API Cloud - that does not have that issue.

WSO2 DSS - Cassandra / DynamoDb - Retrieving Item

we are implementing a solution in which we use our WSO2 DSS.
We don't want get rid of it, as many actors in our organization use its exposed interfaces.
Underneath we are planning to migrate to Cassandra or DynamoDB, all deployed on AWS.
We are facing a blocking issue, as we are able to connect.
We are forced to use the Amazon SDK in which we have to use a joda-time library version newer than v.2
When we try to retreive an item we have the next exception.
java.lang.NoSuchMethodError: org.joda.time.format.DateTimeFormatter.withZoneUTC()Lorg/joda/time/format/DateTimeFormatter
So We guess it's because WSO2 uses a different version of this library.
WSO2 v.3.2.1
joda-time v.2.8.1
Thanks.
I have the same problem, but I've done some tests and I think it doesn't really a joda-time library problem.
I have compiled a assembled jar with all dependencies and get it works, at least once.
On pom.xml file configuration:
<build>
<plugins>
...
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
And compile the jar with:
mvn assembly:assembly
I copied the jar on $WSO_INSTALATION_DIR/repository/components/lib and start the wso2 server and it works!
But now I'm having problems to make changes on my datasource's code and redeploy it.
If I copy again the .jar on lib, there aren't my last changes on datasource's code and if I delete the jar from lib/ and dropin/ folders I get the following error:
java.lang.ClassCastException: org.wso2.dss.connectors.dynamodb.DynamoDBDataSource cannot be cast to org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS
at org.wso2.carbon.dataservices.core.description.config.InlineCustomQueryBasedDSConfig.<init>(InlineCustomQueryBasedDSConfig.java:66)
at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.getCustomQueryConfig(ConfigFactory.java:143)
at org.wso2.carbon.dataservices.core.description.config.ConfigFactory.createConfig(ConfigFactory.java:73)
at org.wso2.carbon.dataservices.core.DataServiceFactory.createDataService(DataServiceFactory.java:137)
at org.wso2.carbon.dataservices.core.DBDeployer.createDBService(DBDeployer.java:764)
at org.wso2.carbon.dataservices.core.DBDeployer.processService(DBDeployer.java:1127)
at org.wso2.carbon.dataservices.core.DBDeployer.deploy(DBDeployer.java:178)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135)
at org.wso2.carbon.core.CarbonAxisConfigurator.loadServices(CarbonAxisConfigurator.java:464)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:65)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:398)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.wso2.dss.connectors.dynamodb.DynamoDBDataSource cannot be cast to org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS
at org.wso2.carbon.dataservices.core.description.config.InlineCustomQueryBasedDSConfig.<init>(InlineCustomQueryBasedDSConfig.java:48)
... 54 more
I hope that this tip can you help to solve this problem and I will continue trying it to find a complete solution.
EDITED: I discovered that it works fine if you copy the both jars on lib directory, the assembled jar and the no dependencies jar.

Two services cannot have same name. A service with the wso2carbon-sts [null] name already exists in the system

I am trying to install API Manager 1.6.0 on wso2esb 4.8.1. I have installed the selected features on this and while trying to restart,i am getting the following exception...
`[2014-03-25 09:16:52,021] ERROR {org.wso2.carbon.utils.deployment.Axis2ServiceRegistry} - Error building service from bundle : Symbolic Name: org.wso2.carbon.sts,Bundle Version: 4.2.0, ID: 545
org.apache.axis2.AxisFault: Two services cannot have same name. A service with the wso2carbon-sts [null] name already exists in the system.
at org.apache.axis2.engine.AxisConfiguration.addToAllServicesMap(AxisConfiguration.java:510)
at org.apache.axis2.description.AxisServiceGroup.addService(AxisServiceGroup.java:110)
at org.apache.axis2.deployment.DeploymentEngine.fillServiceGroup(DeploymentEngine.java:745)
at org.apache.axis2.deployment.DeploymentEngine.addServiceGroup(DeploymentEngine.java:601)
at org.wso2.carbon.utils.deployment.Axis2ServiceRegistry.addServices(Axis2ServiceRegistry.java:218)
at org.wso2.carbon.utils.deployment.Axis2ServiceRegistry.register(Axis2ServiceRegistry.java:102)
at org.wso2.carbon.utils.deployment.Axis2ServiceRegistry.register(Axis2ServiceRegistry.java:89)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:473)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)`
Can anyone please help me on this..
I want to use both API manager and wso2 esb features simultaneosuly..So what is the best practice to do this? Is it possible to install the both in wso2 carbon??
I have tried a lot,not getting correct response from anywhere,,,please help me on this..
It's recommended to run WSO2ESB and API Manager separately.
Yes, it is possible to install both in WSO2 Carbon.
The ESB mediation engine is already part of API Manager. For example, you should be able to deploy a proxy service in API manager without any issue by copying the relevant proxy service artifact into file system.
Can you please explain what type of ESB features are required to use with AM? Do you want to use the proxy service/sequence editor UI?
Thanks!

WSO2 MDM configuration : certificate problems

As soon as I import the first key with keytool into the wso2carbon.jks file (and I restart the service) my service already fails to launch properly and logs the following error:
TID: [0] [EMM] [2014-03-06 23:46:42,106] ERROR
{org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiverDS} - Can not
create and start Agent Server
{org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiverDS}
org.wso2.carbon.databridge.core.exception.DataBridgeException: Cannot start agent server
on port 7711
at
org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiver.startSecureEventTransmission(ThriftDataReceiver.java:129)
at org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiver.start(ThriftDataReceiver.java:101)
at org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiverDS.activate(ThriftDataReceiverDS.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:517)
at org.wso2.carbon.core.init.CarbonServerManager.start(CarbonServerManager.java:219)
at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate(CarbonCoreServiceComponent.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.http.servlet.internal.Activator.registerHttpService(Activator.java:81)
at org.eclipse.equinox.http.servlet.internal.Activator.addProxyServlet(Activator.java:60)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.init(ProxyServlet.java:40)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.init(DelegationServlet.java:38)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.wso2.carbon.databridge.commons.exception.TransportException: Thrift transport exception occurred
at org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiver.startSecureEventTransmission(ThriftDataReceiver.java:150)
at org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiver.startSecureEventTransmission(ThriftDataReceiver.java:127)
... 63 more
Caused by: org.apache.thrift.transport.TTransportException: Error creating the transport
at org.apache.thrift.transport.TSSLTransportFactory.createSSLContext(TSSLTransportFactory.java:201)
at org.apache.thrift.transport.TSSLTransportFactory.getServerSocket(TSSLTransportFactory.java:102)
at org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiver.startSecureEventTransmission(ThriftDataReceiver.java:146)
... 64 more
Caused by: java.security.UnrecoverableKeyException: Cannot recover key
at sun.security.provider.KeyProtector.recover(KeyProtector.java:328)
at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:138)
at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:55)
at java.security.KeyStore.getKey(KeyStore.java:792)
at sun.security.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:131)
at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:68)
at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:259)
at org.apache.thrift.transport.TSSLTransportFactory.createSSLContext(TSSLTransportFactory.java:187)
... 66 more
I've tried to do all sorts of things with the certificates for weeks now but I failed to succeed to setup a completely running service.
Can anyone please help me through the certificate handling step by step, because following the manual apparently has no success for some reason.
Remark : I don't have an iOS certificate and I generated all my certificates with openSSL by following the wso2 manual.
I executed this command to generate this specific (KEYSTORE)p12 file for import in wso2carbon.jks.
Do I first need to manually delete all jks files in that folder, or should I import into the existing files for one?
What else might I be doing wrong?
Thanks for the support.
Based on your older questions I assume you are trying to configure the Android management part. Most of the certificate related stuff in the document is associated with iOS. If you want to try out the Android configuration you can skip most of the parts in that. Simply skip the CA/RA generations.
When configuring Android, only place you need a keystore is to configure the Android agent app. You can find the step by step configuration at Android client configurations. In this link it has pointed to the iOS CA generation since this step is already followed if you configure both iOS and Android. Otherwise you just have to execute these commands.
openssl genrsa -out <CA PRIVATE KEY> 4096
For example: openssl genrsa -out ca_private.key 4096
openssl req -new -key <CA PRIVATE KEY> -out <CA CSR>
For example: openssl req -new -key ca_private.key -out ca.csr
openssl x509 -req -days <DAYS> -in <CA CSR> -signkey <CA PRIVATE KEY> -out <CA CRT> -extensions v3_ca
For example: openssl x509 -req -days 365 -in ca.csr -signkey ca_private.key -out ca.crt -extensions v3_ca
openssl rsa -in <CA PRIVATE KEY> -text > <CA PRIVATE PEM>
For example: openssl rsa -in ca_private.key -text > ca_private.pem
openssl x509 -in <CA CRT> -out <CA CERT PEM>
For example: openssl x509 -in ca.crt -out ca_cert.pem
End of the following commands you should have a ca_cert.pem with you.
Now you need to export this ca file into pkcs12. Command is as follows.
openssl pkcs12 -export -out ca.p12 -inkey ca_private.pem -in ca_cert.pem -name "cacert"
Now you get the ca.p12 file.
Just exectue following command to create a keystore file.
keytool -importkeystore -srckeystore ca.p12 -srcstoretype PKCS12 -destkeystore wso2mobilemdm.jks
As mentioned in my other thread wso2-mdm-android-agent-issue you can either rename this to bks file format or you can use portecle to convert this to bks since Android expect you to make the keystore file in bouncycastle format. Then embed this bks as mentioned in the doc and recompile the Android agent code.
In order to start its better you clear everything and get a fresh WSO2 EMM zip file. Extract it and start from the scratch. From you log what I feel is your existing wso2carbon.jks is corrupted. When generating do not import your generated CA to it and use a new keystore file as I mentioned in the last step.
Hope this helps.
Try this,
First try connecting to the server with HTTP protocol. Simply change the SERVER_PORT to 9763 and SERVER_PROTOCOL to http:// in the CommonUtilities.java file in MDM Agent.
If it's successful, then check your BKS generation options, specially the host name. It is the only place where it can go wrong. Try above and let us know the result.
I struggled with this as well, but finally figured it out. I debugged the app, and found the BKS gets checked when you select the IP on the mobile device, and if it fails, it doesn't error out. This however mean the authentication is still not working, and you get the error when you input the next few screens before it even attempt to connect.To fix this, I did the following :-
Prepare a separate folder. DO NOT CREATE THE CERTS YET!
Copy the following files from your \repository\resources\security folder :-
client-truststore.jks
wso2carbon.jks
Since the jks files are in the temp folder now, also ensure to back them up
Run the above from Dilshan in order (use the examples, they work fine)
When prompted to Country etc, for your "Common name", make those your server IP address on your test environment. This is very important.
For the "Challenge password" after asking for "Common name" etc, leave it blank. Only on this one though!
All other password prompts, enter wso2carbon for simplicity sake
By following the above, the 3 JKS (A new one called wso2mobilemdm.jks is also present now) files will now be updated with the new certs. Copy them, and the *.p12 files back to \repository\resources\security
This takes care of the Server part. Just edit the mdm-config.xml under \repository\conf, and unlike the document, remember I made all the password uniform above to make it easier, so ensure they are set as wso2carbon. Ignore the iOS parts, juts the "Keystore section" needs to be completed.
Also, edit the sso-idp-config.xml, and change the ip addesses as needed.
Now, to the BKS. This part is just vaguely mentioned in the documents. Get bcprov-jdk15on-146.jar downloaded. Copy this to your current temp folder for simplicity sake. I tried the bcprov-jdk15on-150.jar but it didn't work for some reason.
Run this now within this folder (My Keytool path is messed up since I have multiple versions of Java running):-
"%JAVA_HOME%\bin\keytool" -importcert -trustcacerts -keystore emm_truststore.bks -storetype bks -storepass wso2carbon -file ca_cert.pem -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath ./bcprov-jdk15on-146.jar
This will now create the BKS file in the temp folder, with the other Certs. Copy this emm_truststore.bks now back to your agent folder under res/raw, overwriting it.
In the MDM project, also check for "public static String SENDER_ID =" in the config file when you change the IP address etc prior to exporting.
Clean the project, and rebuild it. Now you are ready to export. What I did was to copy the wso2mobilemdm.jks to the root of my android project, since it is already in the correct format to use. But you can export, and create a new key for this. Note, this is nothing to do with the BKS you created, this is to sign the apk to run on the device.
If you run this now it should work. You will see activity when you try to authenticate to the server.