I was playing around with Spring DM and a minimal OSGi container setup. For startup I decided to try the fileinstall bundle that Peter Kriens has on his blog pages. It works great - it may not be good for production ready things, but it is a good way to start and stop bundles merely by dropping them in or deleting them from a directory.
But starting Spring DM 1.1.2 this way is not working, and I don't understand why. First, I started off with a set of bundles that all start normally, leaving out the extender bundle. This is the list:
[ see attached status.txt]
Bundle 1 is the fileinstall bundle, and it gets started with the config.ini as follows:
osgi.bundles=fileinstall-1.3.4.jar@3:start
eclipse.ignoreApp=true
osgi.noShutdown=true
aQute.fileinstall.dir=./plugins
The other 40 bundles are in the plugins directory. So far so good, everything starts normally with no problems.
Now dropping the extender bundle (org.springframework.bundle.osgi.extender_1.1.2) into the plugins folder causes the fileinstall bundle to attempt to install it, resolve it and start it. But it fails to start. It logs messages like this over and over:
TRACE 2008-11-10 14:36:40,115 [{aQute.fileinstall.dir=./plugins}] org.springframework.core.CollectionFactory - Creating [java.util.concurrent.ConcurrentHashMap]
INFO 2008-11-10 14:36:40,118 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.activat or.ContextLoaderListener - Starting [org.springframework.bundle.osgi.extender] bundle v.[1.1.2]
DEBUG 2008-11-10 14:36:40,124 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.activat or.ContextLoaderListener - Spring-DM v.[1.1.2] is wired to Spring core bundle org.springframework.bundle.spring.core version [2.5.5]
TRACE 2008-11-10 14:36:40,129 [{aQute.fileinstall.dir=./plugins}] org.springframework.core.CollectionFactory - Creating [java.util.concurrent.ConcurrentHashMap]
WARN 2008-11-10 14:36:40,150 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle spring-jms (org.springframework.bundle.spring.jms) cannot see class [org.springframework.beans.factory.xml.NamespaceHan dlerResolver]; ignoring its namespace handlers
DEBUG 2008-11-10 14:36:40,150 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle [spring-jms (org.springframework.bundle.spring.jms)] declares namespace handlers but is not compatible with extender [org.springframework.bundle.osgi.extender|1.1.2]; ignoring...
DEBUG 2008-11-10 14:36:40,162 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Adding namespace handler resolver for spring-osgi-core (org.springframework.bundle.osgi.core)
DEBUG 2008-11-10 14:36:40,163 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespacePlugins - Adding as handler spring-osgi-core (org.springframework.bundle.osgi.core)
WARN 2008-11-10 14:36:40,186 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle spring-aop (org.springframework.bundle.spring.aop) cannot see class [org.springframework.beans.factory.xml.NamespaceHan dlerResolver]; ignoring its namespace handlers
DEBUG 2008-11-10 14:36:40,186 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle [spring-aop (org.springframework.bundle.spring.aop)] declares namespace handlers but is not compatible with extender [org.springframework.bundle.osgi.extender|1.1.2]; ignoring...
WARN 2008-11-10 14:36:40,190 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle spring-tx (org.springframework.bundle.spring.tx) cannot see class [org.springframework.beans.factory.xml.NamespaceHan dlerResolver]; ignoring its namespace handlers
DEBUG 2008-11-10 14:36:40,192 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Bundle [spring-tx (org.springframework.bundle.spring.tx)] declares namespace handlers but is not compatible with extender [org.springframework.bundle.osgi.extender|1.1.2]; ignoring...
DEBUG 2008-11-10 14:36:40,210 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Adding namespace handler resolver for spring-context (org.springframework.bundle.spring.context)
DEBUG 2008-11-10 14:36:40,211 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespacePlugins - Adding as handler spring-context (org.springframework.bundle.spring.context)
DEBUG 2008-11-10 14:36:40,214 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Adding namespace handler resolver for spring-beans (org.springframework.bundle.spring.beans)
DEBUG 2008-11-10 14:36:40,214 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespacePlugins - Adding as handler spring-beans (org.springframework.bundle.spring.beans)
DEBUG 2008-11-10 14:36:40,215 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .NamespaceManager - Registering Spring NamespaceHandlerResolver and EntityResolver...
INFO 2008-11-10 14:36:40,230 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .ExtenderConfiguration - No custom extender configuration detected; using defaults...
INFO 2008-11-10 14:36:40,236 [{aQute.fileinstall.dir=./plugins}] org.springframework.scheduling.timer.TimerTaskExec utor - Initializing Timer
DEBUG 2008-11-10 14:36:40,243 [{aQute.fileinstall.dir=./plugins}] org.springframework.osgi.extender.internal.support .ExtenderConfiguration - Spring-DM annotation processing disabled; [org.springframework.osgi.extensions.annotation.Ser viceReferenceDependencyBeanFactoryPostProcessor] not loaded
Since the fileinstall bundle attempts to restart the spring extender every 2 seconds this message is repeated. So I stop the fileinstall bundle and the extender is left in a RESOLVED state. Now attempting to start the extender with:
start 42
yields more errors like this:
[see attached exception.txt]
Any idea why this is happening?
Thanks!
-Don



