Hey all,

The application we are developing requires that it access an outside webservice 
using Apache CXF from within an OSGi container (Apache Felix). I've created a 
quick Java console application that connects to and utilizes the web service 
successfully, so I know the service is working. However, when I try to 
accomplish the same task inside the OSGi Felix environment, it is unsuccessful.

I've tried a couple different approaches: (1) use the distributed OSGi CXF 
bundle to export the CXF dependencies  (I'll have a different group help me 
with these issues) and (2) provide all dependencies within the client bundle. 
For the second option, I think I'm running into a Felix Maven plugin issue. I'm 
specifying all of the dependencies in the Bundle-ClassPath instruction, but the 
errors I receive make me think that the dependencies aren't actually being 
exposed to the client code. I'm really just basically trying to take the same 
code that runs outside of the OSGi environment, package it all up, and run it 
from within the OSGi container.

I've included the POM file I'm using to build the client bundle. Please let me 
know if I've missed something or if I have not been clear in what I'm trying to 
do. Can anyone figure out why the client code wouldn't see the packages listed 
in the Bundle-ClassPath instruction? Thanks in advance for your help!

--Chris

My POM file:

<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";>

        <modelVersion>4.0.0</modelVersion>

        <groupId>my.test.ws</groupId>
        <artifactId>cis</artifactId>
        <packaging>bundle</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>Test Webservice</name>
        <description>Provides access to the webservice</description>

        <properties>
                <file.encoding>utf-8</file.encoding>
        </properties>

        <build>
                <plugins>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>5</source>
                                        <target>5</target>
                                </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-scr-plugin</artifactId>
                                <version>1.2.0</version>
                                <executions>
                                        <execution>
                                                
<id>generate-scr-scrdescriptor</id>
                                                <goals>
                                                        <goal>scr</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>

                        <plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
                                <extensions>true</extensions>
                                <version>2.0.1</version>
                                <configuration>
                                        <instructions>
                                                <Export-Package>
                                                        
my.test.ws.poc;version=${pom.version},
                                                        
org.apache.ws.commons.schema.*,
                                                        
org.apache.commons.logging.*,
                                                        schemas.*,
                                                        
com.sun.tools.xjc.addon.apache_cxf.*,
                                                        org.apache.cxf.*,
                                                        javax.activation,
                                                        javax.annotation.*,
                                                        javax.mail.*,
                                                        
org.apache.geronimo.mail.*,
                                                        javax.xml.ws.*,
                                                        javax.servlet.*,
                                                        javax.xml.stream.*,
                                                        javax.jws.*,
                                                        javax.xml.bind.*,
                                                        com.sun.istack.*,
                                                        com.sun.xml.*,
                                                        org.mortbay.*,
                                                        org.apache.neethi,
                                                        javax.xml.soap,
                                                        
com.sun.xml.messaging.saaj.*,
                                                        com.ibm.wsdl.*,
                                                        javax.wsdl.*,
                                                        com.ctc.wstx.*,
                                                        com.codehaus.stax2.*,
                                                        
org.apache.xml.resolver.*
                                                </Export-Package>
                                                <Import-Package>
                                                        !*
                                                </Import-Package>
                                                <Include-Resource>
                                                        {maven-resources}, 
{maven-dependencies},
                                                        
cis-ws-api-1.5.0-SNAPSHOT.jar=target/classes/cis-ws-api-1.5.0-SNAPSHOT.jar,
                                                        
cis-ws-support-1.5.0-SNAPSHOT.jar=target/classes/cis-ws-support-1.5.0-SNAPSHOT.jar,
                                                        
commons-logging-1.1.1.jar=target/classes/commons-logging-1.1.1.jar,
                                                        
cxf-2.2.5.jar=target/classes/cxf-2.2.5.jar,
                                                        
geronimo-activation_1.1_spec-1.0.2.jar=target/classes/geronimo-activation_1.1_spec-1.0.2.jar,
                                                        
geronimo-annotation_1.0_spec-1.1.1.jar=target/classes/geronimo-annotation_1.0_spec-1.1.1.jar,
                                                        
geronimo-javamail_1.4_spec-1.6.jar=target/classes/geronimo-javamail_1.4_spec-1.6.jar,
                                                        
