How to properly import/export dependencies in Karaf?

I have a simple servlet that calls AmazonS3Ciient class 

my pom.xml 

<plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
                                <extensions>true</extensions>
                                <configuration>
                                        <supportedProjectTypes>
                                                
<supportedProjectType>jar</supportedProjectType>
                                                
<supportedProjectType>bundle</supportedProjectType>
                                                
<supportedProjectType>war</supportedProjectType>
                                        </supportedProjectTypes>
                                        <instructions>
                                                
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                                                
<Bundle-Version>${project.version}</Bundle-Version>
                                                <Import-Package>
                                                   com.amazonaws.*,
                                                        *;resolution:=optional
                                                </Import-Package>
                                                <Export-Package>
                                                        !*
                                                </Export-Package>
                                                <Bundle-Classpath>
                                                        WEB-INF/classes
                                                </Bundle-Classpath>
                                                
<Web-ContextPath>agwar</Web-ContextPath>
                                        </instructions>
                                </configuration>
                                <executions>
                                        <execution>
                                                <id>generate-manifest</id>
                                                <phase>process-classes</phase>
                                                <goals>
                                                        <goal>manifest</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                        <plugin>
                                <artifactId>maven-war-plugin</artifactId>
                                <configuration>
                                        <archive>
                                        
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                        </archive>
                                </configuration>
                        </plugin>

I'm getting the error noclassdeferror I believe it is a missing dependency
or dependency conflict?


I tried to find the class and it is present on both bundle

karaf@root()> find-class AmazonS3Client

Apache ServiceMix :: Bundles :: aws-java-sdk (133)
com/amazonaws/services/s3/AmazonS3Client$1.class
com/amazonaws/services/s3/AmazonS3Client$2.class
com/amazonaws/services/s3/AmazonS3Client$3.class
com/amazonaws/services/s3/AmazonS3Client.class

OPS4J Pax Web - Samples - Servlet3 (139)
com/amazonaws/services/s3/AmazonS3Client$1.class
com/amazonaws/services/s3/AmazonS3Client$2.class
com/amazonaws/services/s3/AmazonS3Client$3.class
com/amazonaws/services/s3/AmazonS3Client.class


Not really sure how to resolve this :(

Thanks in advance



--
View this message in context: 
http://karaf.922171.n3.nabble.com/NoClassDefError-on-AmazonS3Client-tp4037768.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to