使用 Mule ESB 2.2.1 创建直通

发布于 2024-08-18 08:49:24 字数 19266 浏览 7 评论 0原文

我正在尝试为 Mule ESB 2.2.1 设置一个配置文件,将传入请求路由到另一个盒子。这看起来很简单,但我收到连接拒绝异常,我不知道为什么。

这是我的 Mule 配置文件中的模型:

<model name="ProxySample">
    <service name="HttpProxyService">
        <inbound>
            <http:inbound-endpoint address="http://localhost:8787" synchronous="true"/>
        </inbound>
        <outbound>
            <pass-through-router>
                <outbound-endpoint address="http://server2.xyz.com:8080#[header:http.request]" synchronous="true"/>
            </pass-through-router>
        </outbound>
    </service>
</model>

我正在浏览 http://localhost:8787/my-site< /a> 在我的浏览器中,认为它将路由到 http://server2.xyz.com :8080/my-site,但我收到连接拒绝错误。

以下是 Mule 服务器的控制台输出:

**********************************************************************
* Mule ESB and Integration Platform                                  *
* Version: 2.2.1 Build: 14422                                        *
* MuleSource, Inc.                                                   *
* For more information go to http://mule.mulesource.org              *
*                                                                    *
* Server started: 1/19/10 10:43 AM                                   *
* Server ID: 6802537d-0511-11df-bb89-710580f6c729                    *
* JDK: 1.6.0_18 (mixed mode, sharing)                                *
* OS encoding: UTF-8, Mule encoding: UTF-8                           *
* OS: Windows XP - Service Pack 3 (5.1, x86)                         *
* Host:                                      *
*                                                                    *
* Agents Running: None                                               *
**********************************************************************
INFO  2010-01-19 10:43:50,681 [connector.http.0.receiver.2] org.mule.transport.http.HttpClientMessageDispatcher: Connected: endpoint.outbound.http://localhost:8080#[header:http.request]
ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.DefaultExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

INFO  2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.transaction.TransactionTemplate: Exception Caught in Transaction template.  Handing off to exception handler: org.mule.service.DefaultServiceExceptionStrategy@1412e75
ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.service.DefaultServiceExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.service.DefaultServiceExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

I'm attempting to set up a config file for Mule ESB 2.2.1 that routes incoming requests to another box. This seems straight forward, but I am getting connection refused exceptions and I'm not sure why.

Here is the model from my Mule configuration file:

<model name="ProxySample">
    <service name="HttpProxyService">
        <inbound>
            <http:inbound-endpoint address="http://localhost:8787" synchronous="true"/>
        </inbound>
        <outbound>
            <pass-through-router>
                <outbound-endpoint address="http://server2.xyz.com:8080#[header:http.request]" synchronous="true"/>
            </pass-through-router>
        </outbound>
    </service>
</model>

I am browsing to http://localhost:8787/my-site in my browser, thinking that it will route to http://server2.xyz.com:8080/my-site, but I get a connection refused error.

Here is the console output from the Mule server:

**********************************************************************
* Mule ESB and Integration Platform                                  *
* Version: 2.2.1 Build: 14422                                        *
* MuleSource, Inc.                                                   *
* For more information go to http://mule.mulesource.org              *
*                                                                    *
* Server started: 1/19/10 10:43 AM                                   *
* Server ID: 6802537d-0511-11df-bb89-710580f6c729                    *
* JDK: 1.6.0_18 (mixed mode, sharing)                                *
* OS encoding: UTF-8, Mule encoding: UTF-8                           *
* OS: Windows XP - Service Pack 3 (5.1, x86)                         *
* Host:                                      *
*                                                                    *
* Agents Running: None                                               *
**********************************************************************
INFO  2010-01-19 10:43:50,681 [connector.http.0.receiver.2] org.mule.transport.http.HttpClientMessageDispatcher: Connected: endpoint.outbound.http://localhost:8080#[header:http.request]
ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.DefaultExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

