-
1. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
ffang Mar 6, 2013 8:43 PM (in response to wl880504)Hi,
You need ensure all dependencies are already OSGi bundles, if not, OSGi-fy it first.
And the slf4j stuff already answered you in another thread.
http://fusesource.com/forums/thread.jspa?threadID=4676
Freeman
-
2. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
wl880504 Mar 6, 2013 9:19 PM (in response to ffang)Thanks Freeman.
Now I am thinking of another way to do it. The Floodlight.jar generated in the Maven target works good before deploying to Fuse esb. All its dependencies are stored in .m2 repository. So when I try to deploy it by:
osgi:install file:Dir/to/floodlight.jar
Is there a way to specify each location of its dependencies? Like:
osgi:install file:Dir/to/floodlight.jar /home/usr/.m2/org/apache/dependency1 /home/usr/.m2/org/google/dependency2
So Fuse esb can search its dependencies in .m2 repository instead of asking me to deploy each dependency to Fuse esb.
-
3. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
ffang Mar 6, 2013 9:35 PM (in response to wl880504)Hi,
You do need deploy each bundle into FUSE ESB anyway, though FUSE ESB will look for those bundles from your maven local repo.
You can use features.xml which help to make it easier for you.
Freeman
-
4. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
wl880504 Mar 6, 2013 11:15 PM (in response to ffang)Hi Freeman,
I am thinking another tricky:
Suppose the Floodlight.jar bundle has two dependencies: A and B. I copy A and B from .m2 repository to Floodlight/lib folder. Then in eclipse Floodlight/lib folder right click on A -> Build Path -> Add to Build Path and the same to B. Then in Floodlight pom.xml, delete A and b. Run mvn install to create floodlight.jar bundle in target folder.
Next deploy floodlight.jar bundle to Fuse esb container. At this time, A and B are already included in floodlight.jar, so I do not need to deploy the dependency A and B to Fuse esb.
What do you think?
-
5. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
ffang Mar 6, 2013 11:32 PM (in response to wl880504)Hi,
No, embed lib isn't good practice in OSGi world, you should install bundles separately.
Freeman
-
6. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
wl880504 Mar 12, 2013 8:38 PM (in response to ffang)Hi Freeman,
If you have time, can you help me deploy this maven project floodlight to osgi container? I struggled for two weeks, but still failed.
These days, I have tried to use <embed-dependency> with maven-bundle-plugin. This generates a single bundle with all dependencies included. When I deploy it to OSGi, got error: unresolved constraint - missing requirement
Or can you give me your email? I can send some experiments documents to you to have a look.
Thanks
-
7. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
ffang Mar 12, 2013 9:01 PM (in response to wl880504)Hi,
If you have fuse subscription, I suggest you contact us through that channel.
Freeman
-
8. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
wl880504 Mar 12, 2013 9:15 PM (in response to ffang)Right now I dont have one. Do I need to pay for this service?
-
9. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
davsclaus Mar 13, 2013 5:45 AM (in response to wl880504)Hi
Have you tried deploying your project with FAB
http://www.davsclaus.com/2012/08/osgi-deployment-made-easy-with-fab.html
FAB is designed to take out the OSGi deployment pain, and just develop your project as a plain maven project.
Though there may be some edge-cases where FAB also comes short. As at the end its all running in the OSGi container (there is no escape from OSGi).
I suggest to take a look at those links form the blog post above. Otherwise you can spend weeks and weeks trying to get your project working as a pure OSGi, and that is really hard. Its not you, its really IMHO the OSGi deployment model that is way way to complicated for the common man. In advanced use-cases it rocks, but for the average projects people do, its way to complicated currently. Notice that this last paragraph is my own opinion!
-
10. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
wl880504 Mar 13, 2013 5:21 PM (in response to davsclaus)I did not give a try with FAB. I am really exhausted with handling maven project with osgi container. I hope this FAB can help me.
-
11. Re: OSGi dependency issue - need help in deploying maven bundle to OSGi contain
davsclaus Mar 14, 2013 3:40 AM (in response to wl880504)An alternative is to deploy your project as a WAR (eg web archive) as that is supported as well in Fuse ESB. Then you do not need to fight the OSGi dependency battle. Though as a WAR its an isolated deployment unit.
For example the Servlet Tomcat example from Apache Camel is a WAR, and is deployable in Fuse ESB
http://camel.apache.org/servlet-tomcat-example.html
Though if you use the shell to deploy you need to use the war url handler