Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 41918 invoked by uid 500); 20 Nov 2001 14:07:09 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 41854 invoked from network); 20 Nov 2001 14:07:09 -0000 Message-ID: <20011120140707.82033.qmail@web12801.mail.yahoo.com> Date: Tue, 20 Nov 2001 06:07:07 -0800 (PST) From: Davanum Srinivas Reply-To: dims@yahoo.com Subject: Re: Status update: Axis w/Xerces2 To: axis-dev@xml.apache.org Cc: xerces-j-dev@xml.apache.org In-Reply-To: <1006206304.21957.21.camel@dev> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-860758277-1006265227=:80682" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --0-860758277-1006265227=:80682 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ted, Neil, Here's a sample test case....It's a modified version of sax.Counter. See enclosed patch to sax.Counter to reproduce the problem with any xml file + xerces2's jar (i used build.xml from xerces2 to test). If you run the same with Xerces1's jar, you will not see the NullPointerException. This is due to the URI that is stored...In Xerces2 getURI() returns null, in Xerces1 getURI() returns an empty string. If you need more information, shoot me a mail. Thanks, dims --- "Theodore W. Leung" wrote: > Do you have the data valies for p1, p2 and p3 in the startElement method > below? Some of the original problems that I fixed in the X2 DOM were > related to namespaces. It would be good to know which element in the > input document was causing the problem, and to know whether a prefixed > attribute was involved. > > Ted > > On Mon, 2001-11-19 at 12:12, Sam Ruby wrote: > > Doing performance measurements w/Xerces1, we are finding that approximately > > 40% of the time is being spent in the parser. Clearly this represents a > > fertile opportunity for improvment. Measuring the same workloads with > > Crimson resulted in a slight degradation. > > > > I would like to measure Xerces2 and explore both XNI and constructing a > > minimal pipeline which eliminates any unnecessary overhead (e.g., DTD > > validation), but I am still unable to progress past the following problems > > exposed by the unit tests. Debugging, it looks like the Axis code which > > causes the problem down stream is as follows: > > > > public int startElement(String p1, String p2, String p3, org.xml.sax.Attributes p4) { > > if (numattrs == attrs.length) { > > Object[] nattrs = new Object[numattrs * 2]; > > System.arraycopy(attrs, 0, nattrs, 0, numattrs); > > attrs = nattrs; > > } > > > > attrs[numattrs++] = new AttributesImpl(p4); > > return events.add(STATE_START_ELEMENT, st.addSymbol(p1), st.addSymbol(p2), > st.addSymbol(p3), numattrs-1); > > } > > > > Later attempts to reference the copied attributes results in: > > > > java.lang.NullPointerException > > at org.xml.sax.helpers.AttributesImpl.getValue(Unknown Source) > > at > org.apache.axis.encoding.DeserializationContext.getTypeFromAttributes(DeserializationContext.java:301) > > at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:160) > > at > org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:606) > > at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200) > > at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:387) > > at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:115) > > at org.apache.axis.message.RPCElement.getParam(RPCElement.java:124) > > at test.encoding.TestSer.doTestData(TestSer.java:87) > > at test.encoding.TestSer.testDataWithHrefs(TestSer.java:44) > > at java.lang.reflect.Method.invoke(Native Method) > > at junit.framework.TestCase.runTest(TestCase.java:157) > > at junit.framework.TestCase.runBare(TestCase.java:131) > > at junit.framework.TestResult$1.protect(TestResult.java:106) > > at junit.framework.TestResult.runProtected(TestResult.java:124) > > at junit.framework.TestResult.run(TestResult.java:109) > > at junit.framework.TestCase.run(TestCase.java:122) > > at junit.framework.TestSuite.runTest(TestSuite.java:173) > > at junit.framework.TestSuite.run(TestSuite.java:168) > > at junit.framework.TestSuite.runTest(TestSuite.java:173) > > at junit.framework.TestSuite.run(TestSuite.java:168) > > at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:241) > > at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:419) > > > > I'll keep debugging, but I thought I would post this here to see if it generates any thoughts > or suggestions... > > > > - Sam Ruby > > ===== Davanum Srinivas - http://jguru.com/dims/ __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 --0-860758277-1006265227=:80682 Content-Type: text/plain; name="counter.diff" Content-Description: counter.diff Content-Disposition: inline; filename="counter.diff" Index: java/samples/sax/Counter.java =================================================================== RCS file: /home/cvs/xml-xerces/java/samples/sax/Counter.java,v retrieving revision 1.4 diff -d -u -b -B -w -u -r1.4 Counter.java --- java/samples/sax/Counter.java 2001/11/13 20:34:14 1.4 +++ java/samples/sax/Counter.java 2001/11/20 13:46:46 @@ -254,9 +254,11 @@ fTagCharacters++; // open angle bracket fTagCharacters += raw.length(); if (attrs != null) { + attrs = new org.xml.sax.helpers.AttributesImpl(attrs); int attrCount = attrs.getLength(); fAttributes += attrCount; for (int i = 0; i < attrCount; i++) { + System.out.println("URI:" + attrs.getURI(i)); fTagCharacters++; // space fTagCharacters += attrs.getQName(i).length(); fTagCharacters++; // '=' @@ -266,6 +268,7 @@ } } fTagCharacters++; // close angle bracket + System.out.println("Testing:" + attrs.getValue("test","type")); } // startElement(String,String,StringAttributes) --0-860758277-1006265227=:80682--