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.
Thrown often, but not always, when getting schema-aware completion in an XML document. java.lang.NullPointerException at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.populateModelMap(CompletionContextImpl.java:612) [catch] at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.specialCompletion(CompletionContextImpl.java:637) at org.netbeans.modules.xml.schema.completion.util.CompletionContextImpl.initModels(CompletionContextImpl.java:606) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:103) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:573) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1005)
#219811e28c4b will show this in the log, BTW.
Schema completion seems to be broken more often than not.
Nikita, please take a look.
I eliminated all reasons of NPE http://hg.netbeans.org/main/rev/8367f0fc041d According to sources the NPE could appear in case of absence of the schema root tag. It's the only idea for testing.
Integrated into 'main-golden', will be available in build *200905160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/8367f0fc041d User: supernikita@netbeans.org Log: Fix the issue #162771 - NPE from CompletionContextImp.populateModelMap
Nope, something similar still broken: java.lang.NullPointerException at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.populateItemsForAny(CompletionUtil.java:508) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.substituteAny(CompletionUtil.java:499) at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.getElements(CompletionUtil.java:239) at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:110) at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:87) Just try to get completion on some of the Jelly tags in e.g. http://fisheye4.atlassian.com/browse/~raw,r=10807/hudson/trunk/hudson/plugins/active-directory/src/main/resources/hudson/plugins/active_directory/ActiveDirectorySecurityRealm/config.jelly (The catalog installed by hudson.maven should offer schemas for the jelly:* namespaces.) Validation (A-S-F9) works, at least after cdev #28ae937a7bd3 which fixes some bugs in schema handling (unrelated swallowed NPEs). I'm not sure what you mean by "absence of schema root tag"; both the document and the schemas appear well-formed and in fact valid.
I think the last described NPE is similar only because it is also NPE. So it would be better to create a new issue. But I don't see serious reasons of appearing an NPE in the referenced line - CompletionUtil.java:508 AXIModel am = AXIModelFactory.getDefault().getModel(cm.getSchemaModel); The only real possibility to have NPE here is cm == null. But if it is null, then according to sources, an NPE has to appear before. Anyway, I need some additional details. If it's easy to reproduce, then could you provide me with steps you managed to get the NPE.
Maybe not only steps, but a project or full XML file with all required schema as well?
Integrated into 'main-golden', will be available in build *200905201401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/28ae937a7bd3 User: Jesse Glick <jglick@netbeans.org> Log: UserXMLCatalog was often throwing NPEs when validating schema-based documents, and SharedXMLSupport was swallowing them. Observed while trying to reproduce #162771: schema-based code completion throws (other) NPEs.
.
Restoring original resolution for fix of initially reported NPE.