Waiting for engine...
Skip to main content

Enabling strict class loading mode for Connectors

Background

Historically, containers have provided certain common libraries that could be used by connectors utilizing the Connector SDK. Having these “shared” libraries allowed Connector archive files to be much smaller than otherwise. Although having shared libraries comes with some other benefits, it is ultimately unmanageable and makes connectors susceptible to breakage if and when shared libraries are updated/removed. These libraries may be updated or removed for various reasons, including: addressing security vulnerabilities, leveraging new features, compatibility with other libraries/frameworks, etc. Ultimately, the shared library model comes at a cost to the stability, security, and maintenance of containers and connectors alike.

In order to transition away from this model, Boomi will be introducing a new class loading mode for connectors. This new model will effectively cut off access to the shared libraries. This means that every connector must package all third party libraries (previously provided by the containers) that are required for successful process executions.

Strict Class Loading

In preparation for the container’s new class loading mode, Boomi is introducing a feature to assist Connector Developers in updating and testing their connectors. Boomi is exposing a strictClassLoading flag to the Connector’s Runtime Configuration file (connector-config.xml) that will function as a mechanism to opt-in to the new strict class loading mode ahead of forced mandate. This provides an interruption-free path for connectors to update and validate their connectors in the future mode.

Usage

Three steps are required to prepare a connector to run in strict class loading mode.

  1. The first step is to package all the third party libraries that the connector needs to execute within the Connector archive file itself.

  2. The second step is to update the Connector’s Runtime Configuration to indicate that it should be using the strict class loader.

  3. The third step is to update the Connector SDK version to 2.23.2 or later.

Packaging

In order for a connector to run smoothly in strict class loading mode, it needs to ensure that all the execution time third party dependencies, needed by the connector, are packaged within the connector archive file. The connector must not assume that any such libraries will be provided by the runtime container during execution.

To avoid unintended functional changes, make sure that you package the same version of the dependencies that were provided by the container. You may update these dependencies, of course, but that may require further validation and possibly code changes to address deprecations or undesirable functional differences.

Go through the following checklist to ensure all the third party dependencies are included in the generated archive:

Packaging checklist

  1. Review the dependencies declared in the build file

    1. Ensure your dependency scopes are correct
      1. For example:
        1. Maven dependencies scoped as runtime and provided are not packaged by default
        2. Gradle dependencies declared as implementation are not packaged by default
  2. Review your packaging configurations

    1. For Maven builds, ensure that you are not excluding or filtering out necessary dependencies in your Assembly Descriptor
    2. For Gradle builds, ensure that that you are not excluding necessary dependencies in your build.gradle file
  3. Review your generated Connector archive file to ensure that all necessary dependencies are included.

Tip

You should not package the connector-sdk-api with your connector (regardless of if you enable strict class loading mode or not). Those classes and interfaces are always provided in the class loader running your connector code.

Previously provided Artifacts

The following is a list of artifacts that were previously included in the container but will not be accessible for your connector when operating in Strict mode:

