Original Message:
Sent: Thu March 07, 2024 03:40 AM
From: Muhammad Uzair Arif
Subject: User defined Connector - ClassCastException
Hi Francois,
Thanks for following up, I am using the below documentation link to develop the connector:
https://www.ibm.com/docs/en/app-connect/12.0?topic=connectors-developing-connector-app-connect-enterprise-runtime-environment
With respect to the implementation, I have just implemented the method with respect to the input connector for the AbstractConnectorFactory and the AbstractInputConnector. However, the AbstractConnectorFactory has methods for output and request connector, For them since they aren't part of my use case I just left their implementation as is and just returned null. Do you think that would be causing an issue ?
Also, parallely I'll do some logging to the sys logs in the code and let's see if I can figure something out by doing that.
------------------------------
Muhammad Uzair Arif
------------------------------
Original Message:
Sent: Thu March 07, 2024 12:54 AM
From: Francois Brandelik
Subject: User defined Connector - ClassCastException
So you have 2 classes that are meant to be the implementors of a connection factory and of an input connector.
You showed the class names but not the class content. I believe that you are not satisfying the contract of implementing a concrete method where one is needed?
You say you follow the documentation, can you please provide the URL to the documentation you followed?
------------------------------
Francois Brandelik
Original Message:
Sent: Thu March 07, 2024 12:03 AM
From: Muhammad Uzair Arif
Subject: User defined Connector - ClassCastException
Hi Francois,
I was thinking in the same direction that it'll be a very simple configuration issue, and I am sure it'll be something like hey you missed out that and it'll start workling.
So basically I re-made the connector following the docs and below are the java files that I am using:
@Ben, @Francois, Can you guys give the below details a quick look and let me know if you find any issue
Connector Factory class:
package: com.connector.rabbit
class: RabbitMQConnectorFactory extends AbstractConnectorFactory
Input Connector class:
package: com.connector.rabbit
class: RabbitMQInputConnector extends AbstractInputConnector
connector.xml file contents:
<?xml version="1.0" encoding="UTF-8"?>
<connectorProvider name="RabbitMQConnector">
<connectorFactory className="com.connector.rabbit.RabbitMQConnectorFactory">
<properties>
<property name="name1" value="value1"/>
</properties>
</connectorFactory>
</connectorProvider>
Below is the configuration done in the node.conf.yaml file for it to pick the connector:
ConnectorProviders:
RabbitMQConnector:
connectorClassName: 'com.connector.rabbitmq.RabbitMQConnectorFactory'
jarsURL: '/var/mqsi/connectors/RabbitMQConnector2/' # absolute path
nativeLibs: 'dafault_Path' # absolute path or special value "default_Path"
------------------------------
Muhammad Uzair Arif
Original Message:
Sent: Wed March 06, 2024 03:01 AM
From: Francois Brandelik
Subject: User defined Connector - ClassCastException
Somewhere in your class definition, you must have forgotten an implements or an extends...
This is why the class cast can't happen.
Hope it helps
------------------------------
Francois Brandelik