Announcement Announcement Module
Collapse
No announcement yet.
Error using PayloadValidatingInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error using PayloadValidatingInterceptor

    Hi, I'm trying to use the PayloadValidatingInterceptor to validate soap xml request.

    Here is the relevent code in spring application-context.xml:
    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
    <list>
    <ref local="validatingInterceptor" />
    </list>
    </property>
    </bean>

    <bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/wsdl/MySchema.xsd" />
    <property name="validateRequest" value="true" />
    <property name="validateResponse" value="true" />
    </bean>

    I'm getting the following error:
    SRVE0100E: Did not realize init() exception thrown by servlet my-webservices: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.Pa yloadRootAnnotationMethodEndpointMapping#0' defined in class path resource [my-webservices-context.xml]: Cannot resolve reference to bean 'validatingInterceptor' while setting bean property 'interceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'validatingInterceptor' defined in class path resource [my-webservices-context.xml]: Invocation of init method failed; nested exception is javax.xml.validation.SchemaFactoryFinder$Configura tionError: Provider http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp. validation.xs.SchemaFactoryImpl not found .

    Probably I'm missing a very simple step here, but I'm pretty new to spring ws. Can anyone respond with a solution?

  • #2
    Originally posted by pksh View Post
    Hi, I'm trying to use the PayloadValidatingInterceptor to validate soap xml request.

    Here is the relevent code in spring application-context.xml:
    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
    <list>
    <ref local="validatingInterceptor" />
    </list>
    </property>
    </bean>

    <bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/wsdl/MySchema.xsd" />
    <property name="validateRequest" value="true" />
    <property name="validateResponse" value="true" />
    </bean>

    I'm getting the following error:
    SRVE0100E: Did not realize init() exception thrown by servlet my-webservices: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.Pa yloadRootAnnotationMethodEndpointMapping#0' defined in class path resource [my-webservices-context.xml]: Cannot resolve reference to bean 'validatingInterceptor' while setting bean property 'interceptors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'validatingInterceptor' defined in class path resource [my-webservices-context.xml]: Invocation of init method failed; nested exception is javax.xml.validation.SchemaFactoryFinder$Configura tionError: Provider http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp. validation.xs.SchemaFactoryImpl not found .

    Probably I'm missing a very simple step here, but I'm pretty new to spring ws. Can anyone respond with a solution?
    looks like you need a big help, i have someone to refer on this one.

    Comment


    • #3
      I replaced spring-ws-1.5.9-all.jar with spring-ws-1.5.6-all.jar, I'm getting a different error now.
      This seems to be a classloader issue but not sure.

      E [Servlet Error]-[org.springframework.ws.transport.http.MessageDispa tcherServlet]: java.lang.ClassNotFoundException: org.springframework.ws.transport.http.MessageDispa tcherServlet
      at com.ibm.ws.classloader.CompoundClassLoader.findCla ss(CompoundClassLoader.java:472)
      at com.ibm.ws.classloader.CompoundClassLoader.loadCla ss(CompoundClassLoader.java:373)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:5 61)
      at java.beans.Beans.instantiate(Beans.java:202)
      at java.beans.Beans.instantiate(Beans.java:63)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.r un(ServletWrapper.java:1195)
      at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:118)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.loa dServlet(ServletWrapper.java:1190)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.l oadServlet(ServletWrapper.java:385)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:339)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.h andleRequest(ServletWrapper.java:463)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3129)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:238)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:811)
      at com.ibm.ws.wswebcontainer.WebContainer.handleReque st(WebContainer.java:1433)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:93)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:465)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:394)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.ready(HttpInboundLink.java:274)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.sendToDiscriminators(NewConnectionIniti alReadCallback.java:214)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.complete(NewConnectionInitialReadCallba ck.java:113)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :152)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:213)
      at com.ibm.io.async.AbstractAsyncFuture.fireCompletio nActions(AbstractAsyncFuture.java:195)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:194)
      at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:741)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:863)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1510)

      Comment


      • #4
        Finally I have solved the issue. It was classpath i.e conflicting version of jars.
        This the final list of jars that ended up in my classpath:
        axiom-api-1.2.8.jar
        axiom-impl-1.2.8.jar
        commons-httpclient-3.1.jar
        commons-logging-1.1.1.jar
        dom4j-1.6.1.jar
        log4j-1.2.15.jar
        saaj-api-1.3.jar
        saaj-impl-1.3.2.jar
        spring-aop-2.5.6.jar
        spring-beans-2.5.6.jar
        spring-context-2.5.6.jar
        spring-core-2.5.6.jar
        spring-jdbc-2.5.6.jar
        spring-jms-2.5.6.jar
        spring-oxm-1.5.7.jar
        spring-tx-2.5.6.jar
        spring-web-2.5.6.jar
        spring-webmvc-2.5.6.jar
        spring-ws-1.5.7-all.jar
        spring-ws-core-1.5.7.jar
        wsdl4j-1.6.1.jar
        wss4j-1.5.8.jar
        wstx-asl-3.2.7.jar
        xalan-2.7.0.jar
        xercesImpl-2.8.1.jar
        xml-apis-1.3.04.jar
        xmlbeans-2.4.0.jar

        Hope this would help someone.

        Comment

        Working...
        X