Search code examples
jboss7.xjboss-modulesaws-sdk-java-2.0

Can't register AWS-SDK on Jboss modules correctly


I found the dependency aws-java-sdk was being compiled on a legacy code, having as result a very heavy EAR.

I declared this dependency as provided and wanted to put it as part of the Jboss modules, but no matter where I put it, I'm still having the ClassNotFound issue.

Here is my module.xml:

<module xmlns="urn:jboss:module:1.1" name="com.amazonaws">
    <properties>
            <property name="jboss.api" value="private"/>
    </properties>
    <resources>
            <resource-root path="aws-java-sdk-1.11.584.jar"/>
    </resources>
    <dependencies>
            <module name="javax.api"/>
            <module name="javax.xml.stream.api"/>
            <module name="javax.xml.bind.api"/>
            <module name="com.fasterxml.jackson"/>
            <module name="org.joda.time"/>
        </dependencies>
</module>

And the error:

Caused by: java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials

Solution

  • The problem was on the JAR file, needed sdk-core. Check your JARs always.