Announcement Announcement Module
No announcement yet.
Using a createld plugin bundle by STS in an eclipse-osgi context Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using a createld plugin bundle by STS in an eclipse-osgi context


    I have created a Plug-in by STS to use a MySql Database. I want to use this in as a bundle in Eclipse(3.6) in an equinox framework with the rest of my osgi bundles. I have exported the plugin project in STS and i have clicked the "Use compiled class files in workspace" option (if i dont do that STS dont find the required imports while exporting).

    After this is done I use this bundle in Eclipse but when i try to use it I get an error with NoClassFoundException. I can solve this error adding another bundle with the corresponding class (or package) wrapped, but I get again another NoClass.. expection with another class, again I can solve it but obviously the chain is too long and this is not a good way.

    My question is, what have I to add in Eclipse to solve this problem and work with a plugin generated in STS? Is There any kind of spring-core bundle that has this dependencies solved in order to run it in Eclipse and solve it??..........

    Last edited by janorga; Aug 1st, 2011, 07:40 AM.

  • #2

    I am not sure that I understand the issue correctly. You are implementing and exporting a plugin project for Eclipse using STS? So you have a normal plugin project within STS (nothing Spring specific so far) and wanna export this as a deployable plugin/feature? This sounds pretty much like a general plugin development question using Eclipse or did I miss something? And what exactly is not working? The export of the plugin? I think I need some more details here to help... :-)



    • #3
      I use STS and Helios Eclipse separately, and the thing is that i have a project in eclipse running in an OSGI environment (Equinox) with several bundles created on my own. Well until this, it is all fine and working. Now I want to manipulate a MySql database into my Equinox environment. The objective is can use the Roo power to implement the code fast. I make a project in STS to operate with the database and I convert it to plugin project. Then I export it with the option "use classfiles compiled in workspace" and I obtain a .jar file. The issue is to use that .jar in my equinox project. I mean, for example, one bundle wants to acces one field in Database and it uses the exported .jar roo bundle.

      When I mount this and run it in Equinox, an error appears saying typical NoClassFoundException... provocated by the using of this new bundle code (callings to objects that belong to my new bundle). If I do all by this way, the new bundle needs internally a lot of imports by other spring bundles to use it in an OSGI environment.

      My question is how to solve this. How to make my bundle/proyect in roo to work with my proyect in equinox.


      • #4
        Hi again,

        I think i have done some more. I have found this: and i have followed all steps. After this, i have two errors. One I think it is provided by eclipse/equinox, cause it is in black letters, that the main thing says "java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.Configur ableObject" and another from bundles from Spring ,cause it is in red letters, that i think the main thing is "Type filter class not found: org.springframework.stereotype.Controller" although the last class is provided by one plugin added in the explaination of the first link, it is provided by "org.springframework.bundle.spring.context". If I try to put directly org.springframework.stereotype.Controller in the imported packages of my new bundle (which imported list is now empty), the error from spring (red letters)change and say "Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace []".

        This is a mess........

        Thanks again!!
        Last edited by janorga; Aug 2nd, 2011, 08:27 AM.


        • #5
          I think using Spring Roo to implement an OSGi bundle/Eclipse plugin is not a very common thing people do, therefore you are hitting a somewhat very and not easy to go path, I think... :-)

          As far as I know Spring Roo projects make quite heavy use of aspects to implement things and it is not easy to set this up for an Eclipse plugin project. You could try this, but I refer you to the AJDT users mailing list to get more advice on this, if you wanna go this way.

          The error message you are seeing sound like missing dependencies from your bundle. Does your bundle project define the dependencies to those packages in the MANIFEST.MF? And do you have a bundle installed in your target OSGi runtime that exports this package? You might need to provision the Spring bundles into your Eclipse runtime as bundles, etc.



          • #6
            Ok, I have imported in eclipse the necesary spring bundles to run it as it says in the link i have posted before. I use bundles from Spring OSGi 1.1.2. but i dont have clear which dependcencies are needed and what spring things my bundle have to import in its manifiest list.


            • #7
              Your bundle need to import all the packages that it is using and not providing itself.

              But if you wanna setup a spring application context within that bundle and use Spring DM to create this for you at runtime, you may also need to import several other packages that are used by Spring via the application context.

              BTW, the successor of the Spring DM project is here:
              You might consider asking questions about using this in an Eclipse application there.



              • #8
                Okay, i will try it.

                Thanks a lot!!