家伙!我在Jboss Developer Studio中有一个项目。如果我在Local Camel Context上运行项目 - 它可以工作。如果我在Jboss Runtime Server 6.3中运行项目,我会看到这个错误:
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver not found by xml-to-database [297]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1853)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:958)
at org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:47)
at org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:69)
... 35 more
Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver from bundle 297 (xml-to-database)
at org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1422)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1373)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1046)
at org.apache.camel.component.jdbc.JdbcProducer.processingSqlBySettingAutoCommit(JdbcProducer.java:80)
at org.apache.camel.component.jdbc.JdbcProducer.process(JdbcProducer.java:67)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:681)
at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:609)
at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:238)
at org.apache.camel.processor.Splitter.process(Splitter.java:108)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:454)
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:226)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:190)
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
但是我在Fuse中安装了这些软件包:
wrap:mvn:com.microsoft.sqlserver/mssql-jdbc/6.2.1.jre8
wrap:https://maven.lib.umd.edu/maven2/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.jar
使用Jboss Developer Studio上的外部存档sqljdbc4-4.0创建maven构建
答案 0 :(得分:1)
您的项目似乎无法找到" SQLServerDriver"文件。 你可以下载jar文件并添加你的项目lib文件夹并再次部署并尝试..