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.
To reproduce 1) Create a BPEL module and open a bpel file in the editor. 2) From the palette drag and drop a 'Receive' above the Empty activity. 3) Click Validate XML. 4) Notice that error messages that are associcated with a <receive> are attached to its parent element ie., they are assoicated with <sequence> I added console messages into XsdBasedvalidator and notice the following In logValidationError(...) Component component = model.findComponent(position); I verified that the position number is correct. But the Component returned is the parent of the Component where the actual position points to. [Also if this helps: If the source is edited directly at any place, then for the same 'position' value model.findComponent(position) returns the correct Component.]
Raised to P1. What I got when follow exact this test case is OutOfBoundIndex exception. Somehow the jdk validation return wrong lineNumber: java.lang.IndexOutOfBoundsException: Index: 77, Size: 17 at java.util.ArrayList.RangeCheck(ArrayList.java:546) at java.util.ArrayList.get(ArrayList.java:321) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.getPosition(XsdBasedValidator.java:204) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.logValidationErrors(XsdBasedValidator.java:238) at org.netbeans.modules.xml.xam.spi.XsdBasedValidator$Handler.error(XsdBasedValidator.java:208) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:175)
Another stack traces when remove 'name' attribute from wsdl:message (source view) and do validate are: java.lang.NullPointerException at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.getAccess(AbstractDocumentComponent.java:414) at org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent.findPosition(AbstractDocumentComponent.java:418) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.getLineNumber(WSDLMultiViewSupport.java:184) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.annotateSourceView(WSDLMultiViewSupport.java:171) at org.netbeans.modules.xml.wsdl.ui.netbeans.module.WSDLMultiViewSupport.showComponent(WSDLMultiViewSupport.java:136) and: java.lang.NullPointerException at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.checkReference(FindReferencedVisitor.java:110) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.visit(FindReferencedVisitor.java:66) at org.netbeans.modules.xml.wsdl.model.impl.MessageImpl.accept(MessageImpl.java:56) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.visitChildren(FindReferencedVisitor.java:124) at org.netbeans.modules.xml.wsdl.model.visitor.FindReferencedVisitor.find(FindReferencedVisitor.java:57) at org.netbeans.modules.xml.wsdl.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:66) at org.netbeans.modules.xml.wsdl.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:36) at org.netbeans.modules.xml.wsdl.validator.visitor.WSDLSemanticsVisitor.visit(WSDLSemanticsVisitor.java:540)
Fixed in release55. /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentComponent.java,v <-- AbstractDocumentComponent.java new revision: 1.1.2.20; previous revision: 1.1.2.19 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentModel.java,v <-- AbstractDocumentModel.java new revision: 1.1.2.11; previous revision: 1.1.2.10 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/spi/Attic/XsdBasedValidator.java,v <-- XsdBasedValidator.java new revision: 1.1.2.11; previous revision: 1.1.2.10 /cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/visitor/FindReferencedVisitor.java,v <-- FindReferencedVisitor.java new revision: 1.2.2.8; previous revision: 1.2.2.7
Fix merged into release55_beta2: /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentComponent.java,v <-- AbstractDocumentComponent.java new revision: 1.1.2.19.2.1; previous revision: 1.1.2.19 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/dom/Attic/AbstractDocumentModel.java,v <-- AbstractDocumentModel.java new revision: 1.1.2.9.2.2; previous revision: 1.1.2.9.2.1 /cvs/xml/xam/src/org/netbeans/modules/xml/xam/spi/Attic/XsdBasedValidator.java,v <-- XsdBasedValidator.java new revision: 1.1.2.4.2.2; previous revision: 1.1.2.4.2.1 /cvs/xml/wsdl/api/src/org/netbeans/modules/xml/wsdl/model/visitor/FindReferencedVisitor.java,v <-- FindReferencedVisitor.java new revision: 1.2.2.7.2.1; previous revision: 1.2.2.7
Nam, Chris and I could still reproducible this bug. Both for bpel and schema. So reopening this.
The issue seems to be in XDM NodeByPositionVisitor. I verify the position calculation by XsdBasedValidator is accurate. Note that schema validator returns end position of the involved element. Make P2 since there is no exceptions involved, no data corruption, visibility is subtle, and work-around available (add-remove space in source view and then validate again will make the reported line correct again).
Same cause as issue 80899, fixed by ajit in release55. Work-around in editor client code by dynamically insert space into the document after create new component (done by Praveen for bpel editor). Verified Ajit fix actually fix this bpel test case. Give Ajit credit and close as duplicate. Note, it would be best to have a unit test that actually fail w/o this fix.
correct Ajit user name.
Work around of programmatically adding whitespece into swingdocument in ValidationOutputWindowController. Needs to be removed after beta.
This issue is fixed in xdm and in branch release55. can be verified with netbeans release55 daily build. Praveen pl remove workaround, once beta2 is released.
Fix verified in NetBeans IDE Dev (Build 200704091800)