Hi Todd,

Resource in [1] may be a good reference for you.

[1]
https://github.com/R-Rajkumar/samples/blob/master/message-builder-handler/pom.xml

Thanks,
Harsha

On Mon, Sep 4, 2017 at 10:16 PM, Todd Hill <[email protected]> wrote:

> meant to send it to the DEV list too.
>
>
> ---------- Forwarded message ---------
> From: Todd Hill <[email protected]>
> Date: Mon, Sep 4, 2017 at 11:38 AM
> Subject: Re: [Dev] Custom API handler gets ClassNotFoundException
> To: Harsha Kumara <[email protected]>
>
>
> The profile I'm using is 'apim' (as opposed to the 'esb' profile). The
> <packaging>bundle</packing> is comment out because I wasn't able to get
> that working either.
>
>
> On Mon, Sep 4, 2017 at 11:35 AM Harsha Kumara <[email protected]> wrote:
>
>> Hi Todd,
>>
>> Can you attach the pom.xml of your custom handler?
>>
>> Thanks,
>> Harsha
>>
>> On Mon, Sep 4, 2017 at 9:58 PM, Todd Hill <[email protected]> wrote:
>>
>>> Sorry if this is not the right place to send questions about writing a
>>> custom Handler for WSO2 API Manager 2.1.0, but I don't see any other places
>>> listed.
>>>
>>> I have written a custom handler that worked well with WSO2 ESB 4.8.0. We
>>> are migrating to using the API Manager v2.1.0, so I updated the maven
>>> dependencies, but now after I put the jar into 
>>> <APIM_HOME>/repository/components/lib
>>> and restart the API Manager, I get this when my Handler class is invoked:
>>>
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.synapse.core.axis2.Axis2MessageContext cannot be found by
>>> esb.poc_1.0_SNAPSHOT_1.0.0
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
>>> BundleLoader.java:501)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
>>> BundleLoader.java:421)
>>> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
>>> BundleLoader.java:412)
>>> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
>>> DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>>
>>>
>>> Here is the method in the handler:
>>>
>>> private void processPayload(CaosDecisionMakingData decisionMakingData,
>>> MessageContext mc){
>>> try {
>>> RelayUtils.buildMessage(((Axis2MessageContext)
>>> mc).getAxis2MessageContext());
>>> } catch (IOException e) {
>>> throw new RuntimeException(e);
>>> } catch (XMLStreamException e) {
>>> throw new RuntimeException(e);
>>> }
>>> OMElement restPayload = mc.getEnvelope().getBody().getFirstElement();
>>> if (restPayload != null) {
>>> decisionMakingData.setPostBodyElement(restPayload);
>>> }
>>> }
>>>
>>> The line with RelayUtils containing the cast is where the problem is.
>>>
>>>
>>> Thanks for any help or direction you can give.
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Harsha Kumara
>> Software Engineer, WSO2 Inc.
>> Mobile: +94775505618 <+94%2077%20550%205618>
>> Blog:harshcreationz.blogspot.com
>>
>


-- 
Harsha Kumara
Software Engineer, WSO2 Inc.
Mobile: +94775505618
Blog:harshcreationz.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to