开发者

Java DB issue with OSGi and JPA - SpringProxy not visible

My application is using Spring (STS) and OSGi. The DB layer uses JPA (with Eclipse-Link), I have:

  • one OSGi project for my DAO
  • one OSGi project for my DAO implementations

Since the Entity Manager was not committing my changes as in this other SO question, I added the @Transactional annotation in my DAO objects for my create, update and delete methods (if I understood well, the read-only methods such as find are not concerned).

But this raises an exception:

java.lang.IllegalArgumentException: interface org.springframework.aop.SpringProxy
is not visible from cla开发者_如何学运维ss loader

I added the annotation at DAO and DAO impl levels first, then only at DAO Impl level, but the result is the same. I'm sometimes a bit lost with Spring, could you please help ?

Thanks !


This was actually an OSGi issue: OSGi is made of bundles, each one executes in its own environment and one of my module was lacking visibility on another one.

To fix this, we had to use AOP and weaving.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