[ 
https://issues.apache.org/activemq/browse/CAMEL-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51350#action_51350
 ] 

Willem Jiang commented on CAMEL-1529:
-------------------------------------

Since spring provides OSGi bundle after Spring 2.5.5, and  JmsConfiguration 
uses PackageHelper to check if the Spring version upper than 2.5.1.
 I'd like to add check of Null Point in  PackageHelper to walk around this 
issue.

> PackageHelper.isValidVersion NPE in osgi
> ----------------------------------------
>
>                 Key: CAMEL-1529
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1529
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-osgi
>         Environment: osgi - Equinox 3.4.2
> org.apache.activemq/activemq-core/5.2.0
> org.apache.activemq/activemq-camel/5.2.0
> org.apache.activemq/activemq-pool/5.2.0
> org.apache.camel/camel-core/2.0-SNAPSHOT
> org.apache.camel/camel-jms/2.0-SNAPSHOT
> org.apache.camel/camel-spring/2.0-SNAPSHOT
> org.apache.camel/camel-osgi/2.0-SNAPSHOT
>            Reporter: Cameron Braid
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.1.0
>
>
> [    SpringOsgiExtenderThread-4] PackageHelper                  DEBUG Failed 
> to find out org.springframework.jms version: java.lang.NullPointerException
> java.lang.NullPointerException
>       at 
> org.apache.camel.util.PackageHelper.isValidVersion(PackageHelper.java:47)
>       at 
> org.apache.camel.component.jms.JmsConfiguration.defaultCacheLevel(JmsConfiguration.java:1036)
>       at 
> org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:942)
>       at 
> org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:417)
>       at 
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:161)
>       at 
> org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:51)
>       at 
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
>       at org.apache.camel.Route.getServicesForRoute(Route.java:74)
>       at org.apache.camel.impl.RouteService.doStart(RouteService.java:77)
>       at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
>       at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:773)
>       at 
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:94)
>       at 
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:113)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>       at 
> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>       at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>       at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>       at 
> org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>       at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
>       at 
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>       at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
>       at 
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)
>       at java.lang.Thread.run(Thread.java:619)
> isValidVersion fortunately returns true when an exception occurs, so it gets 
> passed this check anyway.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to