Announcement Announcement Module
Collapse
No announcement yet.
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is stric Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is stric

    Hi I'm new to Spring-ws and am struggling to get any Jaxb2 web services to work in tomcat. I keep getting cvc-complex-type.2.4.c related errors in regards to the jaxb2-marshaller.

    Any help would be much appreciated

    Error is as follows:

    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/rewardNetwork-servlet-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'oxm:jaxb2-marshaller'.

    root cause

    org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'oxm:jaxb2-marshaller'.
    com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(ErrorHandlerWrap per.java:195)
    com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.error(ErrorHandlerWrapper.java:131)
    com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:384)
    com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(XMLErrorReporter.java:318)
    com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator$XSIErrorReporter.reportError(XMLSchema Validator.java:410)
    com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.reportSchemaError(XMLSchemaValidator.j ava:3165)
    com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.handleStartElement(XMLSchemaValidator. java:1898)
    com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator.emptyElement(XMLSchemaValidator.java:7 05)
    com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.scanStartElement(XMLNSDocumentScann erImpl.java:377)
    com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDriver.next(XM LDocumentFragmentScannerImpl.java:2747)
    com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl.next(XMLDocumentScannerImpl.java:648)
    com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.next(XMLNSDocumentScannerImpl.java: 140)
    com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:510)
    com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:807)
    com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:737)
    com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:107)
    com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(DOMParser.java:225)
    com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(DocumentBuilderImpl.java:283)
    org.springframework.beans.factory.xml.DefaultDocum entLoader.loadDocument(DefaultDocumentLoader.java: 75)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:342)
    org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:310)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
    org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:124)
    org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:92)
    org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:123)
    org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:422)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:352)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 02)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:316 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:282)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:293)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:849)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:454)
    java.lang.Thread.run(Thread.java:619)


    Config file is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:oxm="http://www.springframework.org/schema/oxm"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd">

    <oxm:jaxb2-marshaller id="marshaller" contextPath="rewards.ws.types"/>

    <bean class="org.springframework.ws.server.endpoint.adap ter.GenericMarshallingMethodEndpointAdapter">
    <constructor-arg ref="marshaller"/>
    </bean>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping"/>

    <bean name="rewardNetworkDefinition" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition">
    <property name="schema">
    <bean class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="/WEB-INF/schemas/reward-network.xsd" />
    </bean>
    </property>
    <property name="portTypeName" value="Rewards" />
    <property name="locationUri" value="http://localhost:8080/ws-1-solution/rewards" />
    </bean>


    <bean id="rewardNetworkEndpoint" class="rewards.ws.RewardNetworkEndpoint">
    <constructor-arg ref="rewardNetwork"/>
    </bean>

    </beans>

    Pom dependencies:spring.ws.version 1.5.7.A, spring.framework.version 2.5.6.A, common.version 1.0.1.RELEASE

    <dependencies>
    <dependency>
    <groupId>com.springsource.training.common</groupId>
    <artifactId>common-aux</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.beans</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.web.servlet</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>org.springframework.ws.java5</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>org.springframework.oxm.java5</artifactId>
    </dependency>
    <dependency>
    <groupId>org.jvnet.jaxb2_commons</groupId>
    <artifactId>jaxb-xjc</artifactId>
    <version>2.1.10</version>
    </dependency>
    <dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.1.10</version>
    </dependency>
    <dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>com.springsource.org.hsqldb</artifactId>
    </dependency>
    <dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>com.springsource.javax.transaction</artifactId>
    </dependency>
    <dependency>
    <groupId>javax.wsdl</groupId>
    <artifactId>com.springsource.javax.wsdl</artifactId>
    </dependency>
    </dependencies>
    Last edited by lcbwebac; May 25th, 2010, 10:49 AM.

  • #2
    Using a spring 3 class with spring 2.5 jars isn't going to happen...

    Comment


    • #3
      Hi Marten, What is it specifically I need to change to get JAXB2 working with 2.5?

      Comment


      • #4
        1) check the version of xercesImpl.jar in tomcat/lib and also if there exists
        xercesImpl.jar in your application's WEB-INF/lib.
        Make sure they are latest ver >=2.9.1

        2)In your context you have:
        http://www.springframework.org/schem...ng-oxm-3.0.xsdSo you should update pom with Spring 3 dependencies.
        Follow this post for spring 3 dependencies:http://blog.springsource.com/2009/12...ts-with-maven/

        But you said you need 2.5,then you need to change context to 2.5 and update pom to include all 2.5 dependencies. You cannot mix and match 3 and 2.5.
        Last edited by spring2007; Jun 9th, 2010, 12:29 PM.

        Comment

        Working...
        X