Since bnd doesn't know about the references to spring-aop, I don't think org.springframework.aop.* would work, you need explicit package directives like:
org.springframework.aop ,org.springframework.aop.framework I tend to try out things with bnd itself if the maven-bundle-plugin isn't doing what I expected it to do. On Thu, Jun 16, 2011 at 8:53 PM, Shamik Bandopadhyay <[email protected]>wrote: > I did try earlier adding the spring aop package explicitely in the > import-package. But maven plugin bundle won't include it in the manifest > since its not being referred directly by any class in the package or it has > any transitive dependency. I tried including the jar in the bundle, but > then it results in a namespace handler exception, a catch-22 situation. > > <Import-Package>com.test.taxonomy.model.*;version=1.0.0, > com.autodesk.taxonomy.message.*;version=1.0.0, > org.springframework.aop.*, > * > </Import-Package> > > > <Embed-Dependency>*;scope=compile|runtime;inline=true;artifactId=!spring-core|spring-asm|spring-aop|spring-beans|spring-context|spring-context-support|spring-expression|spring-tx|commons-collections|commons-logging|org.apache.felix.framework|taxonomymessagebundle|taxonomymodelbundle</Embed-Dependency> > > On Thu, Jun 16, 2011 at 5:07 PM, Allen Lau <[email protected]> wrote: > > > Have you consider just adding the org.springframework.aop as an import to > > the Import-Package directive? > > > > Bnd does a great job, but sometime it can't find all of your dependencies > > for you. I do not know the specifics > > why the spring-aop stuff was not detected, but in cases like these, you > can > > either manually help Bnd, or dig deeper > > to see what is going on with the Spring jars. > > > > On Thu, Jun 16, 2011 at 1:59 PM, Shamik Bandopadhyay <[email protected] > > >wrote: > > > > > That kind of gets me into a confused state again. Even if I change my > > > dependency to point to spring 3.0.5 jars, including spring-aop, the > > import > > > package won't include a org.springframework.aop entry since its being > > > referred in my bundle. Perhaps,spring will use it during runtime > > > resolution,which thought is the job of the container to do so. I > > explicitly > > > excluded the spring packages in embed-dependency since I wanted the > > > framework to use its native version, which is same as my dependency. > > Here's > > > the pom entry: > > > > > > <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-aop|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> > > > > > > Here's the import package in bundle manifest : > > > > > > Embed-Dependency: *;scope=compile|runtime;inline=true;artifactId=!spri > > > ng-core|spring-aop|spring-asm|spring-beans|spring-context|spring-cont > > > ext-support|spring-expression|spring-tx|commons-collections|commons-l > > > ogging|org.apache.felix.framework|taxonomymessagebundle|taxonomymodel > > > bundle > > > 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",javax.management;resolution:=optional > > > ,javax.net;resolution:=optional,javax.net.ssl;resolution:=optional,or > > > g.apache.commons.collections;resolution:=optional;version="3.2",org.a > > > pache.commons.logging;resolution:=optional,org.apache.tools.ant;resol > > > ution:=optional,org.apache.tools.ant.types;resolution:=optional,org.a > > > pache.tools.ant.types.resources;resolution:=optional,org.apache.tools > > > .ant.util.regexp;resolution:=optional,org.osgi.framework;resolution:= > > > optional;version="1.5",org.springframework.beans.factory;resolution:= > > > optional;version="3.0",org.springframework.core;resolution:=optional; > > > version="3.0",org.springframework.core.io;resolution:=optional;versio > > > n="3.0",org.springframework.dao;resolution:=optional;version="3.0",or > > > g.springframework.dao.support;resolution:=optional;version="3.0",org. > > > springframework.transaction;resolution:=optional;version="3.0",org.sp > > > ringframework.transaction.annotation;resolution:=optional;version="3. > > > 0",org.springframework.transaction.support;resolution:=optional;versi > > > on="3.0",org.springframework.util;resolution:=optional;version="3.0" > > > > > > > > > On Thu, Jun 16, 2011 at 1:31 PM, Allen Lau <[email protected]> > wrote: > > > > > > > If you read the Spring manual, you'll notice that the @Transactional > > > > annotations are supported by Spring-AOP. > > > > See the following section in the spring 3.x doc, I'm sure Spring > 2.5.x > > is > > > > the same.10.5.1 Understanding the Spring Framework's declarative > > > > transaction > > > > implementation > > > > So you would need spring-aop also. > > > > > > > > Allen > > > > > > > > On Thu, Jun 16, 2011 at 12:28 PM, Shamik Bandopadhyay < > > [email protected] > > > > >wrote: > > > > > > > > > Hi, > > > > > > > > > > I've run into the following exception when I try to start the > bundle. > > > > > > > > > > *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 > > > > > > > > > > Manifest-Version: 1.0 > > > > > Export-Package: com.test.taxonomy.dao.api;uses:="com.autodesk.taxo > > > > > nomy.message,com.test.taxonomy.model";version="1.0.0" > > > > > Bundle-ClassPath: . > > > > > Built-By: bandops > > > > > Tool: Bnd-0.0.357 > > > > > Bundle-Name: Taxonomy Dao Impl Bundle > > > > > Created-By: Apache Maven Bundle Plugin > > > > > Build-Jdk: 1.6.0_21 > > > > > Bundle-Version: 1.0.0 > > > > > Bnd-LastModified: 1308246096716 > > > > > Embed-Transitive: true > > > > > Bundle-ManifestVersion: 2 > > > > > Embed-Dependency: > > > > > > > > > > > > > > > > > > > > *;scope=compile|runtime;inline=true;artifactId=!spring|commons-collections|commons-logging|org.apache.felix.framework|tax > > > > > > > > > > onomymessagebundle|taxonomymodelbundle > > > > > Import-Package: com.test.taxonomy.dao.api;resolution:=optional;ver > > > > > sion="1.0",com.test.taxonomy.message;version="1.0.0",com.test > > > > > > > .taxonomy.model;version="1.0.0",javax.management;resolution:=optional > > > > > ,javax.net > > ;resolution:=optional,javax.net.ssl;resolution:=optional,or > > > > > > > g.apache.commons.collections;resolution:=optional;version="3.2",org.a > > > > > > > pache.commons.logging;resolution:=optional,org.apache.tools.ant;resol > > > > > > > ution:=optional,org.apache.tools.ant.types;resolution:=optional,org.a > > > > > > > pache.tools.ant.types.resources;resolution:=optional,org.apache.tools > > > > > > > .ant.util.regexp;resolution:=optional,org.osgi.framework;resolution:= > > > > > > > optional;version="1.5",org.springframework.beans.factory;resolution:= > > > > > > > optional;version="2.5",org.springframework.core;resolution:=optional; > > > > > version="2.5",org.springframework.core.io > > ;resolution:=optional;versio > > > > > > > n="2.5",org.springframework.dao;resolution:=optional;version="2.5",or > > > > > > > g.springframework.dao.support;resolution:=optional;version="2.5",org. > > > > > > > springframework.transaction;resolution:=optional;version="2.5",org.sp > > > > > > > ringframework.transaction.annotation;resolution:=optional;version="2. > > > > > > > 5",org.springframework.transaction.support;resolution:=optional;versi > > > > > > on="2.5",org.springframework.util;resolution:=optional;version="2.5" > > > > > Bundle-SymbolicName: taxonomydaoimplbundle > > > > > > > > > > > > > > > Here's a snippet from my pom entry : > > > > > > > > > > <dependency> > > > > > <groupId>org.springframework</groupId> > > > > > <artifactId>spring</artifactId> > > > > > <version>2.5.5</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|commons-collections|commons-logging|org.apache.felix.framework|taxonomymessagebundle|taxonomymodelbundle</Embed-Dependency> > > > > > <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> > > > > > > > > > > > > > > > Not sure why I'm getting this exception since I'm not using aop > > > anywhere > > > > in > > > > > my application. I'm using @Transactional annotation in the service > > code > > > > > inside my bundle which is part of Spring-tx and not aop. > > > > > > > > > > Since the container have spring-aop bundle, why the classloader is > > not > > > > able > > > > > to resolve it ? > > > > > Any pointers will be highly appreciated. > > > > > > > > > > -Thanks > > > > > > > > > > > > > > >

