camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hdev <henning.due...@berlin.de>
Subject Re: problems loading jetty - "Illegal context spec:null"
Date Sun, 21 Mar 2010 11:42:48 GMT

Hi Willem,
thank you for your reply.

Unfortunately the problem must be somewhere else

I tried some combinations always getting the same Exception:

  jetty:http://localhost:9080/?matchOnUriPrefix=true
  jetty:http://localhost:9080/MyApp/?matchOnUriPrefix=true
  jetty:http://localhost:9080/
  jetty:http://localhost:9080/MyApp/
  jetty:http://localhost:9080/MyApp/FooBar

This is the first excercising with camel, so the Error might be somthing
really really stupid, since no one else seams to have this problem. 
I successfully created consuming and producing endpoints for jms, active-mq,
mina tcp, file and so on, but the simplest jetty:http refuses to work.

So i am a bit clueless at the moment...

Maybe there is something wrong with the loaded jar versions.
This is the list of jars that a currently referenced in the eclipse project
    
        apache-camel-2.2.0/lib/camel-core-2.2.0.jar
        apache-camel-2.2.0/lib/camel-jms-2.2.0.jar
        apache-camel-2.2.0/lib/camel-spring-2.2.0.jar
        apache-camel-2.2.0/lib/commons-logging-1.1.1.jar
        apache-camel-2.2.0/lib/commons-management-1.0.jar
        apache-camel-2.2.0/lib/spring-beans-2.5.6.jar
        apache-camel-2.2.0/lib/spring-context-2.5.6.jar
        apache-camel-2.2.0/lib/spring-core-2.5.6.jar
        apache-activemq-5.3.0/activemq-all-5.3.0.jar
        apache-camel-2.2.0/lib/spring-aop-2.5.6.jar
        apache-camel-2.2.0/lib/spring-web-2.5.6.jar
        backport-util-concurrent-3.0.jar
        spring-2.5.6.jar
        apache-activemq-5.3.0/lib/activemq-core-5.3.0.jar
        apache-activemq-5.3.0/lib/activemq-web-5.3.0.jar
        apache-activemq-5.3.0/lib/optional/commons-pool-1.4.jar
        apache-camel-2.2.0/lib/camel-jetty-2.2.0.jar
        apache-camel-2.2.0/lib/camel-http-2.2.0.jar
        apache-activemq-5.3.0/lib/optional/commons-httpclient-3.1.jar
        apache-activemq-5.3.0/lib/web/geronimo-servlet_2.5_spec-1.2.jar
        apache-activemq-5.3.0/lib/web/jetty-6.1.9.jar
        apache-activemq-5.3.0/lib/web/jetty-util-6.1.9.jar
        apache-activemq-5.3.0/lib/web/jetty-xbean-6.1.9.jar
        jetty-client-6.1.19.jar
        apache-camel-2.2.0/lib/camel-servlet-2.2.0.jar
        apache-camel-2.2.0/lib/camel-mina-2.2.0.jar
        mina-core-1.1.7.jar
        apache-activemq-5.3.0/lib/web/slf4j-api-1.5.0.jar
        apache-activemq-5.3.0/lib/web/slf4j-jcl-1.5.0.jar

These containbs also the jars for the other referenced endpoints i tried
also.
but i think the jars should all be ok or at least up to date. or is there
something missing.

Perhaps i should reduce the scenario to find the problem.
What would be the minimal environment of jars to start a camel jetty:http
endpoint from JavaDSL? 

thanks in advance for replies,
Henning



willem.jiang wrote:
> 
> Hi,
> 
> You got this kind of exception, because you didn't specify the context 
> path. Please change the RouteBuilder configure method like this
> 
> from("jetty:http://localhost:9080/?matchOnUriPrefix=true").to("mock:one");
> 
> Willem
> 
> 
> hdev wrote:
>> Hi,
>> when I try to start a CamelContext with a simple route
>> import org.apache.camel.builder.RouteBuilder;
>> import org.apache.camel.impl.DefaultCamelContext;
>> 
>> 
>> public class Main {
>> 
>> 	public static void main(String[] args) throws Exception {
>> 		DefaultCamelContext camelContext;
>> 
>> 		camelContext = new DefaultCamelContext();
>> 		camelContext.addRoutes(new RouteBuilder() {
>> 			public void configure() {
>> 				from("jetty:http://localhost:9080?matchOnUriPrefix=true")
>> 					.to("mock:one");
>> 			}
>> 		});	
>> 		camelContext.start();
>> 		Thread.sleep(10000);				
>> 	}
>> }
>> 
>> using jetty-6.1.9 i get the following Output and Exception
>> 
>> 20.03.2010 14:07:25 org.apache.camel.impl.DefaultCamelContext doStart
>> INFO: Apache Camel 2.2.0 (CamelContext:camel-1) is starting
>> 20.03.2010 14:07:25 org.apache.camel.impl.DefaultCamelContext
>> createManagementStrategy
>> INFO: JMX enabled. Using DefaultManagedLifecycleStrategy.
>> 20.03.2010 14:07:27 org.apache.camel.component.jetty.JettyHttpComponent
>> connect
>> WARNUNG: You use localhost interface! It means that no external
>> connections
>> will be available. Don't you want to use 0.0.0.0 instead (all network
>> interfaces)?
>> 2010-03-20 14:07:27.996::INFO:  Logging to STDERR via
>> org.mortbay.log.StdErrLog
>> 2010-03-20 14:07:27.996::INFO:  jetty-6.1.9
>> Exception in thread "main" java.lang.IllegalArgumentException: Illegal
>> context spec:null
>> 	at
>> org.mortbay.jetty.handler.ContextHandlerCollection.mapContexts(ContextHandlerCollection.java:82)
>> 	at
>> org.mortbay.jetty.handler.ContextHandlerCollection.setHandlers(ContextHandlerCollection.java:149)
>> 	at
>> org.mortbay.jetty.handler.HandlerCollection.addHandler(HandlerCollection.java:197)
>> 	at org.mortbay.jetty.Server.addHandler(Server.java:591)
>> 	at org.mortbay.jetty.servlet.Context.<init>(Context.java:124)
>> 	at org.mortbay.jetty.servlet.Context.<init>(Context.java:73)
>> 	at
>> org.apache.camel.component.jetty.JettyHttpComponent.createServletForConnector(JettyHttpComponent.java:356)
>> 	at
>> org.apache.camel.component.jetty.JettyHttpComponent.connect(JettyHttpComponent.java:159)
>> 	at
>> org.apache.camel.component.http.HttpEndpoint.connect(HttpEndpoint.java:111)
>> 	at
>> org.apache.camel.component.http.HttpConsumer.doStart(HttpConsumer.java:50)
>> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:53)
>> 	at
>> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:49)
>> 	at
>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:989)
>> 	at test.Main.main(Main.java:22)
>> 
>> The Class is started in Eclipse. 
>> The Libraries come from Camel 2.2.0 and ActiveMQ 5.3.0 releases. I am not
>> using maven but have downloaded the libs explicitly.
>> 
>> since all posts i found concerning this Exception gave me no clue for
>> solving my problem, i am posting here.
>> 
>> thanks i advance
>> Henning
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/problems-loading-jetty---%22Illegal-context-spec%3Anull%22-tp27954863p27975511.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message