Hi fachhoch, A few months ago I converted a Wicket & Spring app running on Tomcat have an OSGi running on Karaf. Basically the front-end Wicket stuff still thinks it's talking to vanilla Spring, with Spring bridging to the OSGi registry.
I couldn't get Hibernate to play nicely so first migrated to vanilla JPA, then changed the provider to EclipseLink (this was a fair bit of work on it's own, you might have better luck with Hibernate than I did). At this point you should be able to deploy your monolithic WAR (assuming your Jar is packed into the War) to the OSGi container (using the pax war handler). Then try to modularise (i.e. pull out a small Jar and convert to OSGi bundle) a service at a time - by changing your Spring config it'll happily pickup any OSGi services: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context " xmlns:task="http://www.springframework.org/schema/task" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> Your service references are then defined with: <osgi:reference cardinality="0..1" interface="my.corp.SomeService" id=" SomeService" /> The cardinality bit above is import as it allows Spring to rebind the service when you deploy an update. This approach *should* allow you to migrate in a piecemeal manner, I'm not certain you can mix the spring references as I didn't do it quite this way - so it might require a big bang migration of all services (this what I did). It wasn't a painless experience, but definitely worth it - we've a modular app that supports dynamic updates of backend services, and it starts much quicker. If you're using maven there's plenty of docs to help on the OSGi side; I used Declarative Services (using felix SCR annotations) and Felix's maven-bundle-plugin. I found Felix is a bit too bare metal for production use, Karaf uses an underlying framework (Felix/Equinox/..) but gives you a lot of stuff out of the box (SSH access, XML features, service scripts and a really nice OSGi shell). Good luck =) Caspar On 15 June 2011 16:12, fachhoch <[email protected]> wrote: > > I like the osgi approach of modifying modules without restarting the > server, I want to use this , and wondering If I can integrate apache felix > in my exsisting app, I have a web application built with wicket , spring , > hibernate , using pom , I have subprojects one for war and for jar , > please > suggest me are there any tutorials on integrating osgi into exisisting app > ? > is this kind of pluggable ? > > -- > View this message in context: > http://old.nabble.com/modifying-my-app-to-use-osgi-tp31852339p31852339.html > Sent from the Apache Felix - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

