admin

MuleSoft和SQL Server数据库连接失败

sql

希望大家能为我提供帮助,在我身旁使用MuleSoft(MS)专家已有2天了,我们不能解决这个问题。简而言之,我们无法连接到SQL
Server数据库。我正在使用Generic_Database_Connectory以下信息:

  • 网址: jdbc:jtds:sqlserver://ba-crmdb01.ove.local:60520;Instance=CRM;user=rcapilli...
  • 驱动程序类名称: com.microsoft.sqlserver.jdbc.SQLServerDriver

这是一个sqljdbc4.jar文件,最新的。“测试连接”工作正常。那里没有问题。但是当我运行该应用程序时,出现此错误(如下)

任何人都可以使SQL Server数据库连接正常工作???

ERROR 2015-04-09 14:05:31,106 [pool-17-thread-1] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: null

java.lang.NullPointerException

    at org.mule.module.db.internal.domain.connection.DefaultDbConnection.isClosed(DefaultDbConnection.java:100) ~[mule-module-db-3.6.1.jar:3.6.1]

    at org.mule.module.db.internal.domain.connection.TransactionalDbConnectionFactory.releaseConnection(TransactionalDbConnectionFactory.java:136) ~[mule-module-db-3.6.1.jar:3.6.1]

    at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:99) ~[mule-module-db-3.6.1.jar:3.6.1]

    at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:164) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:148) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.pollWith(MessageProcessorPollingMessageReceiver.java:147) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.poll(MessageProcessorPollingMessageReceiver.java:138) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:80) ~[mule-core-3.6.1.jar:3.6.1]

    at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:49) ~[mule-core-3.6.1.jar:3.6.1]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[?:1.7.0_75]

    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) ~[?:1.7.0_75]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) ~[?:1.7.0_75]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.7.0_75]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_75]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_75]

    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_75]

阅读 217

收藏
2021-07-01

共1个答案

admin

这就是我过去的配置方式,它对我有用。.您可以尝试以下示例:-

<db:generic-config name="Generic_Database_Configuration"
        url="jdbc:sqlserver://ANIRBAN-PC\\SQLEXPRESS:1433;databaseName=MyDBName;user=sa;password=mypassword"
        driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" doc:name="Generic Database Configuration" />

并在M子流中:-

<db:select config-ref="Generic_Database_Configuration" doc:name="Database">
    <db:parameterized-query><![CDATA[select * from table1]]></db:parameterized-query>
  </db:select>
2021-07-01