wso2 / product-ei

An open source, a high-performance hybrid integration platform that allows developers quick integration with any application, data, or system.
https://wso2.com/integration/
Apache License 2.0
373 stars 280 forks source link

MongoDB Connector. EI 660. Null cannot be built for Synapse Library artifact #5493

Open LLC-BigInt opened 3 years ago

LLC-BigInt commented 3 years ago

Description: Created CAR for example https://ei.docs.wso2.com/en/latest/micro-integrator/references/connectors/mongodb-connector/mongodb-connector-example/ Deployed to WSO2 EI and get errors

ERROR {org.apache.synapse.config.xml.ClassMediatorFactory} - Error in instantiating class : org.wso2.carbon.connector.operations.MongoConfig java.lang.NoClassDefFoundError: org/wso2/carbon/connector/core/connection/Connection

Unable to update status for : {org.wso2.carbon.connector}mongodb :: Template configuration : null cannot be builtfor Synapse Library artifact : init org.apache.synapse.deployers.SynapseArtifactDeploymentException: Template configuration : null cannot be builtfor Synapse Library artifact : init

Affected Product Version: WSO2 EI 6.6.0 MongoDB Connector 1.0.0, 1.0.1

OS - Ubuntu 20.04 Server DB - PostgreSQL

Steps to reproduce:

  1. Create REST
  2. Add connector (from filesystem v.1.0.0 or store v.1.0.1) 2.1. tried to add mongo.init into localEntry (have not to affect when deployed) 2.2. tried to add mongo.init into inSequence (have not to affect when deployed)
  3. Export to CAR with Connector (I can see MongoDB in list of cinnectors)
  4. Deployed to WSO2 EI

Sources

<api context="/mongodbconnector" name="mongodbconnector" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/find">
        <inSequence>
            <mongodb.init>
                <name>connectionURI</name>
                <connectionType>URI</connectionType>
                <database>education</database>
                <connectionURI>mongodb+srv://serverip:27017/?connectTimeoutMS=300000&amp;authSource=aDifferentAuthDB</connectionURI>
            </mongodb.init>
            <mongodb.find configKey="connectionURI">
                <collection>json-eval($.collection)</collection>
                <query>json-eval($.query)</query>
            </mongodb.find>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>
<localEntry key="connectionURI" xmlns="http://ws.apache.org/ns/synapse">
    <mongodb.init>
        <connectionType>URI</connectionType>
        <name>connectionURI</name>
        <connectionURI>mongodb+srv://serverip:27017/?connectTimeoutMS=300000&amp;authSource=aDifferentAuthDB</connectionURI>
        <database>education</database>
    </mongodb.init>
</localEntry>

List files of wso2carbon-home/lib

andes-client-3.3.11.jar           bpmn-sample-jars-6.6.0.jar  esapi-2.0.1.jar                javax.jms-api-2.0.1.jar                 mongo-java-driver-3.11.2-javadoc.jar  org.wso2.securevault-1.1.3.jar  sample-utils-6.6.0.jar
artemis-jms-client-all-2.6.1.jar  cors-filter-2.4.jar         groovy-all-2.1.3.jar           kubernetes-membership-scheme-1.0.7.jar  mysql-connector-java-8.0.11.jar       postgresql-42.2.14.jar          Saxon-HE-9.5.1-8.jar
bcprov-jdk15on-1.60.jar           dnsjava-2.1.8.jar           java-property-utils-1.9.1.jar  mongodb-jdbc-1.0.3-all.jar              ojdbc6.jar                            process-tools-6.6.0.jar

wso2carbon-home/dropins

andes_client_3.3.11_1.0.0.jar           cors_filter_2.4_1.0.0.jar   java_property_utils_1.9.1_1.0.0.jar           mongo-java-driver-3.11.2-javadoc.jar   postgresql_42.2.14_1.0.0.jar
artemis_jms_client_all_2.6.1_1.0.0.jar  dnsjava_2.1.8_1.0.0.jar     javax.jms_api_2.0.1_1.0.0.jar                 mysql_connector_java_8.0.11_1.0.0.jar  process_tools_6.6.0_1.0.0.jar
bcprov_jdk15on_1.60_1.0.0.jar           esapi_2.0.1_1.0.0.jar       kubernetes_membership_scheme_1.0.7_1.0.0.jar  ojdbc6_1.0.0.jar                       sample_utils_6.6.0_1.0.0.jar
bpmn_sample_jars_6.6.0_1.0.0.jar        groovy_all_2.1.3_1.0.0.jar  mongodb_jdbc_1.0.3_all_1.0.0.jar              org.wso2.securevault_1.1.3_1.0.0.jar   Saxon_HE_9.5.1_8_1.0.0.jar
LLC-BigInt commented 3 years ago

I guess this is a bug of WSO2 EI what the driver does not see If, nevertheless, this is a connector error, then please transfer it to the appropriate repository Thank's