我正在使用WSO2 Developer Studio 3.5。 我在synapse-config项目中开发了一系列配置工件。
然后我开发了自己的自定义类中介。
最终我创建了一个复合应用程序项目。在它的pom中,我选择了配置项目和类中介。
使用mvn clean install命令创建了CAR存档。
我进入了管理控制台,我通过碳应用部分添加了汽车文件。看看我的wso2 esb 4.8.1日志,我看到了一些例外情况:
[2015-05-23 23:52:58,900] ERROR - CappAxis2Deployer Error while deploying carbon application C:\CodeHome\WSO2ES~1.1\bin\..\repository\deployment\server\carbonapps\Diogene-WSO2CAR_1.0.0.car
org.apache.synapse.deployers.SynapseArtifactDeploymentException: Error while backing up the artifact: DynamicEndpointConfigurationTask-1.0.0.xml
at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.handleSynapseArtifactDeploymentError(AbstractSynapseArtifactDeployer.java:473)
at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.backupFile(AbstractSynapseArtifactDeployer.java:517)
at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:197)
at org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifacts(SynapseAppDeployer.java:100)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:251)
at org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:114)
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.RepositoryListener.startListener(RepositoryListener.java:371)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:79)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:124)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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:722)
Caused by: java.io.IOException: Failed to delete original file 'C:\CodeHome\WSO2ES~1.1\bin\..\repository\carbonapps\work\1432417976326Diogene-WSO2CAR_1.0.0.car\DynamicEndpointConfigurationTask_1.0.0\DynamicEndpointConfigurationTask-1.0.0.xml' after copy to 'C:\CodeHome\wso2esb-4.8.1\repository\carbonapps\work\1432417976326Diogene-WSO2CAR_1.0.0.car\DynamicEndpointConfigurationTask_1.0.0\DynamicEndpointConfigurationTask-1.0.0.xml.back'
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2109)
at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.backupFile(AbstractSynapseArtifactDeployer.java:515)
... 22 more
实际上似乎没有加载类调解器。我尝试了不同的时间,但我总是得到相同的结果。
当我尝试添加类中介时,通过单击代理设计视图上的加载类按钮来确认此结果:“路径中找不到类”。
手动复制到components / lib文件夹是将自定义类中介添加到我的wso2 esb的唯一方法吗?
答案 0 :(得分:0)
中介类应打包在jar文件中,并放在<installdir>/repository/components/lib
的服务器上。
此外,您的错误表示汽车文件的部署错误。您是先从管理控制台取消部署还是重新部署?或者从Developer Studio部署?
答案 1 :(得分:0)
创建一个中介项目,在里面写下你自己的自定义类。从ur mediator项目的pom.xml创建存档并将其放入其中 /存储库/组件/ lib中
接下来在您的CAR项目中,通过添加ur mediator项目的依赖关系来更改POM,然后最终创建汽车文件。