Can you also post a sample request that triggers this issue? In particular is it a SOAP or plain XML request?
Andreas On Tue, Jan 20, 2009 at 12:40, asheikh <[email protected]> wrote: > Andreas, > > Below is the code that calls check method > > if ("retreiveBillservice".equals(methodName)) { > > RAIResponse rAIResponse = null; > RAIRequest wrappedParam = (RAIRequest) fromOM(msgContext > .getEnvelope().getBody().getFirstElement(), > RAIRequest.class, > getEnvelopeNamespaces(msgContext > .getEnvelope())); > > try { > if(doCheckMM) > mmc.check(msgContext); > > > > On Tue, Jan 20, 2009 at 2:36 PM, asheikh <[email protected]> wrote: >> >> Thansk andreas, yes this is the code that causes the exception >> >> public void check(MessageContext ctx) throws MiddlewareException { >> Iterator iter = ctx.getEnvelope().getBody().getChildElements(); >> OMElement content = null; >> while (iter.hasNext()) { >> OMNode node = (OMNode) iter.next(); >> if (node.getType() == OMNode.ELEMENT_NODE) { >> content = (OMElement) node; >> break; >> } >> } >> .. >> ... >> >> >> On Tue, Jan 20, 2009 at 2:34 PM, Andreas Veithen >> <[email protected]> wrote: >>> >>> Can you post the code in MMCHandler#check? >>> >>> Andreas >>> >>> On Tue, Jan 20, 2009 at 12:11, asheikh <[email protected]> wrote: >>> > Thanks a lot Andreas, >>> > >>> > Please see the stactrace below: >>> > >>> > Start- Stactrace: >>> > >>> > org.apache.axiom.om.OMException: Parser has already reached end of the >>> > document. No siblings found >>> > at >>> > >>> > org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling()Lorg/apache/axiom/om/OMNode;(OMElementImpl.java:339) >>> > at >>> > >>> > org.apache.axiom.om.impl.traverse.OMChildElementIterator.next()Ljava/lang/Object;(OMChildElementIterator.java:104) >>> > at >>> > >>> > com.xxx.yyy.mmc.MMCHandler.check(Lorg/apache/axis2/context/MessageContext;)V(MMCHandler.java:51) >>> > at >>> > >>> > com.xxx.yyy.retrieve.RetrieveServiceMessageReceiverInOut.invokeBusinessLogic(Lorg/apache/axis2/context/MessageContext;Lorg/apache/axis2/context/MessageContext;)V(RetrieveServiceMessageReceiverInOut.java:172) >>> > at >>> > >>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(Lorg/apache/axis2/context/MessageContext;)V(AbstractInOutSyncMessageReceiver.java:42) >>> > at >>> > >>> > org.apache.axis2.receivers.AbstractMessageReceiver.receive(Lorg/apache/axis2/context/MessageContext;)V(AbstractMessageReceiver.java:100) >>> > at >>> > >>> > org.apache.axis2.engine.AxisEngine.receive(Lorg/apache/axis2/context/MessageContext;)Lorg/apache/axis2/engine/Handler$InvocationResponse;(AxisEngine.java:176) >>> > at >>> > >>> > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(Lorg/apache/axis2/context/MessageContext;Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/apache/axis2/engine/Handler$InvocationResponse;(HTTPTransportUtils.java:275) >>> > at >>> > >>> > org.apache.axis2.transport.http.AxisServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(AxisServlet.java:133) >>> > at >>> > >>> > javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:760) >>> > at >>> > >>> > javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(ServletStubImpl.java:465) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348) >>> > at >>> > >>> > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6981) >>> > at >>> > >>> > weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(AuthenticatedSubject.java:321)2009-01-20 >>> > 14:03:23,126 ERROR org.apache.axis2.engine.AxisEngine - >>> > java.util.NoSuchElementException >>> > org.apache.axis2.AxisFault: java.util.NoSuchElementException >>> > at >>> > >>> > org.apache.axis2.AxisFault.makeFault(Ljava/lang/Throwable;)Lorg/apache/axis2/AxisFault;(AxisFault.java:430) >>> > at >>> > >>> > com.xxx.yyy.retrieve.RetrieveServiceMessageReceiverInOut.invokeBusinessLogic(Lorg/apache/axis2/context/MessageContext;Lorg/apache/axis2/context/MessageContext;)V(RetrieveServiceMessageReceiverInOut.java:739) >>> > at >>> > >>> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(Lorg/apache/axis2/context/MessageContext;)V(AbstractInOutSyncMessageReceiver.java:42) >>> > at >>> > >>> > org.apache.axis2.receivers.AbstractMessageReceiver.receive(Lorg/apache/axis2/context/MessageContext;)V(AbstractMessageReceiver.java:100) >>> > at >>> > >>> > org.apache.axis2.engine.AxisEngine.receive(Lorg/apache/axis2/context/MessageContext;)Lorg/apache/axis2/engine/Handler$InvocationResponse;(AxisEngine.java:176) >>> > at >>> > >>> > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(Lorg/apache/axis2/context/MessageContext;Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/apache/axis2/engine/Handler$InvocationResponse;(HTTPTransportUtils.java:275) >>> > at >>> > >>> > org.apache.axis2.transport.http.AxisServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(AxisServlet.java:133) >>> > at >>> > >>> > javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:760) >>> > at >>> > >>> > javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(ServletStubImpl.java:465) >>> > at >>> > >>> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(ServletStubImpl.java:348) >>> > at >>> > >>> > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6981) >>> > at >>> > >>> > weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(AuthenticatedSubject.java:321) >>> > at >>> > >>> > weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(SecurityManager.java:121) >>> > at >>> > >>> > weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(WebAppServletContext.java:3892) >>> > at >>> > >>> > weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2766) >>> > at >>> > >>> > weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:224) >>> > at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183) >>> > at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown >>> > Source) >>> > Caused by: org.apache.axiom.om.OMException: >>> > java.util.NoSuchElementException >>> > at >>> > >>> > org.apache.axiom.om.impl.builder.StAXOMBuilder.next()I(StAXOMBuilder.java:260) >>> > at >>> > >>> > org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling()Lorg/apache/axiom/om/OMNode;(OMElementImpl.java:337) >>> > at >>> > >>> > org.apache.axiom.om.impl.traverse.OMChildElementIterator.next()Ljava/lang/Object;(OMChildElementIterator.java:104) >>> > at >>> > >>> > com.xxx.yyy.log.LogHandler.invoke(Lorg/apache/axis2/context/MessageContext;)Lorg/apache/axis2/engine/Handler$InvocationResponse;(LogHandler.java:50) >>> > at >>> > >>> > com.xxx.yyy.retrieve.RetrieveServiceMessageReceiverInOut.invokeBusinessLogic(Lorg/apache/axis2/context/MessageContext;Lorg/apache/axis2/context/MessageContext;)V(RetrieveServiceMessageReceiverInOut.java:732) >>> > ... 18 more >>> > Caused by: java.util.NoSuchElementException >>> > at >>> > com.ctc.wstx.sr.BasicStreamReader.next()I(BasicStreamReader.java:1083) >>> > at >>> > >>> > javax.xml.stream.util.StreamReaderDelegate.next()I(StreamReaderDelegate.java:59) >>> > at >>> > >>> > org.apache.axiom.om.impl.builder.SafeXMLStreamReader.next()I(SafeXMLStreamReader.java:183) >>> > at >>> > >>> > org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext()I(StAXOMBuilder.java:597) >>> > at >>> > >>> > org.apache.axiom.om.impl.builder.StAXOMBuilder.next()I(StAXOMBuilder.java:172) >>> > ... 22 more >>> > >>> > End- Stactrace: >>> > >>> > On Tue, Jan 20, 2009 at 1:52 PM, Andreas Veithen >>> > <[email protected]> >>> > wrote: >>> >> >>> >> Axiom uses a deferred parsing approach, i.e. it will build the object >>> >> tree on demand. A call to toString() triggered by the >>> >> System.out.println instruction or by inspecting the object in a >>> >> debugger will have the effect of building the entire tree. Probably >>> >> there is some code somewhere that works perfectly well with a fully >>> >> built tree, but not if it is only partially built. This could be a bug >>> >> in Axiom. Do you have a stacktrace of the exception? >>> >> >>> >> Andreas >>> >> >>> >> On Tue, Jan 20, 2009 at 11:26, asheikh <[email protected]> >>> >> wrote: >>> >> > Andreas, >>> >> > >>> >> > Thanks for your input, but it is still the same... Just wondering >>> >> > why >>> >> > when i >>> >> > debug it is working and when I am not it does''t work >>> >> > >>> >> > Adding following line on top of the method also helps >>> >> > System.out.println("Messages: "+msgContext.getEnvelope()); >>> >> > >>> >> > but this doesn't help >>> >> > msgContext.getEnvelope(); >>> >> > >>> >> > >>> >> > Thanks >>> >> > >>> >> > On Tue, Jan 20, 2009 at 12:16 PM, Andreas Veithen >>> >> > <[email protected]> wrote: >>> >> >> >>> >> >> Could be somehow related to WSCOMMONS-372. Can you test this with >>> >> >> Axiom >>> >> >> 1.2.8? >>> >> >> >>> >> >> Andreas >>> >> >> >>> >> >> On Tue, Jan 20, 2009 at 08:56, asheikh <[email protected]> >>> >> >> wrote: >>> >> >> > Hi, >>> >> >> > >>> >> >> > I have also realized that when I debug the >>> >> >> > Message Context in eclipse and inspect in, it works and the >>> >> >> > envelope >>> >> >> > message >>> >> >> > is there... >>> >> >> > >>> >> >> > Can please anyone give me some idea, is it a bug in 1.4.1 or >>> >> >> > there is >>> >> >> > something I am missing. The same code works in axis2. 1.3.1 >>> >> >> > >>> >> >> > Thanks in advance >>> >> >> > >>> >> >> > On Tue, Jan 20, 2009 at 8:47 AM, asheikh >>> >> >> > <[email protected]> >>> >> >> > wrote: >>> >> >> >> >>> >> >> >> Hi, >>> >> >> >> >>> >> >> >> I have migrated my services from axis2. 1.3 to axis2 1.4, and I >>> >> >> >> am >>> >> >> >> getting >>> >> >> >> the following error whenever I invoke any service. Please >>> >> >> >> advice, >>> >> >> >> Thanks in >>> >> >> >> advance >>> >> >> >> >>> >> >> >> This code does't work: >>> >> >> >> public void invokeBusinessLogic( >>> >> >> >> org.apache.axis2.context.MessageContext msgContext, >>> >> >> >> org.apache.axis2.context.MessageContext >>> >> >> >> newMsgContext) >>> >> >> >> throws org.apache.axis2.AxisFault { >>> >> >> >> >>> >> >> >> try { >>> >> >> >> >>> >> >> >> // get the implementation class >>> >> >> >> Object obj = getTheImplementationObject(msgContext); >>> >> >> >> //System.out.println("Message xml : >>> >> >> >> "+msgContext.getEnvelope()); >>> >> >> >> >>> >> >> >> >>> >> >> >> ..... more code >>> >> >> >> } >>> >> >> >> >>> >> >> >> >>> >> >> >> This code Works(removing comments from the System.out.): >>> >> >> >> public void invokeBusinessLogic( >>> >> >> >> org.apache.axis2.context.MessageContext msgContext, >>> >> >> >> org.apache.axis2.context.MessageContext >>> >> >> >> newMsgContext) >>> >> >> >> throws org.apache.axis2.AxisFault { >>> >> >> >> >>> >> >> >> try { >>> >> >> >> >>> >> >> >> // get the implementation class >>> >> >> >> Object obj = getTheImplementationObject(msgContext); >>> >> >> >> System.out.println("Message xml : >>> >> >> >> "+msgContext.getEnvelope()); >>> >> >> >> >>> >> >> >> ..... more code >>> >> >> >> } >>> >> >> >> >>> >> >> >> Exception: >>> >> >> >> - <soapenv:Envelope >>> >> >> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> >>> >> >> >> - <soapenv:Body> >>> >> >> >> - <soapenv:Fault> >>> >> >> >> <faultcode>soapenv:Server</faultcode> >>> >> >> >> <faultstring>Parser has already reached end of the document. >>> >> >> >> No >>> >> >> >> siblings >>> >> >> >> found</faultstring> >>> >> >> >> <detail /> >>> >> >> >> </soapenv:Fault> >>> >> >> >> </soapenv:Body> >>> >> >> >> </soapenv:Envelope> >>> >> >> > >>> >> >> > >>> >> > >>> >> > >>> > >>> > >> > >
