4 Replies Latest reply on Aug 9, 2011 4:31 AM by Nele De Vleeschauwer

    Question about smtp endpoint

    Nele De Vleeschauwer Novice

      Hi, I'm new to FuseESB.

      To check out the functionalities of the product, I've created a new Camel XML fIle which checks if files arrive in a certain directory and delivers them via mail.

       

      This is my config:

       

       

       

      Each time when I run my test service, I 'm getting the following exception back:

      Protocol smtp cannot be used for a MailConsumer. Please use another protocol such as pop3 or imap.

       

      Any idea why ?

        • 1. Re: Question about smtp endpoint
          Claus Ibsen Master

          Can you post the stacktrace, and what version of Fuse ESB are you using? And what OS are you running on?

          • 2. Re: Question about smtp endpoint
            Nele De Vleeschauwer Novice

            Hi,

             

            I'm using version 2.7.1-fuse-00-43, which is installed on a Windows XP PRO OS.

             

            Find below the stacktrace:

            java.lang.IllegalArgumentException: Protocol smtp cannot be used for a MailConsumer. Please use another protocol such as pop3 or imap.

                 at org.apache.camel.component.mail.MailEndpoint.createConsumer(MailEndpoint.java:80)

                 at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)

                 at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)

                 at org.apache.camel.impl.RouteService.warmUp(RouteService.java:128)

                 at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1839)

                 at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1765)

                 at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1787)

                 at org.apache.camel.impl.DefaultCamelContext.startRouteService(DefaultCamelContext.java:1674)

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

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

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

                 at org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:337)

                 at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:265)

                 at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:614)

                 at com.fusesource.test.FileInSMTPOutXmlTest.testCamelRoute(FileInSMTPOutXmlTest.java:30)

                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                 at java.lang.reflect.Method.invoke(Method.java:597)

                 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

                 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

                 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

                 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

                 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

                 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

                 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                 at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

                 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

            • 3. Re: Question about smtp endpoint
              Claus Ibsen Master

              That is strange as it starts a consumer. Are you sure the pasted XML is exactly what you use? Maybe you have a 2nd route with has a

               

               

              • 4. Re: Question about smtp endpoint
                Nele De Vleeschauwer Novice

                Before I just tested this via a camel junit test.

                Now, I've removed the junit test and deployed my jar to the ESB and tested it there... Here I'm no longer getting this exception...

                strange, but it seems to work now...