GroupArtifactCurrent Version
com.boomi.regexboomi-regex2.0.0
com.boomi.restlet.utilboomi-restlet-util3.0.4
com.boomi.securityboomi-security1.1.6
com.boomi.utilboomi-json-util1.1.10
com.boomi.utilboomi-util3.0.14
com.boomi.utilcommon-lite1.1.0
com.boomi.vaultcontainer-api01.06.2
com.fasterxml.jackson.corejackson-annotations2.13.4
com.fasterxml.jackson.corejackson-core2.12.4
com.fasterxml.jackson.corejackson-databind2.12.4
com.github.ben-manes.caffeinecaffeine2.8.6
com.github.stephenc.jcipjcip-annotations1.0-1
com.google.errorproneerror_prone_annotations2.18.0
com.google.protobufprotobuf-java3.19.6
com.healthmarketscience.commoncommon-util1.0.2
com.healthmarketscience.sqlbuildersqlbuilder2.0.13
com.nimbusdsnimbus-jose-jwt9.37.2
com.noelios.restletcom.noelios.restlet.ext.net1.0.11
com.noelios.restletcom.noelios.restlet1.0.11
com.sun.activationjakarta.activation2.0.0
com.sun.istackistack-commons-runtime3.0.8
com.sun.org.apache.xml.internalresolver20050927
com.sun.xml.bindjaxb-impl2.1.17
com.sun.xml.fastinfosetFastInfoset1.2.16
com.sun.xml.messaging.saajsaaj-impl1.3.2
com.sun.xml.stream.bufferstreambuffer0.8
com.sun.xml.wsjaxws-rt2.1.5
commons-codeccommons-codec1.15
commons-langcommons-lang2.5
commons-loggingcommons-logging1.1.1
dom4jdom4j1.6.1
io.jsonwebtokenjjwt0.9.0
jakarta.activationjakarta.activation-api1.2.1
jakarta.xml.bindjakarta.xml.bind-api2.3.2
javax.activationactivation1.1
javax.activationjavax.activation-api1.2.0
javax.annotationjsr250-api1
javax.mailmail1.4.7
javax.xml.bindjaxb-api2.3.1
javax.xml.soapsaaj-api1.3
javax.xml.wsjaxws-api2.1-1
jaxenjaxen1.1
jdomjdom1
org.apache.commonscommons-lang33.8.1
org.apache.lucenelucene-core3.5.0-boomi4
org.apache.mavenmaven-artifact3.6.3
org.apache.oltu.oauth2org.apache.oltu.oauth2.client1.0.0
org.apache.oltu.oauth2org.apache.oltu.oauth2.common1.0.0
org.bouncycastlebcmail-jdk15to181.7
org.bouncycastlebcmail-jdk161.45.boomi1
org.bouncycastlebcpg-jdk15to181.7
org.bouncycastlebcpg-jdk161.45
org.bouncycastlebcpkix-jdk15to181.7
org.bouncycastlebcprov-jdk15to181.7
org.bouncycastlebcprov-jdk161.45
org.bouncycastlebcutil-jdk15to181.7
org.checkerframeworkchecker-qual3.33.0
org.codehaus.plexusplexus-utils3.2.1
org.codehaus.woodstoxwstx-asl3.2.9
org.glassfish.jaxbjaxb-runtime2.3.2
org.glassfish.jaxbtxw22.3.2
org.hamcresthamcrest-core2.2
org.hamcresthamcrest2.2
org.jsonjson20131018
org.jvnet.staxexstax-ex1.2
org.jvnetmimepull1.3
org.restletorg.restlet1.0.11
org.slf4jslf4j-api1.7.30
org.slf4jslf4j-jdk141.7.30
staxstax-api1.0.1
Important

If a com.boomi.Overrides file was previously used to selectively override artifacts, it will be ignored. Strict class loading mode supersedes the overrides configuration and expects the connector to package any and all third party libraries that it requires to function properly.

Update Configuration

If you are using Boomi’s Connector Gradle Plugin, the connector-config.xml file will automatically be generated when the strictClassLoading attribute set to true starting with version 0.5.1. This means upgrading your com.boomi.connector Gradle plugin to 0.5.1 will automatically opt you into strict class loading.

To opt into strict class loading mode, you will need to update the Connector’s Runtime Configuration file. You can do this manually by setting the strictClassLoading attribute to true and updating the SDK version to at least 2.23.2. For example:

<?xml version="1.0"?>
<GenericConnector sdkApiVersion="2.23.2" strictClassLoading="true">
<connectorClassName>com.boomi.connector.sample.SampleConnector</connectorClassName>
</GenericConnector>

The default for strictClassLoading is false, in which case it will run in whichever the default class loading mode the container is set to. In the future, this default mode will be set to strict.

Refer to the Connector SDK changelogs when updating your connector.

Testing and Validation

As you iterate through the previous steps, it is crucial that you test the connector. You should upload the connector to your Boomi Enterprise Platform account and test that all of the functionality is as expected. If you have set the strictClassLoading attribute to true but failed to include a required library you may encounter an error similar to:

Caused by: \<ThirdPartyClassName\> referenced from a method is not visible from class loader:com.boomi.connector.factory.ConnectorManager$ConnectorClassLoader@1052f423

Or:

java.lang.NoClassDefFoundError: <ThirdPartyClassName>

In preparation for this new class loading mode, Boomi has updated the Connector archive upload size limit to account for the increased size of Connectors. The new limit is set to 40MB. If your account requires an even larger limit to be approved, please contact your Boomi representative and they can assist you with this request.

On this Page