Hi,
   I am in the process of writing a camel hello world that would read http
requests (using the jetty component) and write it to a file, but I seem to
hit the following error :

org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
jetty://http://localhost:9080/myapp/myservice due to: No component found
with scheme: jetty

Am I missing some obvious settings ?

Here is the code snippet:

public class CamelFileEndpoints {

        public static void main(String[] args) throws Exception {
                CamelContext camel = new DefaultCamelContext();
                
                RouteBuilder route = new RouteBuilder() {
                        @Override
                        public void configure() throws Exception {
                                System.out.println("Configuring the source and 
destination");
                                
from("jetty:http://localhost:9080/myapp/myservice";).process(new
HttpProcessor()).to("file://src/targetFolder/");
                        }
                };
                
                camel.addRoutes(route);
                camel.start();  
                Thread.sleep(120000);
        }
}

--
The HttpGetTest in the jetty components test cases seems to succeed though!

--
But, I seem to hit the following error: 
Exception in thread "main" org.apache.camel.ResolveEndpointFailedException:
Failed to resolve endpoint: jetty://http://localhost:9080/myapp/myservice
due to: No component found with scheme: jetty
        at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:411)
        at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
        at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:132)
        at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:95)
        at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:101)
        at
org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
        at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:70)
        at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:287)
        at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:120)
        at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:559)
        at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:983)
        at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:960)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
        at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:870)
        at com.dataalp.camel.CamelFileEndpoints.main(CamelFileEndpoints.java:27)
---------
Debugging the code
JndiRegistry.lookup(jetty://http://localhost:9080/myapp/myservice)
threw a NamingException 
Thread [main] (Suspended)       
        JndiRegistry.lookup(String) line: 52    
        DefaultCamelContext.createEndpoint(String) line: 1063   
        DefaultCamelContext.getEndpoint(String) line: 394       
        CamelContextHelper.getMandatoryEndpoint(CamelContext, String) line: 52  
        RouteDefinition.resolveEndpoint(String) line: 132       
        DefaultRouteContext.resolveEndpoint(String) line: 95    
        DefaultRouteContext.resolveEndpoint(String, String) line: 101   
        FromDefinition.resolveEndpoint(RouteContext) line: 72   
        DefaultRouteContext.getEndpoint() line: 70      
        RouteDefinition.addRoutes(Collection<Route>, FromDefinition) line: 287  
        RouteDefinition.addRoutes(CamelContext, Collection<Route>) line: 120    
        DefaultCamelContext.startRoute(RouteDefinition) line: 559       
        DefaultCamelContext.startRouteDefinitions(Collection<RouteDefinition>)
line: 983       
        DefaultCamelContext.doStart() line: 960 
        DefaultCamelContext(ServiceSupport).start() line: 52    
        DefaultCamelContext.start() line: 870   
        CamelFileEndpoints.main(String[]) line: 27      

Any help is appreciated!
Thanks
Vijay
-- 
View this message in context: 
http://www.nabble.com/Camel-hello-world---Failed-to-resolve-endpoint%3A-jetty%3A--http%3A--localhost%3A9080-myapp-myservice-due-to%3A-No-component-found-with-scheme%3A-jetty-tp25178456p25178456.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to