Error Deleting vhi_model.jar When Rebuilding Java Event Handlers

  • 7021565
  • 17-Jun-2010
  • 03-Mar-2018

Environment

Verastream Host Integrator version 6.6 or higher

Situation

In Verastream Host Integrator (VHI) Design Tool, when re-building Java event handlers, the build may fail with an error when attempting to delete tmp\vhi_model.jar. This technical note explains how to resolve this issue.

This issue is identified by the following symptoms:

  • You have a model with Java event handler custom scripting code.
  • Your event handler was created in VHI version 6.6, and the model is opened in Design Tool version 6.6 or higher.
  • Every other (alternating) time you click Events > Rebuild, you see a build failure message similar to the following:
clean:
[delete] Deleting directory C:\Program Files (x86)\Attachmate\Verastream\HostIntegrator\models\mymodel\scripts\build
[delete] Deleting: C:\Program Files (x86)\Attachmate\Verastream\HostIntegrator\models\mymodel\scripts\lib\vhi_model.jar
[delete] Deleting: C:\Program Files (x86)\Attachmate\Verastream\HostIntegrator\models\mymodel\scripts\tmp\vhi_model.jar

BUILD FAILED
C:\Program Files (x86)\Attachmate\Verastream\HostIntegrator\models\mymodel\scripts\build.xml:76: Unable to delete file C:\Program Files (x86)\Attachmate\Verastream\HostIntegrator\models\mymodel\scripts\tmp\vhi_model.jar

Total time: 0 seconds

Resolution

To resolve this issue, modify the build.xml file as follows:

  1. In a text editor, open the build.xml file located in your HostIntegrator\models\<model name>\scripts folder.
  2. Locate the existing clean target node:
 <!-- Clean target -->
 <target name="clean" depends="init" description="Deletes generated files and directories">
        <delete dir="${build.dir}"/>
        <delete file="${vhi_model.jar}"/>
        <delete file="tmp/vhi_model.jar"/>      
 </target>

  1. Insert lines as shown below:
 <!-- Clean target -->
 <target name="clean" depends="init" description="Deletes generated files and directories">
        <delete dir="${build.dir}"/>
        <delete file="${vhi_model.jar}"/>
        <available file="tmp/vhi_model.jar" property="tmpjar.present"/>
 </target>
 <target name="deletetmpjar" depends="clean" if="tmpjar.present">
     <delete file="tmp/vhi_model.jar"/>
 </target>

After completing the above steps, the clean during rebuild will only delete the temporary vhi_model.jar file if it exists.

Additional Information

Legacy KB ID

This article was originally published as Attachmate Technical Note 10106.