INFO  2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.transaction.TransactionTemplate: Exception Caught in Transaction template.  Handing off to exception handler: org.mule.service.DefaultServiceExceptionStrategy@1412e75
ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.service.DefaultServiceExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

ERROR 2010-01-19 10:43:54,665 [connector.http.0.receiver.2] org.mule.service.DefaultServiceExceptionStrategy: 
********************************************************************************
Message               : Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod
Type                  : org.mule.api.transport.DispatchException
Code                  : MULE_ERROR-42999
Payload               : org.apache.commons.httpclient.methods.GetMethod@d67067
JavaDoc               : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html
********************************************************************************
Exception stack is:
1. Connection refused: connect (java.net.ConnectException)
  java.net.PlainSocketImpl:-2 (null)
2. Failed to route event via endpoint: org.mule.endpoint.DynamicURIOutboundEndpoint@6645e149. Message payload is of type: GetMethod (org.mule.api.transport.DispatchException)
  org.mule.transport.http.HttpClientMessageDispatcher:127 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/transport/DispatchException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:525)
    at java.net.Socket.connect(Socket.java:475)
    at java.net.Socket.<init>(Socket.java:372)
    at java.net.Socket.<init>(Socket.java:246)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
    at org.mule.transport.http.HttpClientMessageDispatcher.execute(HttpClientMessageDispatcher.java:120)
    at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:258)
    at org.mule.transport.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:163)
    at org.mule.transport.AbstractConnector.send(AbstractConnector.java:2016)
    at org.mule.endpoint.DynamicURIOutboundEndpoint.send(DynamicURIOutboundEndpoint.java:178)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:327)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:213)
    at org.mule.routing.outbound.AbstractOutboundRouter$2.doInTransaction(AbstractOutboundRouter.java:152)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:99)
    at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:159)
    at org.mule.routing.outbound.ChainingRouter.route(ChainingRouter.java:123)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTransaction(DefaultOutboundRouterCollection.java:88)
    at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:45)
    at org.mule.routing.outbound.DefaultOutboundRouterCollection.route(DefaultOutboundRouterCollection.java:93)
    at org.mule.service.AbstractService.sendToOutboundRouter(AbstractService.java:892)
    at org.mule.model.seda.SedaService.doSend(SedaService.java:258)
    at org.mule.service.AbstractService.sendEvent(AbstractService.java:500)
    at org.mule.DefaultMuleSession.sendEvent(DefaultMuleSession.java:354)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.send(DefaultInboundRouterCollection.java:228)
    at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:188)
    at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:364)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:193)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.doRequest(HttpMessageReceiver.java:273)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.processRequest(HttpMessageReceiver.java:227)
    at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:619)

********************************************************************************

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北方的韩爷 2024-08-25 08:49:24

我的项目在 Eclipse 中没有正确清理。一旦我运行了正确的配置文件,上面的示例就按预期工作了。

My project wasn't cleaning correctly in Eclipse. Once I ran the correct configuration file, the example above worked as intended.

揽月 2024-08-25 08:49:24

这肯定可行,如果您不想使服务更具可读性,您还可以编写隐式组件:

<model name="ProxySample">
    <service name="HttpProxyService">
        <inbound>
            <http:inbound-endpoint address="http://localhost:8787" synchronous="true"/>
        </inbound>

        <bridge-component />

        <outbound>
            <pass-through-router>
                <outbound-endpoint address="http://server2.xyz.com:8080#[header:http.request]" synchronous="true"/>
            </pass-through-router>
        </outbound>
    </service>
</model>

That should definitelly work, if you wan't to make the service more readable, you can also write the implicit component :

<model name="ProxySample">
    <service name="HttpProxyService">
        <inbound>
            <http:inbound-endpoint address="http://localhost:8787" synchronous="true"/>
        </inbound>

        <bridge-component />

        <outbound>
            <pass-through-router>
                <outbound-endpoint address="http://server2.xyz.com:8080#[header:http.request]" synchronous="true"/>
            </pass-through-router>
        </outbound>
    </service>
</model>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文