简体   繁体   English

骆驼Java DSL:无法解析bean定义资源模式[META-INF / spring / *。xml]

[英]Camel Java DSL: Could not resolve bean definition resource pattern [META-INF/spring/*.xml]

I have recently run into a situation with Camel after merging an unrelated change which has caused this stack trace: 在合并了导致此堆栈跟踪的无关更改之后,我最近遇到了Camel的情况:

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:498)
    at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:519)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [META-INF/spring/*.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/spring/] cannot be resolved to URL because it does not exist
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:229)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:612)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:513)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:222)
    at org.apache.camel.spring.Main.doStart(Main.java:154)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:170)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:501)
    at org.apache.camel.spring.Main.main(Main.java:86)
    ... 6 more
Caused by: java.io.FileNotFoundException: class path resource [META-INF/spring/] cannot be resolved to URL because it does not exist
    at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:187)
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:465)
    at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:292)
    at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1291)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
    ... 21 more

The code merge did not mess with anything in the maven pom file and was relatively unrelated to Camel and Spring. 代码合并不会混淆maven pom文件中的任何内容,并且与Camel和Spring无关。 I am using Java DSL to avoid having any xml files to configure Camel. 我正在使用Java DSL来避免使用任何xml文件来配置Camel。 This works if I remove the aforementioned code merge. 如果删除上述代码合并,则此方法有效。 I think this is an odd error related to my pom configuration to begin with... Does anyone have any experience with this error using Java DSL instead of the xml configuration? 我认为这是与我的pom配置相关的一个奇怪错误,首先...使用Java DSL而不是xml配置,有人对这个错误有任何经验吗? Is there a way to specifically mention that I am using DSL? 有没有一种方法可以特别提及我正在使用DSL? If I am using DSL, it should not even look for an xml config file. 如果我使用的是DSL,则它甚至都不应该寻找xml配置文件。

Here is the related section of my POM file for reference: 这是我的POM文件的相关部分,以供参考:

<org.apache.camel.version>2.20.0</org.apache.camel.version>
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>1.4.1.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-dependencies</artifactId>
        <version>${org.apache.camel.version}</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>1.4.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-starter</artifactId>
        <version>${org.apache.camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>${org.apache.camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-aws</artifactId>
        <version>${org.apache.camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>${org.apache.camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-javaconfig</artifactId>
        <version>${org.apache.camel.version}</version>
    </dependency>

I managed to remove the provided tags from any of the dependencies and it worked while launching the spring application , however, I am unable to get Camel to run independently with the mvn camel:run command. 我设法从任何依赖项中删除了提供的标签,并且在启动spring应用程序时它起作用了,但是,我无法使用mvn camel:run命令让Camel独立运行。

<scope>import</scope>

This solved half of the problem which removed the roadblock for now. 这解决了目前消除障碍的一半问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在类路径资源[META-INF / spring / app-context.xml]中定义名称为“tilesConfigurer”的bean时出错 - Error creating bean with name 'tilesConfigurer' defined in class path resource [META-INF/spring/app-context.xml] 创建类路径资源 META-INF/cxf/cxf.xml 中定义的名称为“cxf”的 bean 时出错 - Error creating bean with name 'cxf' defined in class path resource META-INF/cxf/cxf.xml Java 在 ServletContext 资源 [/WEB-INF/spring-servlet.xml] 中定义名为“dataSource”的无效 bean 定义: - Java Invalid bean definition with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: 在类路径中找不到任何 META-INF/persistence.xml 文件 Java - 动态 Web 项目 - Could not find any META-INF/persistence.xml file in the classpath Java - Dynamic Web Project 创建名称为&#39;entityManagerFactory&#39;的bean时出错-&gt;无法从类路径资源[META-INF / persistence.xml]中解析持久性单元 - Error creating bean with name 'entityManagerFactory' -> Cannot parse persistence unit from class path resource [META-INF/persistence.xml] 错误:无法从类路径资源:META-INF / policy.xml加载WS-Security Policy定义 - Error : Failed to load WS-Security Policy definition from classpath resource: META-INF/policy.xml Java META-INF无法正常工作 - Java META-INF not working Java Meta-Inf服务 - Java Meta-Inf Services 创建在类路径资源[META-INF / cxf / cxf.xml]中定义的名称为&#39;org.apache.cxf.wsdl.WSDLManager&#39;的bean时出错:实例化bean失败 - Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean failed Maven-为什么我的pom.xml没有删除META-INF / *。SF,META-INF / *。DSA和META-INF / *。RSA? - maven - why is my pom.xml NOT removing META-INF/*.SF, META-INF/*.DSA and META-INF/*.RSA?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM