camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Whytock <dwhyt...@gmail.com>
Subject Re: type converter not loading
Date Fri, 25 Mar 2011 12:01:42 GMT
Is this a recent change?  I was able to use it with
camel-core-2.4.0.jar.  This stacktrace is a result of changing to
camel-core-2.6.0.jar.

The code is:

import org.apache.camel.impl.DefaultCamelContext;

public class ContextUtil
  {
  static org.apache.camel.CamelContext context = null;
  static org.apache.camel.ProducerTemplate template = null;

  public static org.apache.camel.CamelContext getContext()
    {
    if (context == null)
      {
      context = new DefaultCamelContext();
      try
        {
        context.start();
        }
      catch (Exception e)
        {
        // TODO Auto-generated catch block
        e.printStackTrace();
        }
      }
    return context;
    }

  public static org.apache.camel.ProducerTemplate getProducerTemplate()
    {
    if (template == null)
      {
      if (context == null)
        getContext();
      template = context.createProducerTemplate();
      }
    return template;
    }

  public static org.apache.camel.CamelContext newContext()
    { return new DefaultCamelContext(); }
  }



On Fri, Mar 25, 2011 at 4:31 AM, Willem Jiang <willem.jiang@gmail.com> wrote:
> Hi
>
> How did you start the DefaultCamelContext ?
> You can not use it directly in OSGi, you may consider to use
> CamelContextFactory instead.
>
> Willem
>
> On 3/25/11 5:59 AM, Donald Whytock wrote:
>>
>> Running Camel in an OSGi environment under Felix, with
>> camel-core-2.6.0.jar as a bundle.  I'm getting a stacktrace when I try
>> to call start() on the DefaultCamelContext singleton I'm generating.
>>
>> Is there some other bundle I need to install?
>>
>> Thanks...
>>
>> Don
>>
>> 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.component.file,
>> org.apache.camel.component.bean, org.apache.camel.converter]
>>        at
>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:971)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:986)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:1911)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1403)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1321)
>>        at
>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)
>>        at
>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1299)
>>        at org.chatterbot.camel.ContextUtil.getContext(ContextUtil.java:17)
>>        at
>> org.chatterbot.sender.SenderActivator$SenderServiceImpl.start(Unknown
>> Source)
>>        at
>> org.chatterbot.servicefactory.GenericActivator$GenericFactoryImpl.makeService(GenericActivator.java:173)
>>        at
>> org.chatterbot.servicefactory.GenericActivator$GenericFactoryImpl.makeServices(GenericActivator.java:157)
>>        at
>> org.chatterbot.servicefactory.GenericActivator.startFactory(GenericActivator.java:122)
>>        at
>> org.chatterbot.servicefactory.GenericActivator.start(GenericActivator.java:107)
>>        at org.chatterbot.sender.SenderActivator.start(Unknown Source)
>>        at
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
>>        at org.apache.felix.framework.Felix.activateBundle(Felix.java:1835)
>>        at org.apache.felix.framework.Felix.startBundle(Felix.java:1752)
>>        at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1156)
>>        at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>        at java.lang.Thread.run(Unknown Source)
>> 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.component.file,
>> org.apache.camel.component.bean, org.apache.camel.converter]
>>        at
>> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:77)
>>        at
>> org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:395)
>>        at
>> org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:41)
>>        at
>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)
>>        at
>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>>        at
>> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.startServices(DefaultCamelContext.java:1593)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:884)
>>        at
>> org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:969)
>>        ... 20 more
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>

Mime
View raw message