RCP / Spring JPA - Need Example [message #461505] |
Wed, 10 January 2007 17:12  |
Eclipse User |
|
|
|
Originally posted by: shinglj.nationwide.com
Good Day All,
I would like to hook up Spring JPA (Toplink) to a simple RCP application I am developing.
I have a swing app that I am converting to RCP.
I used -javaagent:spring-agent.jar. When I added it to the launcher, . . . it appeared to ignore it.
So, I am looking for a very simple example. That I can pattern after. Can anyone help.
Thanks in advance.
Jim
|
|
|
Re: RCP / Spring JPA - Need Example [message #461538 is a reply to message #461505] |
Thu, 11 January 2007 12:23   |
Eclipse User |
|
|
|
Originally posted by: mbayly.telus.net
I had similar issues. I tracked it down to class loading issues with the InstrumentationSavingAgent. The instance of this class executed by the launcher saves off a copy of the java.lang.instrumentation.Instrumentation object using a static. However, when the InstrumentationSavingAgent is later loaded by Spring to set up the LoadTimeWeaver, it gets loaded by a different class loader hence the java.lang.instrumentation.Instrumentation object is not available.
To get around this I made sure there were no copies of InstrumentationSavingAgent in the other Spring Jars (I think there is a copy in spring.jar, but if you use the modular Spring jars in your RCP app e.g. spring-beans.jar, spring-core.jar etc you should be okay), and do not include spring-agent.jar in your spring plug-in that your app plug-ins are dependent on.
Then to make your app see the InstrumentationSavingAgent from spring-agent.jar referenced by your launcher you need to add an appropriate buddy policy to your spring/app plugin.
Eclipse-BuddyPolicy: app
I bundled the spring jars I needed as a separate plug-in which I then reference from my app, so I added the above buddy policy to my spring plug-in. However, if you are just including the spring jars in a single RCP App plugin then you would need to add it to your app plug-in's manifest.
Let me know if this doesn't work for you. There could be something else I've forgotten to mention.
I've been through a lot of hair pulling trying to get various aspects of Spring JPA to work with Eclipse RCP, in particular making the use of Spring and JPA very modular as my app contains many plug-ins each of which contribute some configuration to Spring and JPA, so if you run into other issues let me know and I'll try and help if I can.
Cheers
Martin
|
|
|
|
|
|
|
Re: RCP / Spring JPA - Need Example [message #461964 is a reply to message #461615] |
Thu, 18 January 2007 21:20  |
Eclipse User |
|
|
|
Originally posted by: shinglj.nationwide.com
Hey Martin,
I've had more time and I have good news and bad news.
Good News:
I was able to get the HandyAspects working in a simple RCP / Aspect J application without Spring JPA
Bad News:
So far, I haven't been able to get all three pieces working together RCP / Spring JPA / Aspectj (HandyAspects). When I add Handy Aspects to the Mix, it looks as if they aren't being woven. It worked in the swing app but I am have issues with it in the RCP App.
I am trying to track it down but it doesn't look good so far. It could be something I am doing wrong in configuration of Spring and AspectJ.
I'll keep you informed.
|
|
|
Powered by
FUDForum. Page generated in 0.04129 seconds