Announcement Announcement Module
Collapse
No announcement yet.
Endpoint Mapping and Saxon problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Endpoint Mapping and Saxon problem

    I've been trying to convert one of our web service to Spring-WS, following what is describe in the book: Spring in action 2e. I've used the class PayloadRootQNameEndpointMapping for Endpoint Mapping. Our server is set up to use Saxon, and it seems to be having problem with the XML Source that this Mapping class send it. The problem is that PayloadRootQNameEndpointMapping calls Saxon transform with a Source of type SaajXMLReader, which seems to support SAX and not SAX2, while Saxon is expecting a SAX 2 compliant source. At least this is my understading of the problem.
    Here is the stack trace I get. If anyone can help me with this problem, I would really appreciate it.
    Llaurick

    Trace:
    2007-09-27 23:36:06,537 WARN org.springframework.ws.soap.server.SoapMessageDisp atcher - Endpoint invocation resulted in exception - responding with SOAP Fault
    net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting the 'namespaces' feature to true
    at net.sf.saxon.event.Sender.configureParser(Sender.j ava:357)
    at net.sf.saxon.event.Sender.sendSAXSource(Sender.jav a:241)
    at net.sf.saxon.event.Sender.send(Sender.java:142)
    at net.sf.saxon.IdentityTransformer.transform(Identit yTransformer.java:29)
    at org.springframework.ws.server.endpoint.support.Pay loadRootUtils.getPayloadRootQName(PayloadRootUtils .java:79)
    at org.springframework.ws.server.endpoint.mapping.Pay loadRootQNameEndpointMapping.resolveQName(PayloadR ootQNameEndpointMapping.java:56)
    at org.springframework.ws.server.endpoint.mapping.Abs tractQNameEndpointMapping.getLookupKeyForMessage(A bstractQNameEndpointMapping.java:33)
    at org.springframework.ws.server.endpoint.mapping.Abs tractMapBasedEndpointMapping.getEndpointInternal(A bstractMapBasedEndpointMapping.java:106)
    at org.springframework.ws.server.endpoint.mapping.Abs tractEndpointMapping.getEndpoint(AbstractEndpointM apping.java:83)
    at org.springframework.ws.server.MessageDispatcher.ge tEndpoint(MessageDispatcher.java:238)
    at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:191)
    at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispatcher.java:158)
    at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:87)
    at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:158)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:461)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:426)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3211)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:1983)
    at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:1890)
    at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1344)
    at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java :181)

  • #2
    Looks like an issue we should fix. Could you create a JIRA issue please? See http://opensource2.atlassian.com/pro...ing/browse/SWS

    Make sure to clearly indicate what libraries you are using besides SAXON (i.e. which app server, which version of SAAJ or Axiom, etc).

    Thanks

    Comment


    • #3
      I've created a Jira (SWS-202). In the meanwhile, is there a way configure the PayloadRootQNameEndpointMapping so that it uses another XMLReader? Could I declare a bean to either inject another XMLReader which would be compliant with Saxon, or inject another XSL transformer instead of Saxon? From what I have seen, all those components have default behavior so we don't even need to declare them as Beans, but I guess this could be overridden? I am not sure how.
      Note: I cannot remove Saxon from being the default XSL transformer. We need the XSL features it offers.

      Thanks,
      Llaurick.

      Comment


      • #4
        The XMLReader is created by the JAXP transformation framework, and as far as I know, you cannot override it, besides changing the default transformer.

        I will take a look at that issue for 1.0.2, though. Thanks for creating it.

        Comment


        • #5
          In the meanwhile, I still want to have my Spring webservice. I've found two workarounds:
          The first one is I created a SingleEndpointMapping class which extend AbstractEndpointMapping. It simply has a getEndpoint and setEndpoint method. This works quite well if your webservice needs to rout all calls to the same endpoint, which is my case.
          This SingleEndpointMapping could be a little addition to the framework no? It does bypass the need to parse anything and so is fast.

          This only fixed half my needs because I also want to apply a transform before the endpoint, which does trigger the same problem.
          So I've tried another workaround by declaring a messageFactory of type AxiomSoapMessageFactory. This worked.

          I have found another bug. If I set Spring logging to debug(via Log4J), which is quite convenient when you try new stuff, then Axiom raises an error, stating: axiomElement must not be null. Basically, it seems that Spring consumes the stream by logging the XML. The problem does not occurs if I set logging level to info.
          Is there already a bug open for that? I've not found any. If not, do you want me to open one?

          Comment


          • #6
            Originally posted by llaurick View Post
            I have found another bug. If I set Spring logging to debug(via Log4J), which is quite convenient when you try new stuff, then Axiom raises an error, stating: axiomElement must not be null. Basically, it seems that Spring consumes the stream by logging the XML. The problem does not occurs if I set logging level to info.
            Is there already a bug open for that? I've not found any. If not, do you want me to open one?
            That looks like a bug. Could you please file one, with the stacktrace?

            Comment


            • #7
              Hi,
              the bug(SWS-202) is not fixed I think .I have the same exception
              Code:
              The SAX2 parser does not support setting the 'namespaces' feature to true
              07 Mar 2008 14:08:47,624 WARN  [http-8080-1] org.springframework.ws.soap.server.SoapMessageDispatcher#processEndpointException(309) - Endpoint invocation resulted in exception - responding with SOAP Fault
              net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting the 'namespaces' feature to true
                      at net.sf.saxon.event.Sender.configureParser(Sender.java:369)
                      at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:241)
                      at net.sf.saxon.event.Sender.send(Sender.java:142)
                      at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29)
                      at org.springframework.xml.transform.TransformerObjectSupport.transform(TransformerObjectSupport.java:72)
                      at org.springframework.ws.server.endpoint.AbstractSaxPayloadEndpoint.invoke(AbstractSaxPayloadEndpoint.java:52)
                      at org.springframework.ws.server.endpoint.adapter.PayloadEndpointAdapter.invoke(PayloadEndpointAdapter.java:48)
                      at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:215)
                      at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:162)
                      at

              Comment


              • #8
                Could you try and use 1.5 M2 (or the RC1 I'm going to put up soon).

                I did some fixing on the namespace features in 1.5. Things should work now.

                Comment

                Working...
                X