1 Reply Latest reply on Feb 26, 2014 12:59 PM by Jose Miguel Loor

    Dependency of httpcomponents is not working

    Jose Miguel Loor Apprentice

      Hi

       

      I have an ear project that i am deploying to a jboss eap 6.2. The file looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

        <module name="deployment.myEarProject"></module>

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

        <sub-deployment name="myEjb.jar">

        <dependencies>

        <module name="org.apache.httpcomponents" />

        <module name="javax.api" />

        <module name="org.apache.commons.codec" />

        <module name="org.apache.commons.logging" />

        <module name="org.apache.james.mime4j" />

        <module name="deployment.otherEar.ear.otherJar.jar" />

        </dependencies>

        </sub-deployment>

        <sub-deployment name="myWar.war">

        <dependencies>

        <module name="deployment.otherEar.ear.otherJar.jar" />

        </dependencies>

        </sub-deployment>

      </jboss-deployment-structure>

       

      I am trying to issue a REST call from an EJB y myEJB.jar; but everytime i get this error:

       

      Caused by: java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext from [Module "deployment.myEarProject.ear:main" from Service Module Loader]

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]

        ... 64 more

       

      But the class HttpContext is in the httcomponents module. Why is the module not finding the class ??