Announcement Announcement Module
No announcement yet.
Spring with Eclipse RCP anyone? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    With all this said I definitely would LOVE to see Eclipse RCP integration on top of Spring, leveraging existing complimentary libraries of spring rich (such as the data binding stuff). But I wouldn't want to force spring rich users to HAVE to use eclipse's platform: in many cases it's just not necessary (particularly when a team already knows Swing, cares about platform independence, and doesn't want the complexity of the eclipse plugin model - yet another thing to configure...)
    I guess no-one would like to force someone to use JFace/SWT. But after all I like it anyway. What I am dreaming about is the databinding stuff. I just want an adapter or something alike to use some of the Spring Rich stuff by utilizing Eclipse RCP.

    But I guess we start to talk about unlayed eggs. We need an extense prototype or something real. You know, I guess you Spring RCP guys may provide a client demonstrating/integrating most of the of Spring RCP features, you think are horse-crazy (aka best). And then we Eclipse RCP maniacs will try to convert it using Eclipse. When this is done, we can see where to cut things and split the Spring RCP api. You know there should be something like a core-api and some special-apis for integrating it into either the Eclipse or Swing world.

    Or maybe the Spring RCP project may be split up into two projects targeting the diffrent platforms by not sharing code but sharing ideas, possibilities and so on.

    So the question is, is the Petclinic example that kind of comprehensive?

    Maybe we should wait for a main release of the Spring RCP project before doing further talks. Sometimes things must grow a bit more to talk about. But sadly I am not the right person to judge the matureness of the Spring RCP project.


    • #17
      I would go even further: have a base RCP library UI-independent, and a UI-dependent library tying it to the chosen UI, and make it pluggable, so if we would be able to use Spring RCP not only for Swing or Eclipse UIs, but also for XUL approaches and other UI frameworks. Right now I am evaluating Thinlet (, and it would help me a lot if I could leverage on APIs which are common (binding, command workflow, model, etc.), despite the UI I'd choose.

      Henrique Steckelberg


      • #18

        Can you describe a bit more in detail how you get access to your ApplicationContext and how you create your context?

        I have tried creating the context with the ClassPathXmlApplicationContext and it can't find my applicationContext.xml. Using the getResource method from the Bundle object finds the file just fine.

        I have also tried using the FileSystemXmlApplicationContext getting the file path from the Bundle object in eclipse. Using this setup Spring finds my application context, but none of the classes defined in the file.

        I suspect my problems are related to the classloading scheme in eclipse, but have so far not been able to get anything to work.
        Do you have any hints?
        Or anyone else?

        Ole P Aasen


        • #19
          Solution but more questions.

          I got it... But a question for the spring team

          After digging a bit into Eclipse and Spring classloading this weekend, I realised that Spring actually is quite flexible on this.

          Both the BeanDefinitionReader (which is responsible for loading the bean classes) and the ClassPathResource can be set to use the classloader of an already exisiting class.

          To get Spring to find my classes and resources, I extended the ClassPathXmlApplicationContext to set the beanClassLoader of the reader and to make the ClassPathResource use my classloader.

          This made things work better, but then I realised that the DriverManagerDataSource also loads classes, and that it does so using the current thread classloader. So I extended this as well.

          It actually turned out quite nice and small. No biggie. :-)

          My question now to anyone in the Spring team, is: why the inconsistent behavior? Why do you make it possible to set the classloader for the beans, but not the classloader for the classes the beans themself has to load.

          I for one would really like a bit more control over the classloader. Now I've got it in my own way, but it is a bit of a hack and depends a lot on the superclasses not changing. It would be nice to have this feature from the main distribution.

          (code available on demand)
          Ole P Aasen


          • #20
            I'm much interested in knowing how his is done code wise. I'm writing an app using eclipse RCP and I want to use spring for data and jms stuff. Please provide the code that shows how you got spring to work in an eclipse environment.


            • #21

              I too am desperate to see some sample code about using Spring from within Eclipse.

              Something like a Eclipse treeview bound to an Spring model would be excellent

              Even some basic code would be fantastic - has anyone seen any web pages with this sort of code? Any Sourceforge projects?



              • #22
                The code

                Sorry for the wait..

                I have now published what I have done on my webpage. You can find it at:

                Sorry to mjeaslea, I havn't got any code that binds it to a treeview yet, but I don't expect it to be to hard.

                Good luck.


                • #23
                  thanks for the code

                  Thank for posting the code, i've just downloaded it and started having a look.

                  What i'm wondering is the most approriate way to use the spring ApplicationContext object within my RCP product.

                  E.g. is it the Content Provider class in Eclipse that wraps around a set of calls to Spring?

                  Do you have any small samples that use the Alternative Classes you've provided?



                  • #24

                    The code could successfully load the config files, but all other resources required by the libraries failed to load...

                    My RCP is using ibatis and Spring. From the console I saw Spring could not find the SQL error code XML inside its spring.jar; the same problem happened when iBatis finding the DTD from its jar too.

                    Is there anyone successfully solved Eclipse's classloader problem with this AlternateClassPathXmlApplicationContext?

                    And BTW, I didn't use the Spring plugins; instead I have them placed at my project's lib. Is it the trick that made iBatis and Spring could not find resources from their own jar? :? Could you give me some hints on this?



                    • #25
                      I realise that this thread is old, but I thought I'd share a project I found for Eclipse RCP Spring integration:

                      I have yet to implement it - just found it an hour ago, but it looks promising. If anyone is using it, or has a found something else, I'd appreciate your comments.