0
votes

Using wso2 developer studio guide and following the istructions at the following page: https://docs.wso2.com/display/DVS370/Deploying+a+CAR+File+with+the+Maven+Plug-In#DeployingaCARFilewiththeMavenPlug-In-DeployCARfiletotheWSO2ESBserver

i'm not able to deploy a CAR archive in my runnging wso2 esb 4.8.1 instance as i got this exception during 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

and this exception in the wso2's console:

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)

But it's weird to me as the archive provaplugin_1.0.0.car is present in /repository/deployment/server/carbonapps/

This is the car pom.xml file

<?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

I get the same exception when i try deploy the car directly from eclipse ide on the developer studio WSO2Carbon server.

What's wrong?

2
Seems to be an issue when there is spaces in your paths. "/media/ubuntu/CodeHome/TEST GREG/wso2esb-4.8.1" Please use a path which does not contains any spaces.Eranda
that was it... thanksAlex

2 Answers

1
votes

This issue occurs when there is a space in the capp path, which is related to this issue. And, this has been fixed in the later version.

0
votes

You should specify the repositories in the Distribution Management. Maven Distribution Management

Inside project add following distributionManagement repository.

<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>

For the above example I gave my file system (Linux).