Did you need camel-scala component ?
If not, you can just remove camel-scala from your class path.

On Mon Dec  5 14:38:33 2011, 玉峰 wrote:
To start Camel as a standalone application, Why is there the following error?
It does not support starting Camel as a standalone application?

Exception in thread "main" org.apache.camel.RuntimeCamelException: 
org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: 
Cannot find any type converter classes from the following packages: 
[org.apache.camel.scala.converter.ScalaTypeConverter]
  at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1164)
  at 
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:988)
  at 
org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:1003)
  at 
org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:1963)
  at 
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1437)
  at 
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1349)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
  at 
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1317)
  at org.apache.camel.Main.doStart(Main.java:61)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
  at org.apache.camel.impl.MainSupport.run(MainSupport.java:136)
  at MainExample.boot(MainExample.java:28)
  at MainExample.main(MainExample.java:15)
Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load type 
converters because of: Cannot find any type converter classes from the 
following packages: [org.apache.camel.scala.converter.ScalaTypeConverter]
  at 
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:116)
  at 
org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:406)
  at 
org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:42)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
  at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
  at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:56)
  at 
org.apache.camel.impl.DefaultCamelContext.startServices(DefaultCamelContext.java:1635)
  at 
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:903)
  at 
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:986)
  ... 13 more

//-------------Java code--------------
public class MainExample {
     private Main main;
     public static void main(String[] args) throws Exception {
         MainExample example = new MainExample();
         example.boot();
     }
     public void boot() throws Exception {
         // create a Main instance
         main = new Main();
         // enable hangup support so you can press ctrl + c to terminate the JVM
         main.enableHangupSupport();
         // add routes
         main.addRouteBuilder(new MyRouteBuilder());
         // run until you terminate the JVM
         System.out.println("Starting Camel. Use ctrl + c to terminate the 
JVM.\n");
         main.run();
     }
     private static class MyRouteBuilder extends RouteBuilder {
         @Override
         public void configure() throws Exception {
             from("timer:foo?delay=2000")
                 .process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         System.out.println("Invoked timer at " + new Date());
                     }
                 });
         }
     }
}





--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply via email to