3 Replies Latest reply on May 14, 2015 9:50 PM by Abhijit Humbe

    Remote Rest API Webapp

    Jorge Valdes Newbie

      Hi,

       

      I developed a maven project to interact with bpmsuite processes using remote rest api , this project works well but test level .

       

      I need to create a web module that uses this API but when installed in EAP6 get the following error.

       

      java.lang.NoSuchMethodError : org.apache.http.auth.AuthState.update(Lorg/apache/http/auth/AuthScheme;Lorg/apache/http/auth/Credentials;)V

       

      Anyone have any example to AS7.1.1 or EAP 6.0.

       

      Please help.

       

       

      Regards..

        • 1. Re: Remote Rest API Webapp
          Abhijit Humbe Master

          Hi,

          This is caused by transitive dependencies bringing in wrong version of httpclient and httpcore. Update the pom.xml to specify the correct version of httpcore and httpclient explicitly.

          ==============

          <dependency>

              <groupId>org.apache.httpcomponents</groupId>

              <artifactId>httpclient</artifactId>

              <version>4.2.1</version>

          </dependency>

          <dependency>

              <groupId>org.apache.httpcomponents</groupId>

              <artifactId>httpcore</artifactId>

              <version>4.2.1</version>

          </dependency>

           

          ==============

          hope it helps..

          • 2. Re: Remote Rest API Webapp
            Jorge Valdes Newbie

            Yes, thank you.
            Additionally I had to modify the "org.apache.httpcomponents" module adding these dependencies.

            <resources>
                     <! - <resource-root path = "httpclient-4.1.3-redhat-1.jar" />
                     <resource-root path = "httpcore-4.1.4-redhat-1.jar" /> ->
                     <resource-root path = "httpclient-4.2.1.jar" />
                     <resource-root path = "httpcore-4.2.1.jar" />
                     <resource-root path = "httpmime-4.1.3-redhat-1.jar" />
                     <! - Insert resources here ->
                 </ resources>


            I would like to do it in the jboss-deployment-structure XML file, It is posible?

            • 3. Re: Remote Rest API Webapp
              Abhijit Humbe Master

              Hi,

              Yes, we can add these dependencies through jboss-deployment-structure.xml file, like as:

              =================

              <jboss-deployment-structure>

              <deployment>

                <dependencies>

                 <module name="module.name"/>

                </dependencies>

              </deployment>

              </jboss-deployment-structure>

              =================

              If you are using war file then this jboss-deployment-structure.xml file will work, but if you are using ear file then you have to add <sub-deployment> tag.Go through Class Loading in AS7 - JBoss AS 7.1 - Project Documentation Editor for more details.