geronimo-jaxws_2.1_spec-1.0.jar=target/classes/geronimo-jaxws_2.1_spec-1.0.jar,
                                                        
geronimo-servlet_2.5_spec-1.2.jar=target/classes/geronimo-servlet_2.5_spec-1.2.jar,
                                                        
geronimo-stax-api_1.0_spec-1.0.1.jar=target/classes/geronimo-stax-api_1.0_spec-1.0.1.jar,
                                                        
geronimo-ws-metadata_2.0_spec-1.1.2.jar=target/classes/geronimo-ws-metadata_2.0_spec-1.1.2.jar,
                                                        
jaxb-api-2.1.jar=target/classes/jaxb-api-2.1.jar,
                                                        
jaxb-impl-2.1.12.jar=target/classes/jaxb-impl-2.1.12.jar,
                                                        
jaxws-api-2.1.jar=target/classes/jaxws-api-2.1.jar,
                                                        
jetty-6.1.21.jar=target/classes/jetty-6.1.21.jar,
                                                        
jetty-util-6.1.21.jar=target/classes/jetty-util-6.1.21.jar,
                                                        
neethi-2.0.4.jar=target/classes/neethi-2.0.4.jar,
                                                        
saaj-api-1.3.jar=target/classes/saaj-api-1.3.jar,
                                                        
saaj-impl-1.3.2.jar=target/classes/saaj-impl-1.3.2.jar,
                                                        
wsdl4j-1.6.2.jar=target/classes/wsdl4j-1.6.2.jar,
                                                        
wstx-asl-3.2.9.jar=target/classes/wstx-asl-3.2.9.jar,
                                                        
xml-resolver-1.2.jar=target/classes/xml-resolver-1.2.jar,
                                                        
XmlSchema-1.4.5.jar=target/classes/XmlSchema-1.4.5.jar
                                                </Include-Resource>
                                                <Bundle-ClassPath>
                                                        .,
                                                        
cis-ws-api-1.5.0-SNAPSHOT.jar,
                                                        
cis-ws-support-1.5.0-SNAPSHOT.jar,
                                                        
commons-logging-1.1.1.jar,
                                                        cxf-2.2.5.jar,
                                                        
geronimo-activation_1.1_spec-1.0.2.jar,
                                                        
geronimo-annotation_1.0_spec-1.1.1.jar,
                                                        
geronimo-javamail_1.4_spec-1.6.jar,
                                                        
geronimo-jaxws_2.1_spec-1.0.jar,
                                                        
geronimo-servlet_2.5_spec-1.2.jar,
                                                        
geronimo-stax-api_1.0_spec-1.0.1.jar,
                                                        
geronimo-ws-metadata_2.0_spec-1.1.2.jar,
                                                        jaxb-api-2.1.jar,
                                                        jaxb-impl-2.1.12.jar,
                                                        jaxws-api-2.1.jar,
                                                        jetty-6.1.21.jar,
                                                        jetty-util-6.1.21.jar,
                                                        neethi-2.0.4.jar,
                                                        saaj-api-1.3.jar,
                                                        saaj-impl-1.3.2.jar,
                                                        wsdl4j-1.6.2.jar,
                                                        wstx-asl-3.2.9.jar,
                                                        xml-resolver-1.2.jar,
                                                        XmlSchema-1.4.5.jar
                                                </Bundle-ClassPath>
                                        </instructions>

                                </configuration>
                        </plugin>
                </plugins>
                <resources>
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>
                        <resource>
                                <directory>src/main/libs</directory>
                        </resource>
                </resources>
        </build>

        <dependencies>
                <dependency>
                        <groupId>javax.servlet.jsp</groupId>
                        <artifactId>jsp-api</artifactId>
                        <version>2.1</version>
                        <scope>compile</scope>
                </dependency>
                <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-simple</artifactId>
                        <version>1.5.2</version>
                </dependency>
                <dependency>
                        <groupId>cis-ws-api</groupId>
                        <artifactId>cis-ws-api</artifactId>
                        <version>1.5.0-SNAPSHOT</version>
                </dependency> 
        </dependencies>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to