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.
Build: NetBeans IDE Dev (Build 201004150201) VM: Java HotSpot(TM) 64-Bit Server VM, 14.3-b01-101, Java(TM) SE Runtime Environment, 1.6.0_17-b04-248-10M3025 OS: Mac OS X Stacktrace: java.lang.AssertionError at org.netbeans.modules.xml.xdm.XDMModel.<init>(XDMModel.java:100) at org.netbeans.modules.xml.xdm.xam.XDMAccess.<init>(XDMAccess.java:85) at org.netbeans.modules.xml.xdm.xam.XDMAccessProvider.createModelAccess(XDMAccessProvider.java:69) at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getAccess(AbstractDocumentModel.java:521) at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getAccess(AbstractDocumentModel.java:76) at org.netbeans.modules.xml.xam.AbstractModel.isAutoSyncActive(AbstractModel.java:640)
Created attachment 97488 [details] stacktrace
Created attachment 97875 [details] stacktrace
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=167734
Created attachment 98022 [details] stacktrace finding string in faces-config.xml
Created attachment 98239 [details] stacktrace Edit faces-config.xml to add new: <resource-bundle> <base-name>messages</base-name> <var>msg</var> </resource-bundle>
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=167734
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=167734
Alex, please take a look.
I'm not able to reproduce this bug on: Product Version: NetBeans IDE Dev (Build 201005260001) Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13 System: Windows XP version 5.1 running on x86 My steps: - download and install the plugin "Java Web and EE", including the JSF module - create a sample JSF project "TravelCenter" - open its "faces-config.xml" and add at the beginning of this file several XML tags (see the attached "screenshot_bug184306_modified_faces-config-xml.png"): <application> <resource-bundle> <base-name>messages</base-name> <var>msg</var> </resource-bundle> </application> Result: - no exceptions were thrown. Need more info (all details are very important): - attach a JSF project, which is edited - describe steps, which allow to reproduce this bug I've seen that some exception reports (UI Actions XML/Messages Log) contain exception messages: 1. http://statistics.netbeans.org/exceptions/messageslog?id=394662 Log Session: Wednesday, May 26, 2010 7:03:49 PM CDT Product Version = NetBeans IDE 6.9 Beta (Build 201004200117) <= old build <message>Could not lock document</message> <exception> <message>java.io.IOException: File faces-config.xml is read-only!</message> java.io.FileNotFoundException: JAR entry com/jaspersoft/ireport/com-jaspersoft-ireport-designer-menu-DatasourcesAction_1.shadow not found in C:\Archivos de programa\NetBeans 6.9 Beta\ireport\modules\com-jaspersoft-ireport.jar 2. http://statistics.netbeans.org/exceptions/messageslog?id=382968 WARNING [org.openide.filesystems.JarFileSystem]: cannot open C:\Documents and Settings\mircea.stanciu\.m2\repository\javax\javaee-api\6.0\javaee-api-6.0-sources.jar INFO [org.openide.filesystems.JarFileSystem]: error in opening zip file java.util.zip.ZipException: error in opening zip file Maybe mentioned troubles cause this bug.
Created attachment 99542 [details] screenshot_bug184306_modified_faces-config-xml.png
It's not clear yet, which part of code is responsible for the Exception. The initial reason of exception is absence of an org.netbeans.editor.BaseDocument instance in model's source. The ModelSource object is required for construction of a new XAM-based model or getting an existing model from the internal cache (see AbstractModelFactory class). According to ModelSource.getLookup() method's documentation, the lookup has to contain javax.swing.text.Document. The XDMModel requires a BaseDocument instance instead, which is a descendant of Document. There is a contradiction here. And it can cause the exception if some external code put a Document to the lookup instead of a BaseDocument. I'm going to figure out it and maybe do some corrections. But this contradiction doesn't look like the main or the only reason of the Exception. Another possible reason can be an incorrect code out of XAM/XDM models, which constructs a ModelSource without required BaseDocument. I don't think that the code does it intentionally. Most likely an exception happens while loading a document and the exception is ignored or processed with a wrong way. It's necessary to analyze logs more detailed. Also there is a difficulty, which prevents easily understand real reason. You can see that all stack traces are started from the RequestProcessor. So it's impossible to know which code has requested a XAM model. It would be helpful to have special customizable mode in which the Task class obtains stack trace in its constructor and saves it somewhere inside.
I analyzed different logs (almost all) and it seems I've found a regularity. The bug always relates to JSF Config file. It's initiated when the file is being closed - JSFConfigEditorSupport.notifyClosed() The method seems is called after closing the JSF Config file. The JSF Config model is requested in order to do synch() according to the fix of the issue #116315. It looks like the requested model isn't loaded yet and it tries loading and failed. An IOException happens, but it's caught in the method and lost. I suppose the assertion exception maybe is reasonable in such case. It worth to understand what is the reason of IOException first. And it's necessary to uncomment the line, where the exception is lost: } catch (IOException ex) { // Logger.getLogger("global").log(Level.INFO, null, ex); } It should be more clear to the owners of corresponding JSF module, why the IOException happens, so I reopen the issue and switch it to them.
I forgot to say that always there is another exception before AssertionError. It can be found in any log and it contains line: [catch] at org.netbeans.modules.web.jsf.JSFConfigEditorSupport$7.run(JSFConfigEditorSupport.java:378)
From debugger I've found that IOException happens in org.netbeans.modules.xml.xam.AbstractModel.sync(). It should be more clear to the owners of corresponding module, why the IOException happens.
It looks like the mentioned AssertionError and Exception are not hardly related. They rather have the same reason. The AssertionError happens inside of auto-sync procedure. A modification of the JSF Config file makes it so invalid, that it can't be loaded to text document. Because the model for the file is already loaded, it causes the AssertionError when the document is requested again. I suppose the same changes can be done not only with JSF Config file, so the problem is more general. It's not clear what exactly happens. I know that the JSF Config file is located in a temporary folder and the attempt to load it comes to an IOExceptin with "FileObject is invalid" message. The solution I tried to use is throwing an artificial IOExceprion in the method org.netbeans.modules.xml.retriever.catalog.Utilities._getDocument(). It comes to similar results without reproducing the bug itself.
Created attachment 99699 [details] stacktrace opened faces-config.xml
Fixed in trunk http://hg.netbeans.org/main/rev/984778a6953b Now the XAM model gets NOT_SYNCED status if the underlaying XML document becomes inaccessible.
Integrated into 'main-golden', will be available in build *201006030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/984778a6953b User: supernikita@netbeans.org Log: #184306 - AssertionError at ...xml.xdm.XDMModel.<init>
There isn't reliable way to reproduce the issue. So it's tested with JUnit tests.
The fix is simple and not dangerous so I'm going to move it to relase691
transplanted modification from trunk to release691 http://hg.netbeans.org/release691/rev/586a34baa795
*** Bug 172444 has been marked as a duplicate of this bug. ***