AnsweredAssumed Answered

Error Importing Profile Type For Custom Connector

Question asked by ryan.biggs046791 on Mar 15, 2016
Latest reply on May 16, 2018 by ashmita.nowbuth498707

Hello,

 

I am currently working on developing custom browse behavior for a connector. When I attempt to import the response profile type I receive an error: "Failed Processing Profile: java.lang.NullPointerException". After selection the object type, a message appears saying "Operation Successful" followed by the error. There doesn't appear to be a stack trace in any of the logs to help with debugging making this error difficult to track down.

My custom getObjectDefinitions is similar to the following.

 

public ObjectDefinitions getObjectDefinitions(String objectTypeId, Collection<ObjectDefinitionRole> roles)

    {

        try

        {

            String definition = getConnection().getMetadata().getAsJsonObject(objectTypeId).toString(); //Using GSON

            ObjectDefinitions defs = new ObjectDefinitions();

 

            for (ObjectDefinitionRole role : roles) {

                ObjectDefinition def = new ObjectDefinition();

                def = def.withJsonSchema(definition);

                def.setElementName(objectTypeId);

                defs.getDefinitions().add(def);

            }

            return defs;

        } catch (Exception e)

        {

            throw new ConnectorException(e);

        }//end try catch block

    }

 

The JSON that is being put into the definition is similar to the following.

{

      "allOf": [

        {

          "$ref": "#/definitions/JsonEntity"

        },

        {

          "type": "object",

          "properties": {

            "id": {

              "type": "string"

            },

            "createDate": {

              "type": "string",

              "format": "date-time"

            },

            "version": {

              "type": "integer",

              "format": "int32"

            },

            "Discriminator": {

              "type": "string",

              "enum": [

                "ENM"

              ]

            },

            "new": {

              "type": "boolean",

              "default": false

            }

          }

        }

      ]

    }

 

The JSON passed into the object definition imported into a JSON profile from the Boomi UI correctly, and can be used as a profile from there.

I am adding definitions per role due to the way Javadoc defines the way the function works: "There must be a definition for each "required" role for a given OperationType." although I am not certain this is correct. Because there is nothing in the logs, I cannot be certain that this function is causing the issue, but the reference to the profile leads me to believe this is the case.

It seems to me that the most likely cause of the error is the JSON that is getting passed. Javadoc says that the connector supports JSON schema specification V4 which this should conform to (it is retrieved from swagger documentation).

 

Thanks in advance for any feedback.

Outcomes