camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bgoetzmann <bgoetzm...@sophia.symag.com>
Subject My test scheme
Date Tue, 16 Oct 2007 15:59:15 GMT

Hello,

In order to better understand Camel, I create a MailComponent instance that
I customize for the protocol and the destination. Then, I register it into
the Camel context with the name "test".

So in my Camel route I use the URI
"test://bgoetzmann@srvmail?password=motdepasse" on which I send messages
(see the code bellow), but I get the following exception:

Caused by: javax.mail.NoSuchProviderException: No provider for test
	at javax.mail.Session.getProvider(Session.java:455)

I thought that my customized component would be able to handle incoming
message and send emails!
Any idea on what can be wrong on my approach?

Thank you.


Here the code:

CamelContext camelContext = new DefaultCamelContext();
		
		MailComponent mail = new MailComponent();
		mail.getConfiguration().setProtocol("smtp");
		mail.getConfiguration().setDestination("bgoetzmann@test.com");
		
		camelContext.addComponent("test", mail);
				
		camelContext.addRoutes(new RouteBuilder() {

		    public void configure() {
		        from("timer:myTimerEvent?fixedRate=true&delay=0&period=1000")
		        .setBody(constant("Salut
!")).to("test://bgoetzmann@srvmail?password=motdepasse");		        
		    }
		    
		});
		
		camelContext.start();
...
-- 
View this message in context: http://www.nabble.com/My-test-scheme-tf4635115s22882.html#a13236630
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message