This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 175277 - [68cat] Cannot save modified pom file
Summary: [68cat] Cannot save modified pom file
Status: RESOLVED DUPLICATE of bug 175750
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords:
: 175630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-23 11:44 UTC by neilg
Modified: 2009-11-02 10:41 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
var/log/messages.log for a session in which pom saving failed (146.68 KB, text/plain)
2009-10-23 11:46 UTC, neilg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description neilg 2009-10-23 11:44:07 UTC
[ BUILD # : 200910212001 ]
[ JDK VERSION : 1.6.* ]

I've run into a problem with pom file editing in 200910191401 and in beta. To put it simply, save stops working. It
will work for some time then at some point I press ctrl-s to save a modified pom and nothing happens. The name of the
pom file is emboldened in its tab, so the editor is aware that something has changed. Save is greyed out in the file
menu. This doesn't happen all the time, but once it does it doesn't go away without a restart of the IDE (and obviously
I lose my changes).

I have seen this issue several times with 200910191401 and with 6.8 beta (200910212001).
Comment 1 neilg 2009-10-23 11:46:14 UTC
Created attachment 89972 [details]
var/log/messages.log for a session in which pom saving failed
Comment 2 Milos Kleint 2009-10-26 12:15:06 UTC
nothing obvious in the log files, it happened to be once as we though. just started the IDE and manually edited the
pom.xml file. no code generators or anything that touches the xam model.

reassigning to editor for evaluation, FYI the pom files don't have their own loader/cloneableEditor, but are reusing the
generic xml one.
Comment 3 David Strupl 2009-10-26 15:16:37 UTC
Is the following exception "normal"? Also please check where it was catched ...

INFO [org.netbeans.modules.maven.NbMavenProjectImpl]: Error on loading project /tmp/vcs-1256290953051/pom.xml
org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project com.ft:ft-cmsController at
/tmp/vcs-1256290953051/pom.xml
	at org.apache.maven.project.DefaultMavenProjectBuilder.validateModel(DefaultMavenProjectBuilder.java:1094)
	at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1048)
	at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:812)
	at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:504)
	at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
	at org.apache.maven.embedder.MavenEmbedder.readProject(MavenEmbedder.java:381)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies_aroundBody0(MavenEmbedder.java:416)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies_aroundBody1$advice(MavenEmbedder.java:304)
	at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies(MavenEmbedder.java:1)
	at org.netbeans.modules.maven.NbMavenProjectImpl.loadOriginalMavenProject(NbMavenProjectImpl.java:359)
	at org.netbeans.modules.maven.NbMavenProjectImpl.getOriginalMavenProject(NbMavenProjectImpl.java:332)
	at org.netbeans.modules.maven.api.NbMavenProject.getMavenProject(NbMavenProject.java:232)
	at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:105)
	at org.netbeans.modules.maven.MavenProjectPropsImpl.get(MavenProjectPropsImpl.java:85)
	at org.netbeans.modules.maven.api.NbMavenProject.getPackagingType(NbMavenProject.java:290)
	at
org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.checkNbm(MavenApisupportLookupProvider.java:93)
	at
org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider$Provider.<init>(MavenApisupportLookupProvider.java:81)
	at
org.netbeans.modules.maven.apisupport.MavenApisupportLookupProvider.createAdditionalLookup(MavenApisupportLookupProvider.java:68)
	at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.doDelegate(LookupProviderSupport.java:184)
	at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:130)
	at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:118)
	at org.netbeans.spi.project.support.LookupProviderSupport.createCompositeLookup(LookupProviderSupport.java:89)
	at org.netbeans.modules.maven.NbMavenProjectImpl$LazyLookup.beforeLookup(NbMavenProjectImpl.java:844)
	at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:197)
	at
org.netbeans.modules.projectapi.ProjectFileEncodingQueryImplementation.getEncoding(ProjectFileEncodingQueryImplementation.java:68)
	at org.netbeans.api.queries.FileEncodingQuery.getEncoding(FileEncodingQuery.java:91)
	at org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:484)
	at org.netbeans.modules.versioning.diff.DiffSidebar.getText(DiffSidebar.java:967)
	at org.netbeans.modules.versioning.diff.DiffSidebar.getText(DiffSidebar.java:874)
	at org.netbeans.modules.versioning.diff.DiffSidebar.access$1200(DiffSidebar.java:99)
	at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.fetchOriginalContent(DiffSidebar.java:832)
	at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.computeDiff(DiffSidebar.java:803)
[catch] at org.netbeans.modules.versioning.diff.DiffSidebar$RefreshDiffTask.run(DiffSidebar.java:793)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1084)

My question is whether the 
org.openide.text.DataEditorSupport.openDocument
can survive it without further consequences. If you think so please re-assign to openide/text (why on earth have you
used editor/UI?) for further evaluation.

I am marking as incomplete for now as well.
Comment 4 Jan Lahoda 2009-10-26 15:33:59 UTC
For the record: editor module has rarely anything to do with the Save action. It is simply asked to serialize data to a
stream when the action is invoked. One of few things that is somewhat related to saving is Undo/Redo. I was trying to
reproduce and happened to me twice on an older build, but not since then (on neither old or new build). I did not use
Undo/Redo. I did not hear any report of similar problems with Java files (or any kind of files other than pom.xml), so I
would suspect this is related to the XMLDataObject/TextEditorSupport (xml module) or Maven. Probably the investigation
should start there, although the actual problem can of course be somewhere else.
Comment 5 Milos Kleint 2009-10-26 15:54:21 UTC
the exception is reasonably normal, AFAIK it is just logged in
org.netbeans.modules.maven.NbMavenProjectImpl.loadOriginalMavenProject, and if it occurs (or any other exception for
that matter) a fallback dummy maven project is loaded and user is notified in the UI that the project cannot load properly.

btw: the stacktrace is coming from vcs' diff and related to a temporary file, not the file user for supposedly editing..

reassigning to xml/code then for evaluation.
Comment 6 Sergey Lunegov 2009-10-26 16:13:55 UTC
Alex, please take a look. Probably it's also maven plugin issue.
Comment 7 Milos Kleint 2009-10-29 08:22:38 UTC
*** Issue 175630 has been marked as a duplicate of this issue. ***
Comment 8 Milos Kleint 2009-10-30 12:53:33 UTC
it seems to be closely related to issue 175750. The maven.grammar's class
org.netbeans.modules.maven.navigator.POMModelPanel.select() method call reasonably correct code to open the editor tab.
However it opens a new tab, with it's own document (eg. changing one of the editor content and saving it, will not have
it appear in the other one). The other editor gets opened via the Edit action on xml file's popup.

Reassigning to platform/text for evaluation
Comment 9 mslama 2009-10-30 13:31:07 UTC
Is there any way how to reproduce this? Can you get latest daily build and test with it? If it happens more often for
you I could add some logging.
Comment 10 mslama 2009-10-30 14:47:05 UTC
It looks like dupl of #175750. I will wait for fix of #175750 and then ask for verification.
Comment 11 mslama 2009-11-02 10:41:19 UTC

*** This issue has been marked as a duplicate of 175750 ***