KB-1097 "Illegal attempt to change the data type for smart service x.x.x, input or output named <name>" error thrown during plugin deployment

Symptoms

Deployment or redeployment of a plugin fails with the following error recorded in the application server log:

ERROR com.appiancorp.plugins.LoggingPluginEventListener - Failed to enable Plug-in 'My Plugin' (com.abc.plugins.myplugin) version 1.0.0: 'The Smart Service Module was invalid: Illegal attempt to change the data type for smart service com.abc.plugins.myss, input or output named myInput (APNX-1-4104-005)'

Cause

The smart service has an input or output type that is a custom data type. For example:

@Input(required = Required.ALWAYS)
@Name("myInput")
@Type(namespace = "http://types.appiancorp.com/ps", name = "MyCDT")

When the plugin is deployed for the first time, the smart service is internally registered with the input or output mapped to this CDT.

If for some reason this CDT was modified manually or through an import, the original version that the smart service is mapped to gets deprecated and renamed internally by appending the caret symbol and a number such as MyCDT^1. The local ID however, remains the same and consequently, the smart service input or output is now mapped to MyCDT^1.

When the plugin is redeployed (either manually or during a restart), Appian validates the smart service input or output and notes that the type is MyCDT. Internally however, the mapped type is now MyCDT^1. As a result, Appian detects a conflict and throws the observed error in the logs.

Action

There are two steps to be followed in this scenario:

  1. Change the appropriate annotations in the smart service to reference the originally mapped CDT. This will ensure that the error is no longer encountered during deployment. For example:

    @Input(required = Required.ALWAYS)
    @Name("myInput")
    @Type(namespace = "http://types.appiancorp.com/ps", name = "MyCDT^1")
    
  2. If the deletion of the CDT was intentional so as to change its structure, then the existing smart service that maps to the original CDT will need to be deprecated following the best practices. A new smart service will then need to be created that maps to the current CDT version and structure.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: September 2019

Related
Recommended