匹配通配符是严格的,但没有声明可以找到元素“INT-HTTP:出站网关”

问题描述:

匹配通配符是严格的,但没有声明可以找到元素“INT-HTTP:出站网关”匹配通配符是严格的,但没有声明可以找到元素“INT-HTTP:出站网关”

共context.xml中具有下豆以下

  1. 的xmlns:INT-HTTP = “http://www.springframework.org/schema/integration/http”

  2. http://www.springframework.org/schema/integration/spring-integration.xsd“:运行mvn春天启动”只有当应用程序从春天启动1.3升级到1.4在运行时发生http://www.springframework.org/schema/integration/http

<?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:int="http://www.springframework.org/schema/integration" 
     xmlns:int-http="http://www.springframework.org/schema/integration/http" 
     xmlns:util="http://www.springframework.org/schema/util" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd 
     http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd 
     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> 
    <int:splitter input-channel="cvsSplitter" output-channel="statusChunkRequests" ref="cvsPagingSplitter"/> 
    <int:channel id="cvsResponseEventCreator"><int:queue/></int:channel> 
    <int:channel id="eventNotificationServiceCall"></int:channel> 
    <int:publish-subscribe-channel id="cvsResponse"/> 
    <int:chain input-channel="eventNotificationServiceCall" output-channel="eventPostChannel"> 
     <int:transformer> 
      <bean class="com.abc.xyz.InventoryEventTransformer"/> 
     </int:transformer> 
    </int:chain> 
    <int:chain input-channel="cvsResponseEventCreator" output-channel="eventPostChannel"> 
     <int:poller max-messages-per-poll="100" fixed-rate="1000"/> 
     <int:header-enricher> 
      <int:correlation-id value="correlateAll" /> 
     </int:header-enricher> 
     <int:aggregator> 
      <bean class="com.abc.xyz.InventoryEventTransformer"/> 
     </int:aggregator> 
    </int:chain> 
    <int:chain input-channel="eventPostChannel" output-channel="nullChannel"> 
     <int:header-enricher> 
      <int:header name="Content-Type" expression="'application/json'"/> 
     </int:header-enricher> 
     <int-http:outbound-gateway http-method="POST" 
            expected-response-type="com.fasterxml.jackson.databind.JsonNode" 
            charset="UTF-8" 
            request-factory="clientHttpRequestFactory" 
            url="${inv.event.rest.base.url}" reply-timeout="${inv.event.timeout}"> 
      <int-http:request-handler-advice-chain> 
       <ref bean="retrier" /> 
      </int-http:request-handler-advice-chain> 
     </int-http:outbound-gateway> 
    </int:chain> 

错误。该应用程序正常工作与春季启动1.3

 [WARNING] 
java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:507) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [integration/common-context.xml] 
Offending resource: class path resource [application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 47 in XML document from class path resource [integration/common-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 106; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-http:outbound-gateway'. 
    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:70) 
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) 
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:259) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:184) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:169) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:142) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:94) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:508) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) 
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) 
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) 
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromImportedResources(ConfigurationClassBeanDefinitionReader.java:346) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:142) 
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) 
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) 
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) 
    at com.cdk.dmg.remarketing.RemarketingInventoryLoaderApplication.main(RemarketingInventoryLoaderApplication.java:32) 
    ... 6 more 
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 47 in XML document from class path resource [integration/common-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 106; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-http:outbound-gateway'. 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) 
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:243) 
    ... 33 more 
Caused by: org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 106; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-http:outbound-gateway'. 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1917) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:746) 
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379) 
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786) 
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) 
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117) 
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) 
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) 
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) 
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) 
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) 
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:348) 
    at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429) 
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391) 
    ... 36 more 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 8.944 s 
[INFO] Finished at: 2017-04-19T15:08:53+05:30 
[INFO] Final Memory: 62M/779M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.3.RELEASE:run (default-cli) on project remarketing-inventory-loader: An exception occurred while running. null: InvocationTargetException: Configuration problem: Failed to import bean definitions from relative location [integration/common-context.xml] 
[ERROR] Offending resource: class path resource [application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 47 in XML document from class path resource [integration/common-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 106; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-http:outbound-gateway'. 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

春季启动(1.4.X)起下面的模块已被删除 https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Release-Notes

  • 弹簧集成文件

    弹簧集成-HTTP

    弹簧集成-IP

    弹簧集成流

这个问题可以通过在pom.xml中添加缺少的依赖

+1

你应该在将来让你的问题更清楚。如果您在原始问题中添加了“该应用程序可以正常使用Spring-boot 1.3',它将为您(和我)节省大量时间。 –

如果这是一个运行时的问题,你是从你的classpath缺少的spring-integration-http罐子。

如果它只是一个错误的IDE(并在运行时有效),这意味着你的IDE也不是“春天感知”; spring从jar中的类路径中解析出正确的模式。由于历史原因,互联网上的非版本模式是1.0版本(请参阅架构中​​的注释以解释原因)。

Spring-Aware IDEs包含eclipse(带有spring ide插件),Spring Tool Suite这是eclipse +插件和IntelliJ IDEA。

与Eclipse插件,您可以添加春天,大自然给你的项目,它会找到的模式。

如果你正在使用Eclipse和不想使用的插件,忽略错误或手动配置XML目录指向版本架构。

+0

加里得到解决 - 在运行时出现的错误“MVN春天启动:运行”只有当应用程序从春天启动1.3升级到1.4。该应用程序正常工作与春季启动1.3 – Rakesh0502

+1

集成起动机现在只增加了'弹簧集成 - core'罐子到类路径 - 人抱怨类路径膨胀(得到罐子他们并不需要)。你现在必须自己添加'spring-integration-http'。 –