In my bundle pom.xml, I have tried to add <Embed-Dependency/> like this :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd [1]"> <modelVersion>4.0.0</modelVersion> <groupId>com.fimasys.fsb</groupId> <artifactId>automatic-simulation-osgi-service</artifactId> <packaging>bundle</packaging> <version>4.0</version> <name>FSB :: Services :: OSGi :: Automatic Simulation</name> <url>http://fsb.fimasys.com</url> <dependencies> <dependency> <groupId>com.fimasys.profinance</groupId> <artifactId>pf-bos-commons-ejb-client</artifactId> <version>2008.r2.2.38.01</version> </dependency> <dependency> <groupId>com.fimasys.services</groupId> <artifactId>fms-java-services-commons</artifactId> <version>1.11.03</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jbossall-client</artifactId> <version>4.2.2.GA</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ejb_3.0_spec</artifactId> <version>1.0.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <Import-Package> javax.jws, META-INF.cxf, META-INF.cxf.transport.nmr, javax.ejb, javax.ejb.spi, javax.xml </Import-Package> <Private-Package>com.fimasys.fsb.services</Private-Package> <Require-Bundle>org.apache.servicemix.bundles.woodstox-3.2.3</Require-Bundle> <Embed-Dependency>pf-bos-commons-ejb-client</Embed-Dependency> <Embed-StripGroup>true</Embed-StripGroup> </instructions> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project> But now, when I build my bundle using mvn org.apache.felix:maven-bundle-plugin:bundle, I have the error : [ERROR] Error building bundle com.fimasys.fsb:automatic-simulation-osgi-service:bundle:4.0 : Unresolved references to [com.fimasys.finance.profinance.batch.batches.dataloading.accountuseloading.helper, ...] with a lot of package following. Most of this package are imported in the classes but not really used for that I would like to do with this library. So my questions are : 1/ do I need to add all library dependencies in my bundle (in runtime scope) ? 2/ can I "force" the build by ignoring transitive dependencies ? 3/ if I have put my library jar in the bundle and use the <Bundle-Classpath/>, will I have the same behavior (I'm going to test it) ? Thanks, Regards JB -- Jean-Baptiste Onofré [EMAIL PROTECTED] BuildProcess/AutoDeploy Project Leader http://buildprocess.sourceforge.net On Tue 04/11/08 11:33, " Jean-Baptiste Onofré" [EMAIL PROTECTED] wrote: Freeman, I have tried : javax.jws, META-INF.cxf, META-INF.cxf.transport.nmr, javax.ejb, javax.ejb.spi, javax.xml And now, it seems to work. I have another error : Caused by: java.lang.IllegalArgumentException: Cannot find class [com.fimasys.finance.profinance.components.simulation.common.ejb.AutomaticSimulationSession]. Root cause: java.lang.ClassNotFoundException: com.fimasys.finance.profinance.components.simulation.common.ejb.AutomaticSimulationSession This class is define in dependency (in the pom.xml). I was thinking that the Felix maven plugin add dependencies in the OSGi bundle but it seems not. How can I add static dependencies like this ? Thanks Regards -- Jean-Baptiste Onofré [EMAIL PROTECTED] [2] BuildProcess/AutoDeploy Project Leader http://buildprocess.sourceforge.net [3] On Tue 04/11/08 10:48, Freeman Fang [EMAIL PROTECTED] [4] wrote: How about use javax.jws, META-INF.cxf, META-INF.cxf.transport.nmr, javax.ejb, javax.ejb,spi, javax.xml Jean-Baptiste Onofré wrote: > Hi Freeman, > > In the bundle pom.xml, I have set : > > > javax.jws, > META-INF.cxf, > META-INF.cxf.transport.nmr, > javax.ejb*;version="3.0", > javax.xml > > > During the build (using mvn > org.apache.felix:maven-bundle-plugin:bundle), I have this warning : > [WARNING] Warning building bundle > com.fimasys.fsb:automatic-simulation-osgi-service:bundle:4.0 : Did not > find matching referal for javax.ejb* > whereas I haven't this using javax.ejb directly. > > Nevertheless, I have deployed the bundle but the behavior is the > same : java.lang.NoClassDefFoundError: javax/ejb/EJBObject > > Here is my bundle MANIFEST.MF (with javax.ejb*;version="3.0") : > Manifest-Version: 1.0 > Built-By: jb > Created-By: Apache Maven Bundle Plugin > Import-Package: > META-INF.cxf,META-INF.cxf.transport.nmr,javax.jws,java > x.xml > Bnd-LastModified: 1225790605755 > Bundle-Version: 4.0 > Bundle-Name: FSB :: Services :: OSGi :: Automatic Simulation > Build-Jdk: 1.5.0_14 > Private-Package: com.fimasys.fsb.services > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: automatic-simulation-osgi-service > Tool: Bnd-0.0.255 > Require-Bundle: org.apache.servicemix.bundles.woodstox-3.2.3 > > and here is the MANIFEST.MF using javax.ejb without version : > Manifest-Version: 1.0 > Built-By: jb > Created-By: Apache Maven Bundle Plugin > Import-Package: > META-INF.cxf,META-INF.cxf.transport.nmr,javax.ejb;vers > ion="3.0",javax.jws,javax.xml > Bnd-LastModified: 1225790754188 > Bundle-Version: 4.0 > Bundle-Name: FSB :: Services :: OSGi :: Automatic Simulation > Build-Jdk: 1.5.0_14 > Private-Package: com.fimasys.fsb.services > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: automatic-simulation-osgi-service > Tool: Bnd-0.0.255 > Require-Bundle: org.apache.servicemix.bundles.woodstox-3.2.3 > > Strange isn't it ? > > Regards > JB > -- > Jean-Baptiste Onofré > [EMAIL PROTECTED] [5] [1] > BuildProcess/AutoDeploy Project Leader > http://buildprocess.sourceforge.net [6] [2]> > > On Tue 04/11/08 10:01, Freeman Fang [EMAIL PROTECTED] [7] [3] wrote: > Hi, > > Please try with import javax.ejb*;version="3.0" > And could you please append the MENIFEST file of your bundle jar if > it > still doesn't work? > > Freeman > > Jean-Baptiste Onofré wrote: > > Hi all, > > > > using ServiceMix 4.0-M1 (with the SMX Kernel 1.0-M2 embedded), I > > have created a CXF NMR OSGi bundle. > > > > In my bundle beans.xml, I have : > > > > > > > > Links: > ------ > [1] http://www.w3.org/2001/XMLSchema-instance [8] [4]> > [2] http://cxf.apache.org/jaxws [9] [5]> > [3] http://www.springframework.org/schema/beans [10] [6]> > [4] http://www.springframework.org/schema/beans/spring-beans.xsd [11] [7]> > [5] http://cxf.apache.org/jaxws [12] [8]> > [6] http://cxf.apache.org/schemas/jaxws.xsd [13] [9]> > [7] http://webmail.nanthrax.net/jnp://srvfms-24.fimasys.fr:1299 [14] [10]> > [8] http://www.w3.org/2001/XMLSchema-instance [15] [11]> > [9] http://maven.apache.org/POM/4.0.0 [16] [12]> > [10] http://maven.apache.org/maven-v4_0_0.xsd [17] [13]> > [11] http://fsb.fimasys.com [18] [14]> > [12] http://fsb.fimasys.com [19] [15]> > [13] [EMAIL PROTECTED] [20] [16] > [14] > http://webmail.nanthrax.net/bundle://86.0:0/META-INF/spring/beans.xml [21]]: [17]> > [15] [EMAIL PROTECTED] [22] [18] > [16] http://buildprocess.sourceforge.net [23] [19]> > [17] http://www.springframework.org/schema/beans [24] [20]> > [18] > http://www.springframework.org/schema/beans/spring-beans.xsd [25] [21]> > [19] http://cxf.apache.org/jaxws [26] [22]> > [20] http://cxf.apache.org/schemas/jaxws.xsd [27] [23]> > [21] http://maven.apache.org/maven-v4_0_0.xsd [28] [24]> > > Links: ------ [1] [EMAIL PROTECTED] [29] [2] http://buildprocess.sourceforge.net [30] [3] [EMAIL PROTECTED] [31] [4] http://www.w3.org/2001/XMLSchema-instance [32] [5] http://cxf.apache.org/jaxws [33] [6] http://www.springframework.org/schema/beans [34] [7] http://www.springframework.org/schema/beans/spring-beans.xsd [35] [8] http://cxf.apache.org/jaxws [36] [9] http://cxf.apache.org/schemas/jaxws.xsd [37] [10] http://webmail.nanthrax.net/jnp://srvfms-24.fimasys.fr:1299 [38] [11] http://www.w3.org/2001/XMLSchema-instance [39] [12] http://maven.apache.org/POM/4.0.0 [40] [13] http://maven.apache.org/maven-v4_0_0.xsd [41] [14] http://fsb.fimasys.com [42] [15] http://fsb.fimasys.com [43] [16] [EMAIL PROTECTED] [44] [17] http://webmail.nanthrax.net/bundle://86.0:0/META-INF/spring/beans.xml]: [45] [18] [EMAIL PROTECTED] [46] [19] http://buildprocess.sourceforge.net [47] [20] http://www.springframework.org/schema/beans [48] [21] http://www.springframework.org/schema/beans/spring-beans.xsd [49] [22] http://cxf.apache.org/jaxws [50] [23] http://cxf.apache.org/schemas/jaxws.xsd [51] [24] http://maven.apache.org/maven-v4_0_0.xsd [52] Links: ------ [1] http://maven.apache.org/maven-v4_0_0.xsd [2] mailto:[EMAIL PROTECTED] [3] http://buildprocess.sourceforge.net [4] mailto:[EMAIL PROTECTED] [5] mailto:[EMAIL PROTECTED] [6] http://buildprocess.sourceforge.net [7] mailto:[EMAIL PROTECTED] [8] http://www.w3.org/2001/XMLSchema-instance [9] http://cxf.apache.org/jaxws [10] http://www.springframework.org/schema/beans [11] http://www.springframework.org/schema/beans/spring-beans.xsd [12] http://cxf.apache.org/jaxws [13] http://cxf.apache.org/schemas/jaxws.xsd [14] http://webmail.nanthrax.net/jnp://srvfms-24.fimasys.fr:1299 [15] http://www.w3.org/2001/XMLSchema-instance [16] http://maven.apache.org/POM/4.0.0 [17] http://maven.apache.org/maven-v4_0_0.xsd [18] http://fsb.fimasys.com [19] http://fsb.fimasys.com [20] mailto:[EMAIL PROTECTED] [21] http://webmail.nanthrax.net/bundle://86.0:0/META-INF/spring/beans.xml [22] mailto:[EMAIL PROTECTED] [23] http://buildprocess.sourceforge.net [24] http://www.springframework.org/schema/beans [25] http://www.springframework.org/schema/beans/spring-beans.xsd [26] http://cxf.apache.org/jaxws [27] http://cxf.apache.org/schemas/jaxws.xsd [28] http://maven.apache.org/maven-v4_0_0.xsd [29] mailto:[EMAIL PROTECTED] [30] http://buildprocess.sourceforge.net</font [31] mailto:[EMAIL PROTECTED] [32] http://www.w3.org/2001/XMLSchema-instance</font [33] http://cxf.apache.org/jaxws</font [34] http://www.springframework.org/schema/beans</font [35] http://www.springframework.org/schema/beans/spring-beans.xsd</font [36] http://cxf.apache.org/jaxws</font [37] http://cxf.apache.org/schemas/jaxws.xsd</font [38] http://webmail.nanthrax.net/jnp://srvfms-24.fimasys.fr:1299</font</font [39] http://www.w3.org/2001/XMLSchema-instance</font [40] http://maven.apache.org/POM/4.0.0</font</font [41] http://maven.apache.org/maven-v4_0_0.xsd</font [42] http://fsb.fimasys.com</url></font</font [43] http://fsb.fimasys.com</url></font</font [44] mailto:[EMAIL PROTECTED] [45] http://webmail.nanthrax.net/bundle://86.0:0/META-INF/spring/beans.xml]:</font [46] mailto:[EMAIL PROTECTED] [47] http://buildprocess.sourceforge.net</font</font [48] http://www.springframework.org/schema/beans</font</font [49] http://www.springframework.org/schema/beans/spring-beans.xsd</font</font [50] http://cxf.apache.org/jaxws</font</font [51] http://cxf.apache.org/schemas/jaxws.xsd</font</font [52] http://maven.apache.org/maven-v4_0_0.xsd</font</font