facebook

Problem deleting and overwritting XML files [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #208933 Reply

    I am having a problem where I cannot delete an xml file after I have opened it up in the MyEclipse XML Editor.

    The file is an xdoclet generated XML file, after opening it in the editor then closing the editor window, if I then try to remove it I get an error msgbox :-

    An exception has been caught while processing the refactoring ‘Delete’

    The only way I can remove or overwrite the file is exit MyEclipse and go back in.

    – System Setup ——————————-
    Operating System and version: Windows XP SP1A
    Eclipse version: 3.0RC1
    Eclipse build id: 200405290105
    Fresh Eclipse install (y/n): Y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: vss
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 2.8 BETA1
    Eclipse JDK version: 1.4.2_03
    Application Server JDK version: JBOSS 3.2.4
    Are there any exceptions in the Eclipse log file? NOT SURE WHERE THE LOG FILES RESIDES?

    – Message Body ——————————-

    #208936 Reply

    Riyad Kalla
    Member

    For MyEclipse version do you mean 3.8Beta1 or 2.8 Beta1? (I hope 3.8 🙂

    Also the log file is at <workspace dir>\.metadata\.log, can you check it for exceptions and paste the contents here?

    #208937 Reply

    Sorry, yes I meant 3.8 B1. Log file contains :-

    !SESSION Jun 22, 2004 23:09:00.346 ———————————————
    eclipse.buildId=I200405290105
    java.version=1.4.2_03
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
    !ENTRY org.eclipse.ltk.ui.refactoring 4 10000 Jun 22, 2004 23:09:00.346
    !MESSAGE Internal Error
    !STACK 1
    org.eclipse.core.runtime.CoreException: Problems encountered while deleting resources.
    at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:79)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:185)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:58)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
    !SUBENTRY 1 org.eclipse.core.resources 4 4 Jun 22, 2004 23:09:00.346
    !MESSAGE Problems encountered while deleting resources.
    !SUBENTRY 2 org.eclipse.core.resources 4 273 Jun 22, 2004 23:09:00.346
    !MESSAGE Could not delete: D:\JavaProjects\SymNet\SymNetSar\build\sar\hibernate\jboss-service.xml.
    !ENTRY org.eclipse.core.resources 4 4 Jun 22, 2004 23:09:00.356
    !MESSAGE Problems encountered while deleting resources.
    !SUBENTRY 1 org.eclipse.core.resources 4 273 Jun 22, 2004 23:09:00.356
    !MESSAGE Could not delete: D:\JavaProjects\SymNet\SymNetSar\build\sar\hibernate\jboss-service.xml.

    #208939 Reply

    support-michael
    Keymaster

    Q: Is there an external process that may accessing this file that you know of? For example are you opening the XML file external to Eclipse/ME or running a servers that directly access the file?

    #208953 Reply

    The file is generated by a build.xml ant script ran from within MyEclipse, I then opened it using the MyEclipse XML editor. After that I cannot remove it.

    The ant script build a jar file which contains this file, but nothing external to MyEclipse should be locking the generated xml file directly.

    I will run some more tests with other xml files, manually created and created through xdoclet and let you know the results.

    Richard[/i]

    #208954 Reply

    support-michael
    Keymaster

    Note: The ME XML editor does nothing special at the file system level with the files it is editing. So the starting point is to identify the source of a potential resource lock. Candidate sources are:

    1) the OS has a lock on jboss-service.xml
    We experience OS locking problems with certain resources when deployed in exploded format. I notice you are on Windows plaform. If you have the file open in notepad then Windows will lock it. Sometimes the OS will retain a lock on a file for 30 secs – 5 mins.

    2) Eclipse workbench has a lock on jboss-service.xml
    Verify that no background processes are running when you open and/or save this file. In some cases Eclipse may be locking the workspace during an operation that may be backgrounded.

    3) Lack of permission
    The jboss-service.xml is created with permission attributes set that prevent Eclipse from being able to delete it.

    #209121 Reply

    Chris
    Member

    We have similar problems here with the XML editor, resulting in files which cannot be deleted without restarting ME. This applies also to files which are only accessed by ME and not by any external process.

    A sure-fire way to provoke this problem is to edit an XML file which is under CVS control, save it and then perform ‘Replace with -> Latest from HEAD’ with the file still open in the XML editor. This results in an error message about being unable to delete the file and afterwards it cannot be deleted manually. The problem does not occur, however, when using the text editor.

    It seems that the XML editor doesn’t like external modifications of the file content, because also files for example generated by xdoclet are prone to the ‘cannot delete’ problem here.

    Hope this helps
    Chris

    – System Setup ——————————-
    Operating System and version: Windows XP SP1A german
    Eclipse version: 3.0RC1
    Eclipse build id: unknown
    Fresh Eclipse install (y/n): yes
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: EMF, GEF, jfacedbc, ganymede
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 3.8 beta1
    Eclipse JDK version: 1.4.1_03
    Application Server JDK version:
    Are there any exceptions in the Eclipse log file? Yes:

    !ENTRY org.eclipse.ui 4 4 Jun 28, 2004 11:08:27.754
    !MESSAGE Category Other not found for view ganymede.views.GanymedeView. This view added to ‘Other’ category.
    !ENTRY org.eclipse.team.cvs.core 4 4 Jun 28, 2004 11:10:42.659
    !MESSAGE Problem deleting resource: /eam/conf/build-common.xml. Problems encountered while deleting resources.
    !STACK 1
    org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources.
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:682)
    at org.eclipse.core.internal.resources.Resource.delete(Resource.java:706)
    at org.eclipse.team.internal.ccvs.core.resources.EclipseFile.delete(EclipseFile.java:64)
    at org.eclipse.team.internal.ccvs.core.util.PrepareForReplaceVisitor.visitFile(PrepareForReplaceVisitor.java:60)
    at org.eclipse.team.internal.ccvs.core.resources.EclipseFile.accept(EclipseFile.java:147)
    at org.eclipse.team.internal.ccvs.core.util.PrepareForReplaceVisitor$1.run(PrepareForReplaceVisitor.java:104)
    at org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer.run(EclipseSynchronizer.java:1405)
    at org.eclipse.team.internal.ccvs.core.resources.EclipseResource$2.run(EclipseResource.java:268)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673)
    at org.eclipse.team.internal.ccvs.core.resources.EclipseResource.run(EclipseResource.java:265)
    at org.eclipse.team.internal.ccvs.core.util.PrepareForReplaceVisitor.visitResources(PrepareForReplaceVisitor.java:96)
    at org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation.executeCommand(ReplaceOperation.java:72)
    at org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation.execute(SingleCommandOperation.java:44)
    at org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation.execute(RepositoryProviderOperation.java:55)
    at org.eclipse.team.internal.ccvs.ui.operations.CVSOperation.run(CVSOperation.java:84)
    at org.eclipse.team.internal.ui.actions.JobRunnableContext.run(JobRunnableContext.java:159)
    at org.eclipse.team.internal.ui.actions.JobRunnableContext$3.runInWorkspace(JobRunnableContext.java:179)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
    !SUBENTRY 1 org.eclipse.core.resources 4 4 Jun 28, 2004 11:10:42.659
    !MESSAGE Problems encountered while deleting resources.
    !SUBENTRY 2 org.eclipse.core.resources 4 273 Jun 28, 2004 11:10:42.659
    !MESSAGE Could not delete: H:\workspace\eam\conf\build-common.xml.

    #209126 Reply

    Riyad Kalla
    Member

    Chris,
    Thank you for the detailed report, however I can say first hand that I do this exact test case multiple times a day on my Windows XP Pro installation and don’t run into any problems… I wonder what the difference is that is causing the problem. I have had this problem trying to delete JAR files before, but because of autocomplete/buildpath resolution/etc. I never thought much of it… I wonder if these are similar symptoms to the same problem?

    #209134 Reply

    Chris
    Member

    Hi,

    I might add that we keep our workspaces on network drives mounted via Samba, in order to have our appservers work directly on the compiled classes.

    I’ve just done some more experiments including files checked-out onto my harddrive and could not provoke the error during some minutes of heavy replacing and external editing, while with a network-located workspace the problem occurs ‘reliably’. 🙁

    Maybe Richard also uses a network drive?

    While network configuration issues might be involved, I’d like to emphasize that only the XML editor suffers from this problems.

    Greetings
    Chris

    #209135 Reply

    Riyad Kalla
    Member

    Hmmmm very strange. The devs are meeting about this problem this morning, so I’ll send this along. Thanks for the details!

    #209241 Reply

    Derek Adams
    Member

    I am getting the same problem. If generate the web.xml via XDoclet and open it in the ME editor, it gets locked and I have to restart to be able to delete it. If I generate the file and do not open it in the editor, I can delete and regenerate as many times as I want. The resource itself doesn’t seem to be locked though, since I can generate the web.xml with another tool and overwrite it. Even after being overwritten, the file can not be deleted.

    Thanks,
    Derek

    #209244 Reply

    Derek Adams
    Member

    I found something weird. I looked at the list of builders for the project and the “XDoclet Builder” has been added nine times. Only one of the entries is checked, but I have also noticed the following message when I try to clean the project:

    Errors during build.
    Errors running builder “Integrated External Tool Builder” on project test.
    Ant build C:\eclipse\runtime-workspace\test\xdoclet-build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE.

    Could this contribute to the locking behavior that we are seeing?

    Thanks,
    Derek

    #209246 Reply

    Derek Adams
    Member

    Every time you go to “MyEclipse-XDoclet” under project properties and make a change, the external builder is added another time. The format of the builder appears to be in an old format because the next time I open the project properties and click on “Builders”, there is a message that reads:

    This project stores its builders in a format that is no longer supported.

    Hope that helps,
    Derek

    #209252 Reply

    Scott Anderson
    Participant

    Derek,

    That helps pinpoint the problem nicely. We’ll look into it shortly. Thanks for helping run it down.

    #209829 Reply

    Riyad Kalla
    Member

    Fixed in 3.8Beta2.

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: Problem deleting and overwritting XML files [Closed]

You must be logged in to post in the forum log in