WSO2 DeveloperStudio CAR Maven部署异常

时间:2015-05-11 20:54:55

标签: maven wso2 wso2esb wso2developerstudio

使用wso2 developer studio指南并按照以下页面中的说明进行操作: https://docs.wso2.com/display/DVS370/Deploying+a+CAR+File+with+the+Maven+Plug-In#DeployingaCARFilewiththeMavenPlug-In-DeployCARfiletotheWSO2ESBserver

我无法在我的runing wso2 esb 4.8.1实例中部署CAR存档,因为我在maven build期间遇到了这个异常:

[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ provaplugin ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.524s
[INFO] Finished at: Mon May 11 18:17:18 CEST 2015
[INFO] Final Memory: 22M/338M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project provaplugin: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
MojoExecutionException - Apache Maven - Apache Software Foundation
cwiki.apache.org

和wso2控制台中的这个例外:

ERROR - ApplicationManager Error occurred while deploying Carbon Application
org.wso2.carbon.CarbonException: Error while extracting Carbon Application : provaplugin_1.0.0.car
    at org.wso2.carbon.application.deployer.AppDeployerUtils.extractCarbonApp(AppDeployerUtils.java:440)
    at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:198)
    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.FileNotFoundException: /media/ubuntu/CodeHome/TEST%20GREG/wso2esb-4.8.1/repository/deployment/server/carbonapps/provaplugin_1.0.0.car (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:214)
    at java.util.zip.ZipFile.<init>(ZipFile.java:144)
    at java.util.zip.ZipFile.<init>(ZipFile.java:115)
    at org.wso2.carbon.application.deployer.AppDeployerUtils.extract(AppDeployerUtils.java:653)
    at org.wso2.carbon.application.deployer.AppDeployerUtils.extractCarbonApp(AppDeployerUtils.java:438)
    ... 20 more
[2015-05-11 18:17:22,729] ERROR - CappAxis2Deployer Error while deploying carbon application /media/ubuntu/CodeHome/TEST GREG/wso2esb-4.8.1/repository/deployment/server/carbonapps/provaplugin_1.0.0.car
java.lang.NullPointerException
    at org.wso2.carbon.application.deployer.internal.ApplicationManager.revertDeployedArtifacts(ApplicationManager.java:301)
    at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:275)
    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)

但这对我来说很奇怪,因为存档provaplugin_1.0.0.car存在于/ repository / deployment / server / carbonapps /

这是汽车pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example.provaplugin</groupId>
  <artifactId>provaplugin</artifactId>
  <version>1.0.0</version>
  <packaging>carbon/application</packaging>
  <name>provaplugin</name>
  <description>provaplugin</description>
  <properties>
    <com.example.provaDeploy.proxy-service_._adminEndpoint>capp/EnterpriseServiceBus</com.example.provaDeploy.proxy-service_._adminEndpoint>
    <artifact.types>jaggery/app=zip,service/rule=aar,lib/library/bundle=jar,synapse/message-processors=xml,synapse/endpointTemplate=xml,synapse/proxy-service=xml,synapse/message-store=xml,carbon/application=car,registry/resource=zip,lib/dataservice/validator=jar,synapse/endpoint=xml,web/application=war,synapse/sequence=xml,synapse/configuration=xml,lib/registry/handlers=jar,synapse/task=xml,service/meta=xml,webapp/jaxws=war,synapse/api=xml,cep/bucket=xml,bpel/workflow=zip,lib/registry/filter=jar,service/dataservice=dbs,synapse/local-entry=xml,synapse/priority-executor=xml,synapse/event-source=xml,synapse/template=xml,lib/carbon/ui=jar,service/axis2=aar,synapse/sequenceTemplate=xml,wso2/gadget=dar,lib/synapse/mediator=jar</artifact.types>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.example.provaDeploy.proxy-service</groupId>
      <artifactId>adminEndpoint</artifactId>
      <version>1.0.0</version>
      <type>xml</type>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
      <id>wso2-nexus</id>
      <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    </repository>
    <repository>
      <id>wso2-maven2-repository-1</id>
      <url>http://dist.wso2.org/maven2</url>
    </repository>
    <repository>
      <id>wso2-nexus-repository-1</id>
      <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
        <checksumPolicy>ignore</checksumPolicy>
      </releases>
      <id>wso2-nexus</id>
      <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    </pluginRepository>
    <pluginRepository>
      <id>wso2-maven2-repository-1</id>
      <url>http://dist.wso2.org/maven2</url>
    </pluginRepository>
    <pluginRepository>
      <id>wso2-nexus-repository-1</id>
      <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <buildcommands />
          <projectnatures>
            <projectnature>org.wso2.developerstudio.eclipse.distribution.project.nature</projectnature>
          </projectnatures>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.wso2.maven</groupId>
        <artifactId>maven-car-plugin</artifactId>
        <version>2.0.9</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>car</id>
            <phase>package</phase>
            <goals>
              <goal>car</goal>
            </goals>
          </execution>
        </executions>
        <configuration />
      </plugin>
      <plugin>
        <groupId>org.wso2.maven</groupId>
        <artifactId>maven-car-deploy-plugin</artifactId>
        <version>1.0.9</version>
        <extensions>true</extensions>
        <configuration>
          <carbonServers>
            <CarbonServer>
              <trustStorePath>/media/ubuntu/CodeHome/TEST GREG/wso2esb-4.8.1/repository/resources/security/wso2carbon.jks</trustStorePath>
              <trustStorePassword>wso2carbon</trustStorePassword>
              <trustStoreType>JKS</trustStoreType>
              <serverUrl>https://localhost:9445</serverUrl>
              <userName>admin</userName>
              <password>admin</password>
              <operation>deploy</operation>
            </CarbonServer>
          </carbonServers>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
http://maven.apache.org/POM/4.0.0
maven.apache.org

当我尝试在开发人员工作室WSO2Carbon服务器上直接从eclipse ide部署汽车时,我得到了相同的异常。

怎么了?

2 个答案:

答案 0 :(得分:1)

当capp路径中存在与this问题有关的空间时,会发生此问题。而且,此问题已在更高版本中修复。

答案 1 :(得分:0)

您应该在分发管理中指定存储库。 Maven Distribution Management

在项目内部添加以下distributionManagement存储库。

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
.........
<distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>Internal repo</name>
      <url>file:///home/thara/testesb/in</url>
    </repository>
  </distributionManagement>
............
</project>

对于上面的例子,我给了我的文件系统(Linux)。