. . .

Update your Native Module to the current version

Since ApiOmat version 2.5.0 we provide a new mechanism to update modules after updating Yambas to the new version. Additionally, we list any information about upgrading your module to the new version on this page.

General update information

Due to the new update mechanism in ApiOmat 2.5.0, any native module update, starting with the update to this version, should be possible with the following steps.

  1. Execute the Ant task downloadNativeModule to get the latest state of your module, its contained code and dependent libraries from your freshly updated ApiOmat installation.

  2. Update the values for fromVersion and toVersion in your sdk.properties file (or set them initially, if you've freshly updated to version 2.5) e.g.:

    additional entries in sdk.properties, example values
    fromVersion=2.4.0
    toVersion=2.5.0
  3. Execute the Ant task updateVersion to run the update scripts. After that step, your IDE shouldn't show any errors (after a refresh of the project).

  4. Execute the Ant task uploadNativeModule to upload your updated module on the ApiOmat installation.

In general, that should be enough to update your module. If you have to change additional things, you will find these information on the next sections. We also list the steps, the updateVersion task will do.

You can leave out either the fromVersion to execute all integrated steps until the version specified in toVersion, or you leave out toVersion to execute all steps after the specified fromVersion in the sdk.properties file.

Be sure that you update your modules in the correct order. Start with the module on the "lowest level" and go up to the module on top of the used module hierarchy.

For example: You have a JDBC module containing any base operation to work with databases and one module for MySQL which uses the JDBC module which contains the database specific operations for MySQL. In that case, you have to execute the whole update process (download, update, upload) for the JDBC module first, and then execute that for MySQL.

ApiOmat 2.5.0

Updated libraries:

  • swagger-annotations (from version 1.5.10 to 1.5.12)

  • jersey-core (from version 1.16 to 1.19, this brings the jsr311-api library in version 1.1.1, which was bundled into the jersey-core library in 1.16)

  • anttask library and the new nativemodule-base library

The newly nativemodule-base library now bundles all static classes (except the Status file) which can't be edited by you in one library.

The updateVersion task deletes the old swagger-annotations and jersey-core libraries (from filesystem, classpath and the pom.xml dependencies). The new libs have been added to the classpath and pom.xml automatically by downloading the module. The task will also remove the following static classes from the filesystem and the directories interfaces/dmap and interfaces if they're empty after removing the files.

Removed files (now included in nativemodule-base.jar):

  • AbstractClientDataModel.java

  • AbstractRestResource.java

  • AuthState.java

  • CustomerRole.java

  • DynamicAttribute.java

  • EmbeddedDocument.java

  • IApplicationConfigProxy.java

  • IModel.java

  • IModelHooks.java

  • IModelHooksCommon.java

  • IModelHooksNonTransient.java

  • IModelHooksTransient.java

  • IModelMethods.java

  • IModule.java

  • IResourceMethods.java

  • IStaticMethods.java

  • Mandatory.java

  • Model.java

  • Module.java

  • NativeModuleConfig.java

  • Request.java

  • SecurityPermission.java

  • StaticData.java

  • UserRole.java

  • interfaces/dmap/ADistributedMapHandler.java

  • interfaces/dmap/IDistributedMap.java

  • interfaces/dmap/IDistributedMapEntryEvent.java

  • interfaces/dmap/IDistributedMapHandler.java

  • interfaces/dmap/IDistributedMapListener.java

  • interfaces/dmap/package-info.java

Note that it is necessary that you remove the old files either manually or by executing the ant target updateVersion. Otherwise, there may be the chance that your IDE takes these old files instead of the newer ones packaged in the nativemodule-base.jar.As of version 2.5 of ApiOmat, it is possible to use libraries in native modules independently from the library version used by ApiOmat for a lot of internally used libraries.This means, on the one hand, that you now have to provide some implementation libraries, which weren't necessary before, as they were delivered by ApiOmat, for the corresponding API libraries you use. An example for that is the javax-mail-api library, which provides the necessary interfaces. Until version 2.5 you were bound to use javax.mail-api in version 1.4.5 and you didn't have to add javax.mail-mail as we provided it. After ApiOmat version 2.5, you'll have to add javax.mail-mail by yourself. On the other hand, you're not bound to the specific version anymore and there should be no problems if you use, for example, a newer version. Be aware that some libraries we use internally (such as spring or morphia and the mongodb driver) also cannot be used in native modules, as this would lead to linkage errors. In that case, you have to switch back to the old behaviour by setting the property yambas.useOldClassloader to true in your apiomat.yaml. Read more about that in Native Module specific notes and limitations

* link only available in Enterprise Documentation