Check out the docu. It has a chapter about looking up the connection factory via JNDI. And your endpoint configuration is also wrong.
http://camel.apache.org/jms.html Sent from a mobile device Am 28.01.2013 08:45 schrieb "amitoberoi" <aobe...@techmahindra.com>: > Hi, > > I have just started scratching my head with Camel and infact with JMS as > well; you can consider me naive and curious on this subject. > > I have setup a JMS queue on a glassfish server on my local PC. The > galssfish > logs tells me that JMS is active on URI mq://localhost:7676. My connection > facotry is named jms/tConnectionFactory and destination queue is named > jms/tQueue. I am configuring my route as follows: > > > from("file:/data/inbox?noop=false").to("jms:queue:mq://localhost:7676/jms/tQueue?connectionFactory=jms/tConnectionFactory&mapMessage=false"); > > Whenever I run this code I am getting an error message (stack trace below) > which tells me that JMS ConnectionFacotry has to be set properly. Googling > is not heping me in finding a method to set this properly. > > Can anyone help me in providing a way forward on how to set my connection > facotry to enable the mentioned routing. > > Stack trace ........... > > [ main] root INFO > Starting Context > [ main] DefaultCamelContext INFO > Apache > Camel 2.10.3 (CamelContext: camel-1) is starting > [ main] ManagementStrategyFactory INFO JMX > enabled. > [ main] DefaultTypeConverter INFO > Loaded > 175 type converters > [ main] DefaultCamelContext INFO > Apache > Camel 2.10.3 (CamelContext: camel-1) is shutting down > [ main] DefaultTypeConverter INFO > TypeConverterRegistry utilization[attempts=2, hits=2, misses=0, failures=0] > mappings[total=176, misses=0] > [ main] DefaultCamelContext INFO > Apache > Camel 2.10.3 (CamelContext: camel-1) is shutdown in 0.000 seconds. Uptime > 0.453 seconds. > Exception in thread "main" org.apache.camel.FailedToCreateRouteException: > Failed to create route route1 at: >>> > > To[jms:queue:mq://localhost:7676/jms/tQueue?connectionFactory=jms/tConnectionFactory&mapMessage=false] > <<< in route: Route[[From[file:/data/inbox?noop=false]] -> > [To[jms:queue:m... because of Failed to resolve endpoint: > > jms://queue:mq://localhost:7676/jms/tQueue?connectionFactory=jms%2FtConnectionFactory&mapMessage=false > due to: No bean could be found in the registry for: jms/tConnectionFactory > of type: javax.jms.ConnectionFactory > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:873) > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:171) > at > > org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:722) > at > > org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1789) > at > > org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1575) > at > > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1444) > at > org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60) > at > > org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1412) > at > com.mydemo.cameldemo.FileTransferDemo.main(FileTransferDemo.java:49) > Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to > resolve endpoint: > > jms://queue:mq://localhost:7676/jms/tQueue?connectionFactory=jms%2FtConnectionFactory&mapMessage=false > due to: No bean could be found in the registry for: jms/tConnectionFactory > of type: javax.jms.ConnectionFactory > at > > org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479) > at > > org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50) > at > > org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186) > at > > org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108) > at > > org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114) > at > > org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61) > at > > org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55) > at > > org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:461) > at > > org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179) > at > org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:870) > ... 8 more > Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in > the registry for: jms/tConnectionFactory of type: > javax.jms.ConnectionFactory > at > > org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:130) > at > > org.apache.camel.util.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:326) > at > > org.apache.camel.util.EndpointHelper.resolveReferenceParameter(EndpointHelper.java:308) > at > > org.apache.camel.impl.DefaultComponent.resolveAndRemoveReferenceParameter(DefaultComponent.java:304) > at > > org.apache.camel.impl.DefaultComponent.resolveAndRemoveReferenceParameter(DefaultComponent.java:283) > at > > org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:473) > at > > org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91) > at > > org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461) > ... 17 more > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Need-Help-with-JMS-setup-tp5726399.html > Sent from the Camel - Users mailing list archive at Nabble.com. >