Wildfly Swarm上的Camel路由尝试在不应该加载h2数据库时加载

时间:2017-09-04 16:02:07

标签: apache-camel wildfly-swarm

我有一个在Wildfly Swarm(2017.8.1)上运行的Camel路由,它使用JTDS驱动程序连接到SQL Server数据库。但是当我尝试运行它时,它会尝试加载h2数据库模块。我没有使用h2。

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


    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>app.properties</value>
        </property>
    </bean>

    <bean id="coreDS" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
        <property name="url" value="${db.core.uri}"/>
        <property name="username" value="${db.core.user}"/>
        <property name="password" value="${db.core.password}"/>
    </bean>

    <bean id="sql" class="org.apache.camel.component.sql.SqlComponent">
        <property name="dataSource" ref="coreDS"/>
    </bean>

    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <propertyPlaceholder id="placeholder" location="classpath:app.properties"/>
        <route id="retrieveZipFile">
            <from uri="{{ftp.silica.uri}}"/>
            <log message="checking for files"/>
            <to uri="file://Data/temp/zip"/>
            <to uri="sql:insert into dbo.Source_In(date, sourceInSystemId, filename) values (getdate(), 1, 'test');dataSource=coreDS"/>
        </route>


    </camelContext>

</beans>

错误:

Caused by: org.jboss.modules.ModuleLoadError: com.h2database.h2:main
        at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:74)
        at org.jboss.modules.Module.getPathsUnchecked(Module.java:1435)
        at org.jboss.modules.Module.loadModuleClass(Module.java:601)
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

为什么需要h2模块?我已经尝试将它添加到我的POM中,但它仍然失败。

0 个答案:

没有答案