I suggest upgrading your httpclient libs to the latest, and updating your
axis2.xml as shown below.

You can see how this error was resolved for another user in this Jira
issue.

https://issues.apache.org/jira/browse/AXIS2-5740

The upcoming Axis2 release will only support the latest httpclient libs.
Remove the httpclient 3.x libs and replace as shown below.

                 <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <version>4.5.13</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                    <version>4.4.13</version>
                </dependency>

axis2.xml:

 <transportSender name="http"

 
class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>

        <!-- If following is set to 'true', optional action part of the
Content-Type will not be added to the SOAP 1.2 messages -->
        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
    </transportSender>

    <transportSender name="https"

 
class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>

Regards,
Robert

On Sat, Dec 5, 2020 at 11:34 PM Levi, Yogev <[email protected]> wrote:

>
>
> Frid, Michael ++
>
>
>
>
>
> BR,
>
> *Yogev Levi*
>
> Senior Software Engineer
>
> *TEOCO Ltd.*
>
> c:
>
> +972 52 4455 708
>
> p:
>
> +972 3 9269752
>
> *E-mail: [email protected] <[email protected]>*
>
> www.teoco.com
>
>
>
>
>
> *From:* Levi, Yogev
> *Sent:* Sunday, December 6, 2020 11:32 AM
> *To:* [email protected]
> *Subject:* java.lang.ClassCastException:
> org.apache.commons.httpclient.Header cannot be cast to
> org.apache.axis2.context.NamedValue
>
>
>
>
>
> server-to-server SOAP call doesn’t work, because for some reason by
> default axis2 tries to use httpClient transport (instead of
> commons-httpClient) for sending and fails.
>
>
>
> Any idea why and how to fix it?
>
> I attached the axis2.xml
>
>
>
> Caused by: java.lang.ClassCastException:
> org.apache.commons.httpclient.Header cannot be cast to
> org.apache.axis2.context.NamedValue
>
>                 at
> org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.addCustomHeaders(HTTPSenderImpl.java:884)
>
>                 at
> org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.executeMethod(HTTPSenderImpl.java:845)
>
>                 at
> org.apache.axis2.transport.http.impl.httpclient3.HTTPSenderImpl.sendViaPost(HTTPSenderImpl.java:212)
>
>                 at
> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:121)
>
>                 at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:403)
>
>                 at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:234)
>
>                 at
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:431)
>
>                 at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:399)
>
>                 at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
>
>                 at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
>
>                 at
> tti.jcore.soa.service.JCoreServiceStub.getLoggedInUserApplicationRoleActions(JCoreServiceStub.java:2207)
>
>                 at
> tti.jcore.soa.service.JCoreServiceImpl.getLoggedInUserApplicationRoleActions(JCoreServiceImpl.java:916)
>
>                 ... 43 more
>
>
>
>
>
>
>
> BR,
>
> *Yogev Levi*
>
> Senior Software Engineer
>
> *TEOCO Ltd.*
>
> c:
>
> +972 52 4455 708
>
> p:
>
> +972 3 9269752
>
> *E-mail: [email protected] <[email protected]>*
>
> www.teoco.com
>
>
>
>
>
> ------------------------------
>
> PRIVILEGED AND CONFIDENTIAL
> PLEASE NOTE: The information contained in this message is privileged and
> confidential, and is intended only for the use of the individual to whom it
> is addressed and others who have been specifically authorized to receive
> it. If you are not the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, or if any
> problems occur with transmission, please contact sender. Thank you.
>

Reply via email to