Failed to resolve endpointdue to: No component found with scheme: jetty
Issue
- User created some sql endpoint and trying to consume them through CamelContext and ProducerTemplate.
- When trying to consume a sql end point, fuse throws following error. User has made sure that camel-jetty is installed to fuse, maven repository and added as a dependency to the pom.
- The error is as follows
org.apache.cxf.interceptor.Fault: Failed to resolve endpoint: jetty://http://localhost:8282/cxf/getMobileToken?extTxnID=null&username=miqbal due to: No component found with scheme: jetty
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:170)[org.apache.cxf:cxf-api:2.7.0.redhat-610379]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:136)[org.apache.cxf:cxf-api:2.7.0.redhat-610379]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:205)[org.apache.cxf:cxf-rt-frontend-jaxrs:2.7.0.redhat-610379]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:102)[org.apache.cxf:cxf-rt-frontend-jaxrs:2.7.0.redhat-610379]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[org.apache.cxf:cxf-api:2.7.0.redhat-610379]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)[org.apache.cxf:cxf-api:2.7.0.redhat-610379]
- User might have some issue the way he is using context. Here is the code snippet
private CamelContext getCamelContext()
{
CamelContext context = new DefaultCamelContext();
InputStream is = getClass().getResourceAsStream("blueprint.xml");
RoutesDefinition routes;
try {
routes = context.loadRoutesDefinition(is);
context.addRouteDefinitions(routes.getRoutes());
context.start();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return context;
}
public ProducerTemplate getProducerTemplate()
{
return getCamelContext().createProducerTemplate();
}
public MobileToken getMobileToken(TokenRequest tokeReuquest)
{
String uri = "jetty://http://localhost:8282/cxf/GetMobileToken?username=" + tokeReuquest.getUsername() + "&extTxnID=" + tokeReuquest.getId();
Exchange exchange=getProducerTemplate().request(uri,new Processor(){
@Override public void process( Exchange exchange) throws Exception {
}
}
);
ArrayList<MobileToken> mobileTokens = (ArrayList<MobileToken>) exchange.getOut().getBody();
if(mobileTokens.isEmpty())
return null;
return mobileTokens.get(0);
}
Environment
- Red Hat JBoss Fuse
- 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
