[ http://issues.apache.org/jira/browse/AXIS2-23?page=comments#action_12312713 ]
Eran Chinthaka commented on AXIS2-23: ------------------------------------- Hi, Let me try on this. How can I reproduce this bug. Is the code available some where in the SVN ? - Chinthaka > I've writen two clients to access Google and Amazon Web APIs, After recieving > the Response I get the following Exception. > ------------------------------------------------------------------------------------------------------------------------- > > Key: AXIS2-23 > URL: http://issues.apache.org/jira/browse/AXIS2-23 > Project: Axis2 > Type: Bug > Components: om > Environment: Windows XP sp1, > Reporter: L.P.Gayan Asanka > Assignee: Davanum Srinivas > > Hi All, > I have built a programs to access Google Web API and Amazon Web API via > AXIS2. The operation is ?doGoogleSearch? in Google WSDL and ?search? in > Amazon WSDL, I can set the number of search results that should be included > in the response message. In Google When the number of results is 1 or 2 it is > working almost properly, But when the number of results are getting higher > (that means the SOAP msg is big) I am getting an exception. When the results > count is 10, most probably this exception is thrown. In the case of Amazon, > the exception is always thrown. This programs worked with M1 successfully. > I guess the problem is with OM and Stax, I hope your aid to solve this > problem. > Exception thrown is:- > org.apache.axis.om.OMException: javax.xml.stream.XMLStreamException > at > org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder.next(StAXSOAPModelBuilder.java:295) > at org.apache.axis.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:272) > at > org.apache.axis.om.impl.llom.OMSerializerUtil.serializeNormal(OMSerializerUtil.java:166) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:660) > at > org.apache.axis.om.impl.llom.OMElementImpl.serializeWithCache(OMElementImpl.java:610) > at > org.apache.axis.om.impl.llom.OMTextImpl.serializeWithCache(OMTextImpl.java:91) > at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:96) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:634) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:681) > at > samples.google.search.ClientCallbackHandler.extractDetails(ClientCallbackHandler.java:96) > at > samples.google.search.ClientCallbackHandler.onComplete(ClientCallbackHandler.java:76) > at > org.apache.axis.clientapi.InOutMEPClient$1.run(InOutMEPClient.java:218) > at java.lang.Thread.run(Thread.java:534) > Caused by: javax.xml.stream.XMLStreamException > at com.bea.xml.stream.MXParser.fillBuf(MXParser.java:3346) > at com.bea.xml.stream.MXParser.more(MXParser.java:3361) > at com.bea.xml.stream.MXParser.parseAttribute(MXParser.java:2368) > at com.bea.xml.stream.MXParser.parseStartTag(MXParser.java:2176) > at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1700) > at com.bea.xml.stream.MXParser.next(MXParser.java:1249) > at > org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder.next(StAXSOAPModelBuilder.java:256) > ... 12 more > SOAP message is:- > <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/1999/XMLSchema"> > <SOAP-ENV:Body> > <ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch" > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > <return xmlns="" xsi:type="ns1:GoogleSearchResult"> > <directoryCategories xsi:type="ns2:Array" > ns2:arrayType="ns1:DirectoryCategory[0]"> > </directoryCategories> > <documentFiltering > xsi:type="xsd:boolean">true</documentFiltering> > <endIndex xsi:type="xsd:int">9</endIndex> > <estimateIsExact > xsi:type="xsd:boolean">false</estimateIsExact> > <estimatedTotalResultsCount > xsi:type="xsd:int">11</estimatedTotalResultsCount> > <resultElements xsi:type="ns3:Array" > ns3:arrayType="ns1:ResultElement[9]"> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.radinks.net/ftp/faq.php</URL> > <cachedSize xsi:type="xsd:string">8k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true > </relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > You need to have the <b>Java</b> <b>Runtime</b> > <b>Enviorenment</b> installed. the JRE is > <b>...</b><br> X Window system installed and you will need > the <b>Java</b> <b>Runtime</b> > <b>Enviorenment</b> as <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">What is FTP</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://forums.devshed.com/archive/t-132738/What-are-these</URL> > <cachedSize xsi:type="xsd:string">16k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > 3 - <b>java</b> run time <b>enviorenment</b> 4 - > Software Development Kit <b>...</b> The JRE is<br> the > <b>Java</b> <b>Runtime</b> Environment, and consists > of the JVM, core <b>Java</b> libraries, > <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">What are these?</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://forums.devshed.com/t119864/sc080f62a8ebb741eb05e19e780435bf3.html</URL> > <cachedSize xsi:type="xsd:string">60k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName > xsi:type="xsd:string">forums.devshed.com</hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > if the variables are set as USER or SYSTEM <b>enviorenment</b> > variables <b>...</b> Registry key<br> > &#39;Software\JavaSoft\<b>Java</b> <b>Runtime</b> > Environment\CurrentVersion&#39; has value &#39;1.3&#39;, but > <b>...</b> </snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">TextPad..</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.vovida.org/pipermail/vocal/2002-November/007361.html</URL> > <cachedSize xsi:type="xsd:string">9k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > Next message: [Vocal] <b>Java</b> Provisioning for Vocal 1.4; > Messages sorted by:<br> <b>...</b> the &gt; > <b>java</b> run time <b>enviorenment</b> jre1.3.1_06 > before deploying &gt; vocal). <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">[Vocal] Problems > deploying vocal 1.4.0</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.vovida.org/pipermail/vocal/2002-November/007358.html</URL> > <cachedSize xsi:type="xsd:string">9k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName > xsi:type="xsd:string">www.vovida.org</hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > (though I have installed the &gt; &gt; <b>java</b> run > time <b>enviorenment</b> jre1.3.1_06 before<br> deploying > <b>...</b> And there is no &gt; &gt; > <b>Java</b> <b>Runtime</b> in configurations. > <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">[Vocal] Problems > deploying vocal 1.4.0</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.javadesktop.org/forums/thread.jspa?threadID=8796&tstart=120</URL> > <cachedSize xsi:type="xsd:string">31k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > It works, but I got some <b>runtime</b> errors that I can´t fix. > <b>...</b> installation app<br> to set up all the server > and client <b>enviorenment</b> will be very helpful. > <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">JavaDesktop > Forums</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.desktopian.org/news/onews0200.html</URL> > <cachedSize xsi:type="xsd:string">198k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > Faster and smaller?516k. no <b>runtime</b>? b) New mail engine. > <b>...</b> C Headers,<br> includes, > <b>JAVA</b>, JavaScript, CSS and PHP/PHP3, x86 Assembly, HP48, > CA-Clipper, <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">desktopian.org : Old > News</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://www.database-forum.com/forum14.html</URL> > <cachedSize xsi:type="xsd:string">62k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > No new posts, Static BerkeleyDB with Dynamic <b>Runtime</b> on > Win32? <b>...</b> No new posts,<br> DB-&gt;associate > in multithreaded <b>enviorenment</b> > <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title xsi:type="xsd:string">Berkeley DB</title> > </item> > <item xsi:type="ns1:ResultElement"> > <URL > xsi:type="xsd:string">http://mail-archives.apache.org/mod_mbox/jakarta-tomcat-user/200209.mbox/authors.html</URL> > <cachedSize xsi:type="xsd:string">513k</cachedSize> > <directoryCategory xsi:type="ns1:DirectoryCategory"> > <fullViewableName > xsi:type="xsd:string"></fullViewableName> > <specialEncoding > xsi:type="xsd:string"></specialEncoding> > </directoryCategory> > <directoryTitle > xsi:type="xsd:string"></directoryTitle> > <hostName xsi:type="xsd:string"></hostName> > <relatedInformationPresent > xsi:type="xsd:boolean">true</relatedInformationPresent> > <snippet xsi:type="xsd:string"><b>...</b> > how to prevent JSP getting compiled at <b>runtime</b> Bayi Peng > (Thu, 19 Sep 2002<br> 18:06:02 <b>...</b> referncing > <b>enviorenment</b> variable in server.xml Katz, Adi (Wed, > <b>...</b></snippet> > <summary xsi:type="xsd:string"></summary> > <title > xsi:type="xsd:string">/mod_mbox/jakarta-tomcat-user/200209.mbox/authors.html</title> > </item> > </resultElements> > <searchComments xsi:type="xsd:string"></searchComments> > <searchQuery xsi:type="xsd:string">java runtime > enviorenment</searchQuery> > <searchTime xsi:type="xsd:double">0.02838</searchTime> > <searchTips xsi:type="xsd:string"></searchTips> > <startIndex xsi:type="xsd:int">1</startIndex> > </return> > </ns1:doGoogleSearchResponse> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > this is part of the code in my ClientCallbackHandler that process the SOAP > envelope:- > private void extractDetails(AsyncResult result) { > Iterator iterator,iterator2; > OMNode node; > OMElement body, operation, elem; > SOAPEnvelope resEnvelope; > try { > XMLStreamWriter writer = > XMLOutputFactory.newInstance().createXMLStreamWriter( > System.out); > result.getResponseEnvelope().serialize(writer); > //part.serialize(writer,false); > writer.flush(); > } catch (XMLStreamException e) { > System.out.println("Error occured after responce is received"); > e.printStackTrace(); > } catch (FactoryConfigurationError e) { > System.out.println("Error occured after responce is received"); > e.printStackTrace(); > } > resEnvelope = result.getResponseEnvelope(); > body = resEnvelope.getBody(); > operation = body.getFirstElement(); > String opLocalName = operation.getLocalName(); > if (opLocalName.equals("Fault")) { > System.out.println("A Fault message recieved, Check your Licence > key"); > snippet = > snippet + > "A Fault message recieved, Check your Licence key. Else > you have reached the" + > " daily limit of 1000 requests"; > } else { > OMElement part = operation.getFirstElement(); > iterator = part.getChildren(); > while (iterator.hasNext()) { > node = (OMNode) iterator.next(); > if (node.getType() == OMNode.ELEMENT_NODE) { > elem = (OMElement) node; > String str = elem.getLocalName(); > System.out.println(str); > if (str.equals("resultElements")) { > System.out.println("Got the Result Elements"); > Iterator iterator0 = elem.getChildren(); > while (iterator0.hasNext()) { > node = (OMNode) iterator0.next(); > if (node.getType() == OMNode.ELEMENT_NODE) { > elem = (OMElement) node; > if (elem.getLocalName().equals("item")) { > iterator2 = elem.getChildren(); > while (iterator2.hasNext()) { > node = (OMNode) iterator2.next(); > if (node.getType() == > OMNode.ELEMENT_NODE) { > elem = (OMElement) node; > String str3 = elem.getLocalName(); > System.out.println(str3); > if > (elem.getLocalName().equals("snippet")) { > System.out.println("Got the > snippet"); > tempStr = elem.getText(); > System.out.println(tempStr); > snippet = snippet + tempStr; > } > if > (elem.getLocalName().equals("URL")) { > System.out.println("Got the > URL"); > strURL = elem.getText(); > } > } > } > } > snippet = snippet + "<br> URL:-<a href=" + > strURL + ">" + strURL + > "</a\n\n> <br><br>"; > } > } > } > } > } > } > snippet = snippet + endHTML; > System.out.println(snippet); > //text.setText(snippet); > GUIHandler.showResults(snippet); > } > Gayan -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
