3 Replies Latest reply on Jun 22, 2016 2:17 AM by Tom Cunningham

    Connection Timeout handling in switchyard Error.

    ravi narayanan Expert

      Hi All,

      Iam using jboss fuse service works 6.0 which uses switchyard 1.1

       

      Iam trying to handle timeout exception separately.

       

      My route is as below

       

      <?xml version="1.0" encoding="ASCII"?>

      <routes xmlns="http://camel.apache.org/schema/spring">

          <route>

              <from uri="switchyard://HelloWorldImpl"/>

              <doTry>

                  <log message="HelloWorldImpl - message received: ${body}"/>

                  <to uri="switchyard://ESBService"/>

                   <doCatch>

                      <exception>org.apache.http.conn.ConnectTimeoutException</exception>

                      <bean ref="Utility" method="setHttpExceptionDetails()"/>

                  </doCatch>

                  <doCatch>

                      <exception>org.switchyard.HandlerException</exception>

                      <bean ref="Utility" method="setSwitchyardExceptionDetails()"/>

                  </doCatch>

                  <doCatch>

                      <exception>java.lang.Exception</exception>

                      <bean ref="Utility" method="setExceptionDetails()"/>

                  </doCatch>

              </doTry>

          </route>

      </routes>

       

       

      iam getting below error while deployment.

       

      12:24:17,358 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-12) MSC000001: Failed to start service jboss.deployment.unit."switchyard-helloworld-0.0.1-SNAPSHOT.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-helloworld-0.0.1-SNAP

      .jar".SwitchYardService: org.switchyard.SwitchYardException: Failed to create route route24 at: >>> DoTry[[Log[HelloWorldImpl - message received: ${body}], To[switchyard://ESBService], DoCatch[ null -> [Bean[ref:Utility method: setHttpExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility met

      setSwitchyardExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method: setExceptionDetails()]]]]] <<< in route: Route[[From[switchyard://HelloWorldImpl]] -> [DoTry[[Log[Hel... because of org.apache.http.conn.ConnectTimeoutException

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:80)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

      Caused by: org.switchyard.SwitchYardException: Failed to create route route24 at: >>> DoTry[[Log[HelloWorldImpl - message received: ${body}], To[switchyard://ESBService], DoCatch[ null -> [Bean[ref:Utility method: setHttpExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method: setSwitch

      ExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method: setExceptionDetails()]]]]] <<< in route: Route[[From[switchyard://HelloWorldImpl]] -> [DoTry[[Log[Hel... because of org.apache.http.conn.ConnectTimeoutException

              at org.switchyard.component.camel.deploy.CamelActivator.handleImplementation(CamelActivator.java:103)

              at org.switchyard.component.camel.deploy.CamelActivator.activateService(CamelActivator.java:75)

              at org.switchyard.deploy.internal.Deployment.deployImplementations(Deployment.java:546)

              at org.switchyard.deploy.internal.Deployment.start(Deployment.java:144)

              at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:73)

              ... 5 more

      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route24 at: >>> DoTry[[Log[HelloWorldImpl - message received: ${body}], To[switchyard://ESBService], DoCatch[ null -> [Bean[ref:Utility method: setHttpExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method

      tSwitchyardExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method: setExceptionDetails()]]]]] <<< in route: Route[[From[switchyard://HelloWorldImpl]] -> [DoTry[[Log[Hel... because of org.apache.http.conn.ConnectTimeoutException

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)

              at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:731)

              at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1803)

              at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:675)

              at org.switchyard.component.camel.deploy.CamelActivator.handleImplementation(CamelActivator.java:95)

              ... 10 more

      Caused by: java.lang.ClassNotFoundException: org.apache.http.conn.ConnectTimeoutException

              at org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:61)

              at org.apache.camel.model.CatchDefinition.createExceptionClasses(CatchDefinition.java:254)

              at org.apache.camel.model.CatchDefinition.createProcessor(CatchDefinition.java:90)

              at org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:88)

              at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461)

              at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)

              at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:876)

              ... 15 more

       

      12:24:17,386 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."switchyard-helloworld-0.0.1-SNAPSHOT.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-helloworld-0.0.1-SNAPSHOT.jar".SwitchYardService: org.switchyard.Switch

      Exception: Failed to create route route24 at: >>> DoTry[[Log[HelloWorldImpl - message received: ${body}], To[switchyard://ESBService], DoCatch[ null -> [Bean[ref:Utility method: setHttpExceptionDetails()]]], DoCatch[ null -> [Bean[ref:Utility method: setSwitchyardExceptionDetails()]]], DoCatch[

      -> [Bean[ref:Utility method: setExceptionDetails()]]]]] <<< in route: Route[[From[switchyard://HelloWorldImpl]] -> [DoTry[[Log[Hel... because of org.apache.http.conn.ConnectTimeoutException

       

       

      httpclient-4.2.1-redhat-1.jar is already present in  C:\BIH\Jboss FSW 6.0 BIH Demo\jboss-eap-6.1\modules\system\layers\base\org\apache\httpcomponents\main