One approach may be to use the JNDI integration. Although I haven't tried this myself.
Another approach would be just to deploy this as a camel bundle and avoid the JBI classloading issues and instead just import the OSGi packages directly into your bundle.
Thanks for the response.
I'm not sure what you mean by "camel bundle". Is there some where you can point me to learn more about this? Is there a sample that uses this strategy?
Have a look at the camel-osgi demo, you can see the route defined in Spring:
You could route from the jetty endpoint to your bean and achieve the same thing as you do in the JBI world.
There's some really good getting started videos here on the site.
Edited by: martinmurphy on Dec 15, 2009 4:06 PM
I think you may misunderstand what I'm asking. My problem has to do with packaging and deployment - I just don't get the whole OSGi thing.
I actually have seen the video page before and in fact, I based my prototype on the ESB Getting Started video. The problem is, my SE isn't just a simple POJO that takes in and outputs internally defined classes. I want it to do a lot more, in particular, use Hibernate to persist data.
How do I bundle that up? I've done some more looking into the maven felix plugin. I see that I can declare packages that get exported into the final bundle. So, do I sit there and try to list all the Hibernate packages, all the packages it depends on, and the packages those packages depend on, etc. eventually ending up with a 20 meg+ bundle that gets deployed to the ESB? I'm actually not so much worried about the size as I am about having to figure out and list all the dependent packages in the maven-felix plugin.
Is there some easier way to do this that I am missing?
I'm sorry you are trying to get the benefit from OSGi (ServiceMix4) but still using Old JBI (ServiceMix3) package.
You can use camel as bundle to route out the Request from JBI layer and leverage Camel-JPA to do the persistence work for your.
Here is an example which is coming with Apache Camel 2.2-SNAPSHOT I just managed to deploy it into ServiceMix(Karaf) recently, you can take a look at the instruction in JIRA and try it in coming up Fuse ESB 4.1.