Error java.lang.ClassCastException while creating Service Callout with Local Target

Not applicable

Hi,

I'm getting the following error message while trying to create a Service Callout pointing to a Local Target. I've tried copying the configuration from the browser. Didn't work. I've tried typing it up manually to avoid any hidden chars. No luck. Any idea what could be wrong? Thank you in advance!

Error Messge

Server Error. Failed to import the bundle : java.lang.ClassCastException: org.apache.xerces.dom.ElementNSImpl cannot be cast to com.apigee.messaging.config.beans.TargetConnection

Service Callout Configuration

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="GetCreds">
    <DisplayName>GetCreds</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myRequest">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>calloutResponse</Response>
  <LocalTargetConnection><Path>/docs</Path></LocalTargetConnection>
</ServiceCallout>
1 9 1,563
9 REPLIES 9

Not applicable

See the similar issue reported in this thread here : https://community.apigee.com/comments/22300/view.html

Are you using Apigee Cloud or On-Premise installation ?

If On-Premise make sure that you have the version which supports proxy chaining.

Hi Swapnil,

Thank you for your reply!

I'm using Apigee On-Prem. How can I find out if proxy chaining is supported? I was told we're using version 16.

As mentioned by @arghya das in this link : https://community.apigee.com/articles/10959/apigee-edge-adds-proxy-chaining-support-internal-b.html

OPDK v4.16.05.00 will have all the management UI changes for the proxy editor with proxy chaining support.

Hi Swapnil,

Thanks again! I'm using v4.15.07.00 😞

Not applicable

https://community.apigee.com/questions/1306/studying-create-and-manage-apis-while-implementing.html

This issue has come up in the past in the community link above, so it might be worthwhile to read over that. I can also help you further if you provide me your org name or send me the proxy bundle for diagnosis.

Hi Trung,

Thanks for your reply!

The link you're referring to you is about HTTPTargetConnection, which works fine for me. I'm trying to use LocalTargetConnection

adas
Participant V

@Andrei Filippov If you are on 1601 on-prem version you might face this issue because the service callout support was added later. You should be able to do target proxy chaining in 1601 but not for service callouts. This is fixed in a later version. Infact the 1605 will have the UI changes to support proxy chaining for targets as well as service callouts. Hope this helps.

Hi @rghya das

Thanks for the provided information!

The ClassCastException thrown to indicate that your code has attempted to cast an object to a subclass of which it is not an instance. Casting only works when the casted object follows an is a relationship to the type you are trying to cast to.

When will be ClassCastException is thrown:

  • When you try to cast an object of Parent class to its Child class type, this exception will be thrown.
  • When you try to cast an object of one class into another class type that has not extended the other class or they don't have any relationship between them.