SpringProxy is not visible from class loader
I've run into the following exception when I try to start the bundle.
Code:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taxonomyDaoLoadImpl' defined in URL [bundle://350.0:0/META-INF/spring/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: interface org.springframework.aop.SpringProxy is not visible from class loader
I'm not referring to spring aop package and it doen't reflect in my import-package as well. Here's my manifest
Code:
Embed-Dependency: *;scope=compile|runtime;inline=true;artifactId=!spri
ng-core|spring-asm|spring-beans|spring-context|spring-context-support
|spring-expression|spring-tx|commons-collections|commons-logging|org.
apache.felix.framework|taxonomymessagebundle|taxonomymodelbundle
Import-Package: com.autodesk.taxonomy.dao.api;resolution:=optional;ver
sion="1.0",com.autodesk.taxonomy.message;version="1.0.0",com.autodesk
.taxonomy.model;version="1.0.0",com.jamonapi;resolution:=optional,jav
ax.management;resolution:=optional,javax.net;resolution:=optional,jav
ax.net.ssl;resolution:=optional,net.sf.cglib.core;resolution:=optiona
l,net.sf.cglib.proxy;resolution:=optional,net.sf.cglib.transform.impl
;resolution:=optional,org.apache.commons.collections;resolution:=opti
onal;version="3.2",org.apache.commons.logging;resolution:=optional,or
g.apache.commons.pool;resolution:=optional,org.apache.commons.pool.im
pl;resolution:=optional,org.apache.tools.ant;resolution:=optional,org
.apache.tools.ant.types;resolution:=optional,org.apache.tools.ant.typ
es.resources;resolution:=optional,org.apache.tools.ant.util.regexp;re
solution:=optional,org.aspectj.bridge;resolution:=optional,org.aspect
j.lang;resolution:=optional,org.aspectj.lang.annotation;resolution:=o
ptional,org.aspectj.lang.reflect;resolution:=optional,org.aspectj.run
time.internal;resolution:=optional,org.aspectj.util;resolution:=optio
nal,org.aspectj.weaver;resolution:=optional,org.aspectj.weaver.ast;re
solution:=optional,org.aspectj.weaver.internal.tools;resolution:=opti
onal,org.aspectj.weaver.patterns;resolution:=optional,org.aspectj.wea
ver.reflect;resolution:=optional,org.aspectj.weaver.tools;resolution:
=optional,org.osgi.framework;resolution:=optional;version="1.5",org.s
pringframework.beans;resolution:=optional;version="3.0",org.springfra
mework.beans.factory;resolution:=optional;version="3.0",org.springfra
mework.beans.factory.config;resolution:=optional;version="3.0",org.sp
ringframework.beans.factory.parsing;resolution:=optional;version="3.0
",org.springframework.beans.factory.support;resolution:=optional;vers
ion="3.0",org.springframework.beans.factory.xml;resolution:=optional;
version="3.0",org.springframework.core;resolution:=optional;version="
3.0",org.springframework.core.annotation;resolution:=optional;version
="3.0",org.springframework.core.io;resolution:=optional;version="3.0"
,org.springframework.core.task;resolution:=optional;version="3.0",org
.springframework.core.task.support;resolution:=optional;version="3.0"
,org.springframework.dao;resolution:=optional;version="3.0",org.sprin
gframework.dao.support;resolution:=optional;version="3.0",org.springf
ramework.transaction;resolution:=optional;version="3.0",org.springfra
mework.transaction.annotation;resolution:=optional;version="3.0",org.
springframework.transaction.support;resolution:=optional;version="3.0
",org.springframework.util;resolution:=optional;version="3.0",org.spr
ingframework.util.xml;resolution:=optional;version="3.0",org.w3c.dom;
resolution:=optionalBundle-SymbolicName: taxonomydaoimplbundle
Here's a snippet from my pom entry :
Code:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<configuration>
<instructions>
<Export-Package>com.autodesk.taxonomy.dao.api;version=1.0.0</Export-Package>
<Import-Package>com.autodesk.taxonomy.model.*;version=1.0.0, com.autodesk.taxonomy.message.*;version=1.0.0,
*;resolution:=optional
</Import-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=true;artifactId=!spring-core|spring-asm|spring-beans|spring-context|spring-context-support|spring-expression|spring-tx|commons-collections|commons-logging|org.apache.felix.framework|taxonomymessagebundle|taxonomymodelbundle</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Transitive>true</Embed-Transitive>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${pom.version}</Bundle-Version>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
<Include-Resource>
{maven-resources}, {maven-dependencies </Include-Resource>
</instructions>
</configuration>
I'm using @Transactional annotation in the service code inside my bundle which uses spring-aop internally. I'm exluding all the spring dependencies used in my bundle in order to let the container use its own, which is apparently the same version, i.e. 3.0.5 Release.
Since the container have spring-aop bundle, why the classloader is not able to resolve it ?
Any pointers will be highly appreciated.
-Thanks