ResourceException problems encountered while deleting resources raised when cleaning a project with a Java facet

Problem(Abstract)
When cleaning a project with the Java facet in IBM® Rational® Application Developer, for example Java project, Dynamic web project or EJB project, a ResourceException error might occur. This happens when the mentioned project is shared with IBM® Rational® ClearCase using the ClearCase Remote Client (CCRC).

This technote describes the problem further and suggests a workaround.
Symptom
The following are symptoms of the problem:

  • The following error message is displayed:


      ResourceException org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources

  • The file .copyarea.db is shown as view private in the output directory and source directory of your project (for example src and bin)
  • The .log file or Error Log view contains this exception:

      !MESSAGE JavaBuilder handling ImageBuilderInternalException while building: IV_AM
      !STACK 1
      org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
      at org.eclipse.core.internal.resources.Resource.delete(Unknown Source)
      at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(Unknown Source)
      at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(Unknown Source)
      at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(Unknown Source)
      at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager$2.run(Unknown Source)
      at org.eclipse.core.internal.runtime.InternalPlatform.run(Unknown Source)
      at org.eclipse.core.runtime.Platform.run(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager$1.run(Unknown Source)
      at org.eclipse.core.internal.runtime.InternalPlatform.run(Unknown Source)
      at org.eclipse.core.runtime.Platform.run(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(Unknown Source)
      at org.eclipse.core.internal.events.BuildManager.build(Unknown Source)
      at org.eclipse.core.internal.resources.Workspace.build(Unknown Source)
      at org.eclipse.ui.actions.GlobalBuildAction$1.run(Unknown Source)
      at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)

      []

Cause
ClearCase Remote Client uses the system file .copyarea.db to track the state of the files in the particular directory of the view.
In rare cases, this file can become visible in Rational Application Developer. During a project build, these system files get copied from the project source folder to the Java output folder.

During a Project > Clean..., Rational Application Developer will try to remove the files from the Java output folder since newly compiled files will be written there later.

When Rational Application Developer tries to remove the .copyarea.db file, it will fail, as ClearCase Remote Client still recognizes it as a special file and prevents its deletion.

Resolving the problem
A workaround for the problem is to disable copying of the .copyarea.db file:
    1. Open Window > Preferences, choose the preference page Java > Compiler. Add the file name .copyarea.dbto the Filtered Resources list .
    2. Delete the output folder (specified in Project Properties of project > Java Build Path >Source>Default Output folder). This folder will get recreated when building the project.
    3. Rebuild your projects by calling Project > Clean

No comments:

Post a Comment