简体   繁体   中英

How to use spring-roo entities from Eclipse RCP/RAP project

I have created a domain model using spring-roo, which makes heavy use of Spring and AspectJ. My model is deploying nicely as a OSGi bundle, and from the Spring STS (eclipse-based) IDE, I can call the entity classes, etc.

I need to access these domain classes from a Eclipse RCP/RAP application, and this project I keep in the normal Eclipse IDE for RCP/RAP development (ie it has all the PDE tools). I also added the STS and AspectJ plugins.

I added my domain bundle to the target platform, and made my Eclipse RAP app dependent on it. When I run the RAP application, I can see that my domain bundle is deployed in OSGi (ie it is ACTIVE). I also see that it exists in the PDE editor when I added the dependency.

However, when I try to import and use any of the domain classes, I get nothing. I can't even see the domain packages from my Java file editor.

I have tried to add a AspectJ and Spring nature to my RAP project, but still nothing.

Also, when running the Eclipse RAP application, everything deploys fine, except the RAP application, which throws the following exception:

Mar 2, 2010 2:44:58 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from URL [bundleentry://168.fwk1096264275/META-INF/spring/applicationContext.xml] Exception in thread "SpringOsgiExtenderThread-2" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextExecutor.java:345) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.fail(DependencyWaiterApplicationContextExecutor.java:401) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecu tor.stageOne(DependencyWaiterApplicationContextExecutor.java:287) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at java.lang.Thread.run(Thread.java:637)

Any help would be highly appreciated.

也许您应该尝试不要将Roo项目构建为jar,而是从RCP项目中引用该项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM