PDA

View Full Version : Cannot add bundle project to AP server



Beta User
May 2nd, 2008, 08:53 AM
First of all, congratulations and thanks for what seems to be a very innovative project! I just deployed a non-trivial production application as a WAR file without any problems.

Now I'm trying to build and deploy my first OSGi bundle. I created a bundle project using the wizard, added the spring jars from my AP installation to the build path (to get rid of the warnings), selected AP as the target runtime, and configured my AP installation as a server (which I can control just fine from Eclipse).

But when I select "Add and Remove Projects..." from the server's context menu, all I get is an error message "There are no projects that can be added or removed from the server".

What am I missing?

Cheers,
-Ralph.

Beta User
May 2nd, 2008, 09:01 AM
Hello,
I've made a test, and I can tell this: If I add any jar file to the build path, I experience the same problem that you describe, i.e. the project is not shown in the list of projects to be added to the S2AP.

I guess that one should add the dependancies under the "Bundle Dependancies" Library. Yet, I cannot figure a way to add jars to this library :(
Still investigating though ...

robh
May 2nd, 2008, 09:07 AM
Chaps,

Christian Dupuis, the tools lead, is flying home to Vancouver as I type. I've flagged this topic in his email so expect an answer from him soon.

Thanks for trying this out.

Regards,

Rob

Beta User
May 2nd, 2008, 09:24 AM
Thanks, Rob!

For the record: I just created a PAR project using the wizard, added my bundle to par.xml as a dependency, and then the PAR showed up for deployment. Unfortunately, I cannot reproduce this..

Cheers,
-Ralph.

Beta User
May 2nd, 2008, 10:29 AM
Okey, I think I'm starting to grasp the thing:
I'll expose my understanding of the thing, so please correct me if I am wrong.

To add a 3rd party Bundle to a Bundle project, one should install that bundle in the S2AP repository (repository/bundles/usr) and just import the packages in the client Bundle.
The 'Dummy' Library added by S2AP Tooling (Bundle Dependencies) is there just to link to the AP repository.

Alright ? Is this how it should be done ?

Yet, I can't manage to make this work: I've downloaded the XStream jar (and the XML pull Bundle) from the S2 Repository and I've placed them in the usr dir. The corresponding package-names (com.thoughtworks.xstream.*) are not visible in the Import Package packages list :(

Beta User
May 2nd, 2008, 08:18 PM
Euh ... Actually, it's a bit more complicated than that.
As I explained in another post, matters are somewhat different in an Ubuntu Gutsy Gibbon 7.10 Machine (whereas the original test was on a Hardy Heron 8.04 one).

I can safely state that what I said in the former post is true: one must drop an OSGi-fied library in ${S2AP install dir}/repository/bundles/usr, and import the necessary packages in his Bundle Manifest, *without* using the Configure Build Path of Eclipse.
Okey, that works.

So, and to recenter the discussion around the original question raised by rpoellath, I guess I've come up with a solution: you should restart eclipse after creating a Bundle in order to be able to add it to the deployed projects of the S2AP (Right click on the S2AP Server, Add and Remove projects).

This is more a bug than a requirement, right ?
And should I open a JIRA issue about it ?

Christian Dupuis
May 2nd, 2008, 08:26 PM
Ralph,

apparently there is an issue that a project that is created by the SpringSource AP wizards is not available to be targeted to a runtime instance on some combinations of Eclipse and WTP. To make that project available for deployment please restart your Eclipse. That is just a temporally work-around. I'm looking into this.

If you have used the provided wizards to create a bundle project and targeted that project to a configured runtime by either deploying it on the server (if that works for you with the work-around) or by using the "Targeted Runtimes" project preferences page your classpath will contain a Classpath Container called "Bundle Dependencies" that will contain the resolved dependencies of your bundle, essentially resolved from your Import-Bundle, Import-Library and Import-Package headers.

Let me know if this works. Thanks for taking the time to report this issue here.

Christian

Christian Dupuis
May 2nd, 2008, 08:28 PM
Jawher, you were fasten than I. I'm really jet-lagged ;-)

> This is more a bug than a requirement, right?
> And should I open a JIRA issue about it?

Absolutely, please go ahead and open a bug report on that "restart required issue". I will follow on in JIRA.

Thanks,

Christian

Beta User
May 2nd, 2008, 08:38 PM
Done for the JIRA bug report:
https://issuetracker.springsource.com/browse/PLATFORM-2

Christian Dupuis
May 2nd, 2008, 09:06 PM
> Done for the JIRA bug report:
> https://issuetracker.springsource.com/browse/PLATFORM-2

Thanks for taking the time to file that. Let's follow on in JIRA.

Christian

Beta User
May 3rd, 2008, 11:15 AM
Christian, thanks for looking into this.

I can confirm that deployment works as expected after restarting Eclipse.

Cheers,
-Ralph.

Beta User
May 5th, 2008, 02:40 AM
>I can confirm that deployment works as expected after restarting Eclipse.
Same thing here: after updating the S2 Tool Suite, it works great.
Thanks Christian for the fast reaction :)