Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-8863

Error deploying EAR with a module having a sub-module in its component descriptor.

XMLWordPrintable

    • Hide

      Projects configuration:

      1. Create an EAR project 'EAR_Project'.
      2. Create 2 Java projects 'project1' and 'project2'.
      3. In the 'EAR_Project' properties, in 'Deployment Assembly' add projects 'project1' and 'project2' (in the EAR library directory lib).
      4. In the 'project2' properties, in 'Deployment Assembly' add project 'project1' and set deploy path to 'lib/project1.jar'.

      Runtime:

      1. Create a JBoss 4.2 runtime.
      2. make sure your deployment is done in exploded mode (uncheck "Deploy projects as compressed archives" on the "Deployment" tab of the server adapter if needed)
      3. Add 'EAR_Project'.
      4. Do publish.
        => Problem Occurred window must appear.
        Error renaming C:\DEV\jboss\server\default\tmp\jbosstoolsTemp\tmp7972940254262193574.jar to C:\DEV\jboss\server\default\deploy\EAR_Project.ear\lib\project2.jar\lib\project1.jar

      Show
      Projects configuration: Create an EAR project 'EAR_Project'. Create 2 Java projects 'project1' and 'project2'. In the 'EAR_Project' properties, in 'Deployment Assembly' add projects 'project1' and 'project2' (in the EAR library directory lib). In the 'project2' properties, in 'Deployment Assembly' add project 'project1' and set deploy path to 'lib/project1.jar'. Runtime: Create a JBoss 4.2 runtime. make sure your deployment is done in exploded mode (uncheck "Deploy projects as compressed archives" on the "Deployment" tab of the server adapter if needed) Add 'EAR_Project'. Do publish. => Problem Occurred window must appear. Error renaming C:\DEV\jboss\server\ default \tmp\jbosstoolsTemp\tmp7972940254262193574.jar to C:\DEV\jboss\server\ default \deploy\EAR_Project.ear\lib\project2.jar\lib\project1.jar

      Context:

      For some reasons I have to deploy an EAR webapp with (in its libs) a jar containing itself another jar.

      Environment:

      For this I have a first Java project with the following component descriptor:

      <?xml version="1.0" encoding="UTF-8"?>
      <project-modules id="moduleCoreId" project-version="1.5.0">
          <wb-module deploy-name="project1">
              <wb-resource deploy-path="/" source-path="/src/main/java"/>
          </wb-module>
      </project-modules>
      

      Then, the second Java project has the component descriptor:

      <?xml version="1.0" encoding="UTF-8"?>
      <project-modules id="moduleCoreId" project-version="1.5.0">
          <wb-module deploy-name="project2">
              <wb-resource deploy-path="/" source-path="/src/main/java"/>
              <dependent-module archiveName="project1.jar" deploy-path="/lib" handle="module:/resource/project1/project1">
                  <dependency-type>uses</dependency-type>
              </dependent-module>
          </wb-module>
      </project-modules>
      

      Then, in Eclipse when exporting the project2 as a Module Archive, I obtain a .jar file featuring both classes from project2 and a lib folder with the project1 compiled jar.

      Now, in the ear project I have the following lines in the component descriptor:

              <dependent-module archiveName=" project1.jar" deploy-path="/lib" handle="module:/resource/ project1/ project1">
                  <dependency-type>uses</dependency-type>
              </dependent-module>
              <dependent-module archiveName=" project2.jar" deploy-path="/lib" handle="module:/resource/ project2/ project2">
                  <dependency-type>uses</dependency-type>
              </dependent-module>
      

      (The EAR needs the 2 jars as well)

      Problem:

      Then, when deployed into my JBoss 4.2 Runtime server in Eclipse, I got the following error:

      Error renaming C:\DEV\jboss\server\default\tmp\jbosstoolsTemp\tmp7021855122707247750.jar to C:\DEV\jboss\server\default\deploy\EAR_Project.ear\lib\project2.jar\lib\project1.jar
      

      After some research, I think an exception is thrown at org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback.moveTempFile(File, File) during the safe rename.
      However, when I look to the error message I got the feeling that the publishing process want to copy the tmp jar file into a folder called "C:\DEV\jboss\server\default\deploy\EAR_Project.ear\lib\project2.jar\lib\" which can not work because "C:\DEV\jboss\server\default\deploy\EAR_Project.ear\lib\project2.jar" is a file.

        1. error-renaming-archive.png
          95 kB
          André Dietisheim

              rob.stryker Rob Stryker (Inactive)
              guinotphil Philippe Guinot (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: