-
1. Re: Class not found when instantiating AmazonS3Client on Jboss 7
spolti Feb 13, 2014 9:18 AM (in response to toriacht)Put thiis into your pom.xml and build the app again:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1-alpha2</version>
</dependency>
Rgz
-
2. Re: Class not found when instantiating AmazonS3Client on Jboss 7
toriacht Feb 13, 2014 4:55 PM (in response to spolti)Hi Filippe,
Thank you for the reply, if I add that to the POM or even 4.1.2 as a dependency it is still the same issue. The httpclient-4.1.2 alrteady exists in {jboss-home}/modules/org/apache/httpcomponents but for some reason the application can;t find it
/T
-
3. Re: Class not found when instantiating AmazonS3Client on Jboss 7
sfcoy Feb 14, 2014 12:24 AM (in response to toriacht)Just because you can see a jar in the JBossAS distribution does not mean that your application can see it. JBossAS 7.x and WildFly (for the most part) only expose the classes and interfaces that the JavaEE specs specify.
You can use a jboss-deployment-structure.xml file to import it into your application, but you're probably better off providing your own copy in the WEB-INF/lib directory or EAR/lib directory as appropriate.
-
4. Re: Class not found when instantiating AmazonS3Client on Jboss 7
vbchin2 Feb 14, 2014 1:34 AM (in response to toriacht)1 of 1 people found this helpfulNot all the modules (associated JARs) are loaded as the server boots up and nor are they loaded just because there is API call in your WAR. You must explicitly mention which module your WAR depends on using the methods described here. You can either choose to add/modify:
- MANIFEST.MF
- jboss-deployment-structure.xml (as suggested by Stephen)
One thing I wouldn't recommend (if and only if JBoss Application Server is your deployment platform) is packaging it again within your WAR as it is already provided by the container as a module.
-
5. Re: Class not found when instantiating AmazonS3Client on Jboss 7
toriacht Feb 14, 2014 4:12 AM (in response to vbchin2)Thanks for the replies guys...So something like below should to the trick to include all classes in the jar?
Manifest-Version: 1.0 Class-Path: httpclient-4.1.2.jar
or
in my MainApp.war META-INF/ a jboss-deployment-structure.xml like this:
<jboss-deployment-structure> <sub-deployment name="myMavenModule.jar"> <dependencies> <module name="org.apache.httpcomponents" /> </dependencies> </sub-deployment> </jboss-deployment-structure>
-
6. Re: Class not found when instantiating AmazonS3Client on Jboss 7
spolti Feb 14, 2014 11:25 AM (in response to toriacht)1 of 1 people found this helpfulYes, if the jar is under JBOSS/modules you must have a explicit dependency inside your app using Manifest or jboss-deployment-structure.xml, but the jboss-deployment-structure.xml must be under WEF-INF floder, not META-INF , like scoy sayd.