Emmanuel
Emmanuel

Reputation: 14209

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:

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 class 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 !

Upvotes: 2

Views: 1123

Answers (1)

Emmanuel
Emmanuel

Reputation: 14209

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.

Upvotes: 2

Related Questions