Camel context not active when calling a bean?!
mbernloehr Feb 3, 2015 2:16 AMHey guys,
i'm facing a little problem. I'm using SwitchYard 2.0.0.Beta1 deployed on Wildfly 8.1.0.Final
My application is deployed as an EAR-Container.
BirtReportEngine.ear
---- BirtReportEngine-ejb (which consists of the business logic for generating reports and the BIRT framework)
---- BirtReportEngine-web (admin interface)
In the picture you can see my SwitchYard context in the EJB conext. The upper SOAP webservice is for generating reports.
But from my admin interface i'm injecting the ReportGenerationServiceBean. So i don't need to call the webservice.
However. i'm thinking that the Camel context is not properly initialized, because when i'm trying to send an email from the MailSendService i'm getting an exception.
I debugged in several stages and saw that when calling the SOAP Webservice there are much more headers initialized in the Camel context than when calling the bean directly from the admin interface.
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: smtp://smtp-server.com:25?from=NoReply%40BirtReportEngine&password=password&subject=subject&to=useremail&username=user due to: No component found with scheme: smtp at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:551) at org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:453) at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:109) at org.switchyard.component.camel.common.handler.OutboundHandler.handleInOnly(OutboundHandler.java:157) at org.switchyard.component.camel.common.handler.OutboundHandler.handleMessage(OutboundHandler.java:145) at org.switchyard.handlers.ProviderHandler.handleMessage(ProviderHandler.java:77) at org.switchyard.bus.camel.processors.HandlerProcessor.process(HandlerProcessor.java:61) at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91) at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) ... 133 more
This is the stackstrace when sending an email. I'm i have all required dependencies. When calling the SOAP webservice from SoapUI sending an email works like a charm.
@Inject private ReportGenerationServiceBean reportGenerationServiceBean;
I'm injecting the bean in the admin interface like this.
I hope you understand my problem and sorry for my bad english ;-)
Do you need any further information?
Regards
Matthias