You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jefoy1101 <je...@gmail.com> on 2015/01/13 07:26:36 UTC
NoClassDefError on AmazonS3Client
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.
Re: NoClassDefError on AmazonS3Client
Posted by jefoy1101 <je...@gmail.com>.
for someone that will bump to this issue , please refer to this
http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-td4037488i20.html#a4037804
--
View this message in context: http://karaf.922171.n3.nabble.com/NoClassDefError-on-AmazonS3Client-tp4037768p4037805.html
Sent from the Karaf - User mailing list archive at Nabble.com.