Hi,
From the bundle list, I can see you didn't correctly understand my
suggestion.
I suggest you create fragment bundle for postgresql jdbc driver and
attachment it to spring-jdbc bundle(play the role as host bundle),
So
[ 246] [Active ] [ ] [ ] [ 60]
wrap_mvn_postgresql_postgresql_8.2-504.jdbc3 (0)
shouldn't be here at all.
Also you can't start a fragment bundle, the expected status for
fragment bundle is "Resolved", you may need refresh the host(spring-
jdbc) bundle here after you install the fragment bundle to pick the
fragment bundle up.
The correct pair of fragment/host bundle should looks like
[ 45] [Active ] [Created ] [ ] [ 60] activemq-core
(5.5.1.fuse-01-06)
Fragments: 62
[ 62] [Resolved ] [ ] [ ] [ 60] activemq-
blueprint (5.5.1.fuse-01-06)
Hosts: 45
Here 45 is host bundle and 62 is fragment bundle.
If you think create a fragment bundle is too hard for you now you can
consider to use
Option2. enable dynamic import for spring-jdbc I mentioned before,
from console do "dynamic-import spring-jdbc-id", this can also make
postgresql driver package available for the spring-jdbc.
Freeman
On 2011-11-23, at 上午3:43, bmccabe wrote:
Hi Ioannis, Thanks for responding. I added the import-package just
to see if
it would help. Also, if I try to start the bundle fragment it says
it's not
allowed. I assume that's as expected.
Here's the last 3 lines of the osgi:list output:
[ 246] [Active ] [ ] [ ] [ 60]
wrap_mvn_postgresql_postgresql_8.2-504.jdbc3 (0)
[ 273] [Installed ] [ ] [ ] [ 60] Camel Blueprint
Postgresql Fragment Bundle (0.9.10)
[ 274] [Active ] [Failure ] [ ] [ 60] Apache
ServiceMix ::
Features :: Examples :: Camel Blueprint JDBC (4.3.0)
Here's the packages:exports output (if I uninstall bundle 246 the
command
then it returns nothing):
karaf@root> packages:exports | grep org.postgresql
246 org.postgresql
246 org.postgresql.core
246 org.postgresql.core.types
246 org.postgresql.core.v2
246 org.postgresql.core.v3
246 org.postgresql.ds
246 org.postgresql.ds.common
246 org.postgresql.ds.jdbc23
246 org.postgresql.fastpath
246 org.postgresql.geometric
246 org.postgresql.jdbc2
246 org.postgresql.jdbc2.optional
246 org.postgresql.jdbc3
246 org.postgresql.largeobject
246 org.postgresql.ssl
246 org.postgresql.translation
246 org.postgresql.util
246 org.postgresql.xa
When I try to start the bundle (274) in the karaf console, I don't
get any
feed back, it just returns the prompt with no log output. When I
redeploy
the bundle I get this as log output:
13:57:35,202 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 1 @Converter
classes to
load
13:57:35,203 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 1 @Converter
classes to
load
13:57:35,204 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 2 @Converter
classes to
load
13:57:35,212 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 13 @Converter
classes to
load
13:57:35,217 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 1 @Converter
classes to
load
13:57:35,219 | INFO | rint Extender: 2 |
Activator |
68 - org.apache.camel.camel-core - 2.6.0 | Found 0 @Converter
classes to
load
13:57:35,219 | INFO | rint Extender: 2 |
BlueprintCamelContext |
68 - org.apache.camel.camel-core - 2.6.0 | JMX enabled. Using
ManagedManagementStrategy.
13:57:35,220 | INFO | rint Extender: 2 |
BlueprintCamelContext |
68 - org.apache.camel.camel-core - 2.6.0 | Apache Camel 2.6.0
(CamelContext:
275-camel-131) is starting
13:57:35,376 | INFO | rint Extender: 2 |
BlueprintCamelContext |
68 - org.apache.camel.camel-core - 2.6.0 | Apache Camel 2.6.0
(CamelContext:275-camel-131) is shutting down
13:57:35,376 | INFO | rint Extender: 2 |
DefaultShutdownStrategy |
68 - org.apache.camel.camel-core - 2.6.0 | Starting to graceful
shutdown 0
routes (timeout 300 seconds)
13:57:35,377 | INFO | rint Extender: 2 |
DefaultShutdownStrategy |
68 - org.apache.camel.camel-core - 2.6.0 | Graceful shutdown of 0
routes
completed in 0 seconds
13:57:35,377 | INFO | rint Extender: 2 |
DefaultInflightRepository |
68 - org.apache.camel.camel-core - 2.6.0 | Shutting down with no
inflight
exchanges.
13:57:35,377 | INFO | rint Extender: 2 |
BlueprintCamelContext |
68 - org.apache.camel.camel-core - 2.6.0 | Uptime: 0.157 seconds
13:57:35,377 | INFO | rint Extender: 2 |
BlueprintCamelContext |
68 - org.apache.camel.camel-core - 2.6.0 | Apache Camel 2.6.0
(CamelContext:
275-camel-131) is shutdown in 0.001 seconds
13:57:35,378 | ERROR | rint Extender: 2 |
BlueprintContainerImpl |
7 - org.apache.aries.blueprint - 0.2.0.incubating | Unable to start
blueprint container for bundle camel-blueprint-jdbc
org.osgi.service.blueprint.container.ComponentDefinitionException:
Unable to
intialize bean camel-129
at
org
.apache
.aries
.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:635)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:
744)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:
64)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintRepository.createInstances(BlueprintRepository.java:219)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintRepository.createInstance(BlueprintRepository.java:198)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container.BlueprintRepository.create(BlueprintRepository.java:137)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintContainerImpl
.getComponentInstance(BlueprintContainerImpl.java:702)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org.apache.camel.blueprint.handler.CamelNamespaceHandler
$CamelDependenciesFinder.process(CamelNamespaceHandler.java:499)
[76:org.apache.camel.camel-blueprint:2.6.0]
at
org
.apache
.aries
.blueprint
.container
.BlueprintContainerImpl
.processProcessors(BlueprintContainerImpl.java:479)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:
299)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:
213)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
471)[:1.6.0_20]
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:
1.6.0_20]
at
java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.6.0_20]
at
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
[:1.6.0_20]
at
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)[:
1.6.0_20]
at
java
.util
.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)[:1.6.0_20]
at
java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)[:1.6.0_20]
at java.lang.Thread.run(Thread.java:636)[:1.6.0_20]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
create
route route44 at: >>> To[jdbc:pgdb] <<< in route:
Route[[From[timer://myTimer?fixedRate=true&period=5000]] -> ...
because of
Failed to resolve endpoint: jdbc://pgdb due to:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error
setting property: PropertyDescriptor <name: driverClassName, getter:
null,
setter: [public void
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource.setDriverClassName(java.lang.String)]
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
759)
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
160)
at
org
.apache
.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:
701)
at
org
.apache
.camel
.impl
.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:
1623)
at
org
.apache
.camel
.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1412)
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
.apache
.camel
.blueprint
.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:77)
at
org
.apache
.camel
.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)[:1.6.0_20]
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:
1.6.0_20]
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_20]
at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_20]
at
org
.apache
.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:
221)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:
844)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:633)
[7:org.apache.aries.blueprint:0.2.0.incubating]
... 18 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: jdbc://pgdb due to:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error
setting property: PropertyDescriptor <name: driverClassName, getter:
null,
setter: [public void
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource.setDriverClassName(java.lang.String)]
at
org
.apache
.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:
449)
at
org
.apache
.camel
.util
.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47)
at
org
.apache
.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:175)
at
org
.apache
.camel
.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:
110)
at
org
.apache
.camel
.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:
116)
at
org
.apache
.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:64)
at
org
.apache
.camel.model.SendDefinition.createProcessor(SendDefinition.java:58)
at
org
.apache
.camel
.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:403)
at
org
.apache
.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:
174)
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
756)
... 35 more
Caused by: org.apache.camel.RuntimeCamelException:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error
setting property: PropertyDescriptor <name: driverClassName, getter:
null,
setter: [public void
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource.setDriverClassName(java.lang.String)]
at
org
.apache
.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:
1139)
at
org
.apache
.camel
.impl
.PropertyPlaceholderDelegateRegistry
.lookup(PropertyPlaceholderDelegateRegistry.java:56)
at
org
.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:
105)
at
org
.apache
.camel
.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:123)
at
org
.apache
.camel
.component.jdbc.JdbcComponent.createEndpoint(JdbcComponent.java:49)
at
org
.apache
.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
at
org
.apache
.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:
431)
... 44 more
Caused by:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error
setting property: PropertyDescriptor <name: driverClassName, getter:
null,
setter: [public void
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource.setDriverClassName(java.lang.String)]
at
org
.apache
.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:
827)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:
793)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:
774)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:
740)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:
64)[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintRepository.createInstances(BlueprintRepository.java:219)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintRepository.createInstance(BlueprintRepository.java:198)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container.BlueprintRepository.create(BlueprintRepository.java:137)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.aries
.blueprint
.container
.BlueprintContainerImpl
.getComponentInstance(BlueprintContainerImpl.java:702)
[7:org.apache.aries.blueprint:0.2.0.incubating]
at
org
.apache
.camel
.blueprint
.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:43)
at
org
.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47)
at
org
.apache
.camel
.impl
.PropertyPlaceholderDelegateRegistry
.lookup(PropertyPlaceholderDelegateRegistry.java:54)
... 49 more
Caused by: java.lang.IllegalStateException: Could not load JDBC
driver class
[org.postgresql.Driver]
at
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource
.setDriverClassName(DriverManagerDataSource.java:150)
at sun.reflect.GeneratedMethodAccessor514.invoke(Unknown
Source)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_20]
at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_20]
at
org.apache.aries.blueprint.utils.ReflectionUtils
$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:416)
at
org.apache.aries.blueprint.utils.ReflectionUtils
$PropertyDescriptor.set(ReflectionUtils.java:302)
at
org
.apache
.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:
825)[7:org.apache.aries.blueprint:0.2.0.incubating]
... 60 more
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)[:
1.6.0_20]
at java.security.AccessController.doPrivileged(Native
Method)[:1.6.0_20]
at
java.net.URLClassLoader.findClass(URLClassLoader.java:205)[:1.6.0_20]
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)[:
1.6.0_20]
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)[:
1.6.0_20]
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:
1.6.0_20]
at java.lang.Class.forName0(Native Method)[:1.6.0_20]
at java.lang.Class.forName(Class.java:264)[:1.6.0_20]
at
org
.springframework
.jdbc
.datasource
.DriverManagerDataSource
.setDriverClassName(DriverManagerDataSource.java:147)
... 66 more
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Blueprint-postgresql-camel-jdbc-newbie-question-tp4994862p5014505.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com