Error thrown when connecting to HTTPS REST endpoint with HTTP proxy in SwitchYard

Solution Verified - Updated -

Issue

  • A SwitchYard Java bean calls this reference:

    <sca:reference name="QueryExampleService" multiplicity="0..1" promote="QueryRouteServiceBean/QueryExampleService">
      <sca:interface.java interface="com.example.app.QueryExampleService"></sca:interface>
      <resteasy:binding.rest name="QueryRest">
        <resteasy:messageComposer class="com.example.app.QueryComposer"></resteasy:messageComposer>
        <resteasy:interfaces>com.example.app.QueryExampleRestService</resteasy:interfaces>
        <resteasy:address>https://www.example.com/app/</resteasy:address>
        <resteasy:proxy>
          <resteasy:host>https://proxy.example.com</resteasy:host>
          <resteasy:port>3129</resteasy:port>
        </resteasy:proxy>
      </resteasy:binding.rest>
    </sca:reference>
    
  • However, it fails with an exception when trying to connect to the https endpoint:

    Caused by: java.lang.IllegalStateException: Scheme 'http' not registered.
                at org.apache.http.conn.scheme.SchemeRegistry.getScheme(SchemeRegistry.java:71)
                at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159)
                at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
                at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
                at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
                at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
                at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
                at org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.execute(ApacheHttpClient4Executor.java:182) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:39) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor.execute(AcceptEncodingGZIPInterceptor.java:40) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.jboss.resteasy.core.interception.ClientExecutionContextImpl.proceed(ClientExecutionContextImpl.java:45) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.jboss.resteasy.client.ClientRequest.execute(ClientRequest.java:443) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.jboss.resteasy.client.ClientRequest.httpMethod(ClientRequest.java:677) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
                at org.switchyard.component.resteasy.util.ClientInvoker.invoke(ClientInvoker.java:281) [switchyard-component-resteasy-1.1.1-p5-redhat-1.jar:1.1.1-p5-redhat-1]
                ... 394 more
    

Environment

  • Red Hat JBoss Fuse
    • 6.2.x
  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In