Getting Error while creating object

Not applicable

Hi,

I am getting the below error while creating a simple assign message.It is not allowing me to save the API. Failed to import the bundle : java.lang.ClassCastException: com.apigee.steps.assignmessage.AssignMessageBean cannot be cast to com.apigee.messaging.config.beans.Proxy.

3 2 591
2 REPLIES 2

Hi, sorry you're having trouble.

I think it might be a copy/paste problem.

Sometimes when using the API Proxy editor, people can run into copy/paste errors. Once I saw someone who had copied the XML from a policy,... into the window that contains the XML for the API Proxy. This might be what happened to you, too.

What I mean is this:

1552-api-proxy-editor-1.png

If you paste the XML for AssignMessage into the XML pane, you will get the error you described. I just tried it and this is what I see:

1554-api-proxy-editor-2.png

What you need to do is take care to be selecting the AssignMessage policy when you paste in the XML for AssignMessage. Pasting "policy XML" into the ProxyEndpoint definition, will not lead to bliss.

Thanks for your response.

But i was not doing copy paste. I simply used the assign message policy. I removed some part of the message and kept only assign variable part. PFB the code

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-2"> <DisplayName>Assign Message-2</DisplayName> <Properties/> <AssignVariable> <Name>abc.clientID</Name> <Ref>request.header.key</Ref> </AssignVariable> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/> </AssignMessage>