Anyone have an opinion about this? Shall I create a JIRA ticket? /Benke
2010/11/17 Bengt Rodehav <[email protected]> > I've encountered some problems regarding starting Camel. I use Camel 2.5.0. > I also use iPOJO in Karaf to create OSGi services. When my iPOJO instance > becomes valid, my callback method is started and I try to create a Camel > context and start it. > > However, even if I fail to start Camel, no exception is thrown which causes > me problems later on. When looking through the code it seems like an > exception is caught but not rethrown in DefaultCamelContext.doStartCamel() > on line 1270. Is this "as designed" or a bug? I would really like an > exception to be thrown at this point to allow me to know whether I succeeded > in starting the context or not. > > In my particular case, I have erroneously set the name of the camel context > to null. > > The exception I get is the following: > > 2010-11-17 11:32:34,456 | WARN | guration Updater | DefaultCamelContext > | e.camel.impl.DefaultCamelContext 1278 | Cannot start lifecycle > strategy: > org.apache.camel.management.defaultmanagementlifecyclestrat...@1060ee9.this > strategy will be removed. Cause: java.lang.NullPointerException > org.apache.camel.RuntimeCamelException: java.lang.NullPointerException > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1140) > at > org.apache.camel.management.DefaultManagementLifecycleStrategy.onContextStart(DefaultManagementLifecycleStrategy.java:161) > at > org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1270) > at > org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1213) > 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:1191) > at > se.digia.connect.core.service.RouteServiceBase.doStart(RouteServiceBase.java:51) > at se.digia.connect.core.service.ServiceBase.start(ServiceBase.java:50) > at > se.digia.connect.services.skandia.filetransfer.FileTransferService.__start(FileTransferService.java:63) > at > se.digia.connect.services.skandia.filetransfer.FileTransferService.start(FileTransferService.java) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_07] > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_07] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_07] > at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_07] > at > org.apache.felix.ipojo.util.Callback.call(Callback.java:237)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.util.Callback.call(Callback.java:193)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallback.call(LifecycleCallback.java:86)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.__stateChanged(LifecycleCallbackHandler.java:162)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler.stateChanged(LifecycleCallbackHandler.java)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:441)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:322)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.InstanceManager.reconfigure(InstanceManager.java:1169)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.IPojoFactory.reconfigure(IPojoFactory.java:481)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.ipojo.IPojoFactory.updated(IPojoFactory.java:648)[77:org.apache.felix.ipojo:1.7.0.SNAPSHOT] > at > org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1460)[5:org.apache.felix.configadmin:1.2.4] > at > org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:88)[5:org.apache.felix.configadmin:1.2.4] > Caused by: java.lang.NullPointerException > at javax.management.ObjectName.quote(ObjectName.java:1846)[:1.6.0_07] > at > org.apache.camel.management.DefaultManagementNamingStrategy.getObjectNameForCamelContext(DefaultManagementNamingStrategy.java:95) > at > org.apache.camel.management.DefaultManagementLifecycleStrategy.onContextStart(DefaultManagementLifecycleStrategy.java:128) > ... 25 more > > /Bengt >
