Bug 232190 - Can not Rebuild/clean projects
Summary: Can not Rebuild/clean projects
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0.2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-14 17:20 EDT by Henry Cui CLA
Modified: 2008-05-20 00:23 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Cui CLA 2008-05-14 17:20:59 EDT
Build ID: This is a subtle bug on several particular machines

Steps To Reproduce:
Customer is using WSAD 5.1.2/RAD 6 to develop java applications. The problem happens in both products.  For a simple "Hello World" java application, he can compile and run the application at the first time. If he changes the file and save it, an incremental build is invoked and it still works fine. However, if he does a "Rebuild project" in WSAD 5.1.2 or "Clean" project in RAD 6, he gets an error "Problem encountered while deleting resources".  

This is caused by the fact that the compiled .class file can not be deleted any more. Even if he closes WSAD/RAD, he still could not delete the file using Windows explorer as it seems to be locked. Customer used some process analysis tool to see which process locks the class file, but could not see any process locks it. The class file can only be deleted if he restarts the machine.  With the restart of the machine, he is  able to delete the files from windows. But once he brings up RAD/WSAD, and rebuilds the project,  it successfully rebuilds  for only once, which means that RAD/WSAD was able to successfully delete the class file and recreate it. Then the problem starts happening with subsequent Rebuild Project/clean.

When he rebuilds the project and looks at the owner of the class file from the command prompt, it is showing as ... (three dots). When he  looks at the properties of the class file, it shows only the General tab and it doesn't show the Security tab.

His Windows domain ID has the admin privilege.

We also tried Eclipse 3.0.2. If the Eclipse 3.0.2 runs on Sun JDK 1.5, he does not have problem to rebuild/clean the project using Sun JDK 1.5.  If the Eclipse 3.0.2 runs on Sun JDK 1.5 and the project is compiled using IBM JDK 1.3.1, the project rebuild/clean fails. If he uses WSAD 5.1.2 which runs on Eclipse 2.x and IBM JDK 1.3.1, he could not rebuild/clean project using either IBM JDK or Sun JDK. 


More information:
Comment 1 Philipe Mulet CLA 2008-05-14 17:37:51 EDT
Build failures correspond to following stack traces:

!SESSION May 05, 2008 13:04:33.278 ---------------------------------------------
java.fullversion=J2RE 1.3.1 IBM Windows 32 build cn131-20031021 (JIT enabled: jitc)
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -data C:\MyWorkspace -install file:C:/Program Files/IBM/WebSphere Studio/Application Developer/v5.1/eclipse/
!ENTRY org.eclipse.jdt.core 4 4 May 05, 2008 13:04:33.278
!MESSAGE JavaBuilder handling CoreException
!STACK 1
org.eclipse.core.internal.resources.ResourceException(C:/MyWorkspace/MyProj/MyClass.class)[272]: java.io.FileNotFoundException: C:\MyWorkspace\MyProj\MyClass.class (Access is denied)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:190)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
	at org.eclipse.core.internal.localstore.FileSystemStore.createStream(FileSystemStore.java:99)
	at org.eclipse.core.internal.localstore.FileSystemStore.write(FileSystemStore.java:367)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:656)
	at org.eclipse.core.internal.resources.File.internalSetContents(File.java:238)
	at org.eclipse.core.internal.resources.File.create(File.java:155)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.writeClassFileBytes(AbstractImageBuilder.java:458)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.writeClassFile(AbstractImageBuilder.java:441)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:116)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:350)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:199)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:149)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:51)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:194)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:117)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:427)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Inlined Compiled Code))
	at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:125)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:181)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:191)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:151)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Inlined Compiled Code))
	at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:165)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:265)
	at org.eclipse.core.internal.resources.Project.build(Project.java:85)
	at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:156)
	at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:122)
	at org.eclipse.ui.actions.WorkspaceAction$1.execute(WorkspaceAction.java:279)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:71)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:85)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
