[SWS-347] Error using AxiomSoapMessageFactory with comments in request Created: 02/May/08  Updated: 25/Sep/08  Resolved: 02/May/08

Status: Closed
Project: Spring Web Services
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.5.1

Type: Bug Priority: Major
Reporter: Stephen Duncan Jr Assignee: Arjen Poutsma
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

While attempting to test my webservice using Soap UI, I sent a request that included XML comments, and I got the following error:

org.apache.axiom.om.impl.llom.OMCommentImpl cannot be cast to org.apache.axiom.om.OMText



 Comments   
Comment by Arjen Poutsma [ 02/May/08 ]

Could you supply the full stack trace?

Comment by Stephen Duncan Jr [ 02/May/08 ]

As you might guess, this happens when the comment is inside an expected text node; it did not occur when I placed a comment between two elements. Here is the stack trace:

java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMCommentImpl cannot be cast to org.apache.axiom.om.OMText
at org.apache.axiom.om.impl.llom.OMStAXWrapper.getTextCharacters(OMStAXWrapper.java:403)
at org.springframework.xml.stream.StaxStreamXmlReader.handleComment(StaxStreamXmlReader.java:193)
at org.springframework.xml.stream.StaxStreamXmlReader.parseInternal(StaxStreamXmlReader.java:103)
at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:128)
at org.springframework.xml.stream.AbstractStaxXmlReader.parse(AbstractStaxXmlReader.java:111)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:637)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.logMessageSource(AbstractLoggingInterceptor.java:125)
at org.springframework.ws.server.endpoint.AbstractLoggingInterceptor.handleRequest(AbstractLoggingInterceptor.java:89)
at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:208)
at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:163)
at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

Comment by Arjen Poutsma [ 02/May/08 ]

This is actually a bug in Axiom, not Spring-WS. Calling getTextCharacters() on a comment node is perfectly legal, according to the XMLStreamReader spec (https://java.sun.com/webservices/docs/1.5/api/javax/xml/stream/XMLStreamReader.html).

You can create an Axiom issue here: http://issues.apache.org/jira/browse/WSCOMMONS.

Comment by Arjen Poutsma [ 05/May/08 ]

Closing issues for 1.5.1

Comment by Craig [ 25/Sep/08 ]

https://issues.apache.org/jira/browse/WSCOMMONS-393

Generated at Mon Dec 11 04:04:19 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.