!ENTRY org.eclipse.core.resources 4 272 May 05, 2008 13:04:33.278
!MESSAGE Could not write file: C:\MyWorkspace\MyProj\MyClass.class.
!STACK 0
java.io.FileNotFoundException: C:\MyWorkspace\MyProj\MyClass.class (Access is denied)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:190)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
	at org.eclipse.core.internal.localstore.FileSystemStore.createStream(FileSystemStore.java:99)
	at org.eclipse.core.internal.localstore.FileSystemStore.write(FileSystemStore.java:367)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:656)
	at org.eclipse.core.internal.resources.File.internalSetContents(File.java:238)
	at org.eclipse.core.internal.resources.File.create(File.java:155)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.writeClassFileBytes(AbstractImageBuilder.java:458)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.writeClassFile(AbstractImageBuilder.java:441)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:116)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:350)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:199)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:149)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:51)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:194)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:117)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:427)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Inlined Compiled Code))
	at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:125)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:181)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:191)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:151)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Inlined Compiled Code))
	at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:165)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:265)
	at org.eclipse.core.internal.resources.Project.build(Project.java:85)
	at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:156)
	at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:122)
	at org.eclipse.ui.actions.WorkspaceAction$1.execute(WorkspaceAction.java:279)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:71)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:85)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Comment 2 Philipe Mulet CLA 2008-05-14 17:41:06 EDT
Henry - what do you mean by "the project is compiled using IBM JDK 
1.3.1, the project rebuild/clean fails.". Do you mean if the project is compiled AGAINST 1.3.1 libs from IBM JDK and in 1.3 compliant mode ?
Comment 3 Philipe Mulet CLA 2008-05-14 17:43:05 EDT
John - would this ring any bell to you ? Could it be a problem in resource layer ? 
Comment 4 Philipe Mulet CLA 2008-05-14 17:47:48 EDT
Henry - 
1. Would the original class files be read only intentionally ? (like with some pessimistic source control)
2. If some OS file handles are leaked, could you find out who is holding onto them ? (process explorer is usually good at telling you)
3. Could it be antivirus realtime check preventing access to the files ? (turn off the antivirus and try again)
Comment 5 Philipe Mulet CLA 2008-05-14 18:01:45 EDT
More data from Henry.

Problem does not occur on all machines. Reproduced currently on different machines, but not all of them.

User has no source control, and disabled the antivirus in vain.

By compiling using IBM JDK, he meant that user was using an IBM JDK on its buildpath (i.e. building against IBM Java libs).
Comment 6 Eric Jodet CLA 2008-05-15 13:26:30 EDT
investigating if Starteam source control could have an impact on this issue:
- problem occurs on several (but not all) workstation
- customer said it happened after he used starteam as the version control.

Also found from Borland site that no IBM JRE was listed in the supported Java support section of Starteam product.
This might explain why the problem does not occur when compiling with a Sun JRE.

It is not clear at this stage, from provided stack trace, whether the issue is about deleting a class file or writing it.

When not able to delete, the stack trace looks like:
Problems encountered while deleting resources.                          
at                                                                      
org.eclipse.core.internal.resources.Resource.delete(Resource.java:683)  

Provided stack trace looks like:
java.io.FileNotFoundException:Samplecls.class (Access is denied)        
at java.io.FileOutputStream.open(Native Method)                         
at java.io.FileOutputStream.<init>(Unknown Source)                      
at java.io.FileOutputStream.<init>(Unknown Source)                      
FileSystemStore.createStream(FileSystemStore.java:103)                  
FileSystemStore.write(FileSystemStore.java:382)                         
FileSystemResourceManager.write(FileSystemResourceManager.java)         
File.internalSetContents(File.java:295)                                 
File.create(File.java:154)                                              
AbstractImageBuilder.writeClassFileBytes(AbstractImageBuilder.java)     
AbstractImageBuilder.writeClassFile(AbstractImageBuilder.java)  

Still under investigation.
Comment 7 Eric Jodet CLA 2008-05-19 07:41:07 EDT
(In reply to comment #6)
According to latest investigation, the clean/re build issue may be related
to the presence of WebSense Enterprise Client Policy Manager (CPM) on the workstation on which the problem occurred.
Uninstalling WebSense solves this issue.
Waiting for Henry to confirm and possibly close this bug.
Comment 8 Henry Cui CLA 2008-05-19 15:46:33 EDT
This issue is related to Websense. Customer received a patch for websense and the problem was resolved. Thanks!
Comment 9 Eric Jodet CLA 2008-05-20 00:23:20 EDT
(In reply to comment #8)
closing as per last comment.