Scripting commands in MoRE

IBM® Modernized Runtime Extension for Java™ (MoRE) introduces new wsadmin commands, properties, and supported values for managed Liberty servers. MoRE also changes the default values for some command parameters.

AdminTask.createManagedLibertyServer

The createManagedLibertyServer command creates a managed Liberty server. Specify the name of the node on which to create the server and the name of the managed Liberty server.

AdminTask.createManagedLibertyServer('node_name', ['-name', 'mls_server_name'])

The following example command creates the mls1 managed Liberty server on the MyNode01 node.

AdminTask.createManagedLibertyServer('MyNode01', ['-name', 'mls1'])

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

AdminTask.listServers

The listServers command with the MANAGED_LIBERTY_SERVER server type returns a list of managed Liberty servers.

AdminTask.listServers('[-serverType MANAGED_LIBERTY_SERVER ]')

The following example returned list includes information about the mls2 and mls1 servers on the node.

u'mls2(cells/MyCell01/nodes/MyNode01/servers/mls2|server.xml)
\r\nmls1(cells/MyCell01/nodes/MyNode01/servers/mls1|server.xml)'

For more information, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[Network Deployment 9.0.5.24 or later]

AdminTask.createCluster

The createCluster command with the MANAGED_LIBERTY_SERVER cluster type creates a cluster to which you can add managed Liberty servers as cluster members. The following example command creates a cluster named cluster1 with the MANAGED_LIBERTY_SERVER cluster type.

AdminTask.createCluster(['-clusterConfig', ['-clusterName', 'cluster1',
 '-clusterType', 'MANAGED_LIBERTY_SERVER']])

For more information, see ClusterConfigCommands command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[1.0.1.0 and later][Network Deployment 9.0.5.26 or later]

AdminTask.listManagedLibertyInstallations

The listManagedLibertyInstallations command lists the locations and versions of each Liberty installation available to a specified node. The following example command lists information about the Liberty installations on the node1 node.

AdminTask.listManagedLibertyInstallations(‘[-nodeName node1]')

The following example returned list includes the locations and versions of the Liberty installations on the node1 node.

[[location /opt/liberty/wlp] [version 25.0.0.11] ]
[[location /opt/liberty2/wlp] [version 25.0.0.8] ]

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[1.0.1.0 and later][Network Deployment 9.0.5.26 or later]

AdminTask.getConfiguredManagedLibertyInstallation

The getConfiguredManagedLibertyInstallation command returns the location and version of the configured Liberty installation of a specified node. The configured Liberty installation is the Liberty installation that a node uses to run managed Liberty servers. The following example command returns information about the configured Liberty installation of the node1 node

AdminTask.getConfiguredManagedLibertyInstallation('[-nodeName node1]')

The following returned example includes the location and version of the configured Liberty installation of the node1 node.

[[location /opt/liberty/wlp] [version 25.0.0.11] ]

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[1.0.1.0 and later][Network Deployment 9.0.5.26 or later]

AdminTask.setConfiguredManagedLibertyInstallation

The setConfiguredManagedLibertyInstallation command sets the specified Liberty installation location as the configured Liberty installation of a specified node. The following example command sets the Liberty installation location, /opt/liberty2/wlp, as the configured Liberty installation for the node1 node.

AdminTask.setConfiguredManagedLibertyInstallation(‘[-nodeName node1 -location /opt/liberty2/wlp]’)

All managed Liberty servers running on a specified node must be stopped before you switch Liberty installations on the node. After the Liberty installation is switched, the node must be synced before any managed Liberty servers are started.

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[1.0.1.0 and later][Network Deployment 9.0.5.26 or later]

AdminTask.installJakartaMQResourceAdapter

The installJakartaMQResourceAdapter command copies a Jakarta MQ resource adapter with a specific resource adapter archive (RAR) file name to a named node. The Jakarta MQ resource adapter is used by the wmqMessagingClient feature in any managed Liberty servers on the named node. The following example command copies the Jakarta MQ resource adapter installation location, /tmp/wmq/wmq.jakarta.jmsra.rar, as the configured Liberty Jakarta MQ resource adapter for the node1 node.

AdminTask.installJakartaMQResourceAdapter('[ [-nodeName node1] [-path /tmp/wmq/wmq.jakarta.jmsra.rar] ]')

Before rolling back to an earlier version of WebSphere® Application Server traditional on a node when a Jakarta MQ resource adapter is installed, the resource adapter must be uninstalled from the node.

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[1.0.1.0 and later][Network Deployment 9.0.5.26 or later]

AdminTask.uninstallJakartaMQResourceAdapter

The uninstallJakartaMQResourceAdapter command removes a Jakarta MQ resource adapter from a node. The Jakarta MQ resource adapter is no longer allowed to be used by the wmqMessagingClient feature in any managed Liberty server on the named node. The following example removes the Jakarta MQ resource adapter from the node1 node.

AdminTask.uninstallJakartaMQResourceAdapter('[ [-nodeName node1] ]')

For information about similar commands, see ServerManagement command group for the AdminTask object in the Network Deployment 9.0.5 documentation.

[Network Deployment 9.0.5.24 or later]

AdminConfig.create

The create command associates shared libraries to an application.
AdminConfig.create('LibraryRef', appClassLoader, [ ['libraryName', 'MySharedLibrary'] ])

For more information, see Configuring a shared library for an application using wsadmin scripting in the Network Deployment 9.0.5 documentation.

[Network Deployment 9.0.5.25 or later]

AdminApplication.configureClassLoaderLoadingModeForAnApplication

The configureClassLoaderLoadingModeForAnApplication script configures the class loader loading mode for an application. Specify the name of the application and the name of the class loader loading mode.

AdminApplication.configureClassLoaderLoadingModeForAnApplication(appName, classloaderMode)

The following example sets the class loader loading mode for the MyJakartaEEApplication application to PARENT_LAST.

AdminApplication.configureClassLoaderLoadingModeForAnApplication("MyJakartaEEApplication", "PARENT_LAST")

For more information about application deployment script procedures, see Application deployment configuration scripts in the Network Deployment 9.0.5 documentation.

[Network Deployment 9.0.5.24 or later]

AdminApp.edit

The MapSharedLibForMod option for the AdminApp command associates shared libraries to the application.
AdminApp.edit(appName, '[-MapSharedLibForMod [ [appName
      META-INF/application.xml libraryName] ]]' )

For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.

AdminApp.install

Some application options for the install command have different default values or behaviors when you install a Jakarta EE 10 application on a managed Liberty server.

  • The useMetaDataFromBinary option is the default when you install a Jakarta EE 10 application on a managed Liberty server. The nouseMetaDataFromBinary option, the default for application installation on a WebSphere Application Server traditional target runtime, will fail.

  • If the nodistributeApp option is used, the deployment will fail in MoRE.

  • The metadata-complete attribute of the MetadataCompleteForModules option does not apply for applications that are targeted to a managed Liberty server and, if set, the metadata-complete attribute is ignored.

  • Several application options are unavailable when you install a Jakarta EE 10 application on a managed Liberty server.

    • [Network Deployment 9.0.5.24 or later]asyncRequestDispatchType
    • preCompileJSPs
    • deployejb
    • createMBeansForResources
    • [Network Deployment 9.0.5.24 or later]reloadEnabled
    • [Network Deployment 9.0.5.24 or later]reloadInterval
    • deployws
    • processEmbeddedConfig
    • [Network Deployment 9.0.5.24 or later]filepermission
    • [Network Deployment 9.0.5.24 or later]installed.ear.destination
    • [Network Deployment 9.0.5.24 or later]blaname
    • [Network Deployment 9.0.5.24 or later]enableClientModule
    • [Network Deployment 9.0.5.24 or later]clientMode
    • [Network Deployment 9.0.5.25 or later]edition
    • [Network Deployment 9.0.5.25 or later]edition.desc
    • [Network Deployment 9.0.5.25 or later]allowDispatchRemoteInclude/noallowDispatchRemoteInclude
    • [Network Deployment 9.0.5.25 or later]allowServiceRemoteInclude/noallowServiceRemoteInclude

    The following previously unavailable application option is available when you install a Jakarta EE 10 application on a managed Liberty server.

    • [Network Deployment 9.0.5.25 or later]useAutoLink
    [Network Deployment 9.0.5.24 or later]Use the command option MapSharedLibForMod to associate shared libraries to the application.
    AdminApp.install(appArchivePath, '… [-MapSharedLibForMod [ [appName
          META-INF/application.xml libraryName] ]]' …)

For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.

AdminApp.installInteractive

MoRE adds the targetRuntime option. After you run the installInteractive command, the targetRuntime option is shown. The default value is WebSphere Application Server traditional. To install your application on a managed Liberty server, specify WebSphere Liberty.

AdminApp.installInteractive('EE10.ear/.war')
targetRuntime : WebSphere Application Server traditional/WebSphere Liberty : 
   [WebSphere Application Server traditional] WebSphere Liberty

After you specify WebSphere Liberty for targetRuntime, complete Task[1]: Specifying application options selections. As with the install command, some application options for the installInteractive command have different default values or behaviors when you install a Jakarta EE 10 application on a managed Liberty server.

  • Use Binary Configuration is set to Yes, and you cannot change it.

    Task[1]: Specifying application options
        Use Binary Configuration: [Yes]:

    The default for application installation on a WebSphere Application Server traditional target runtime is No.

  • [Network Deployment 9.0.5.24 or later]During application edit or update, the Distribute application and Use Binary Configuration options are not shown. Both options are set to Yes. If you change the value for an option to No for application installation on a managed Liberty server or cluster target runtime, the deployment fails.
    Task[1]: Specifying application options
        Distribute application: [Yes]:
        Use Binary Configuration: [Yes]:
    
  • Several application options are unavailable when you install a Jakarta EE 10 application on a managed Liberty server.

    With the installInteractive command, the following options are unavailable for application installation on a WebSphere Liberty target runtime, and are shown with the following settings.

    [Network Deployment 9.0.5.23 only]The following options are unavailable in 9.0.5.23 only.
    Task[1]: Specifying application options
        Precompile JavaServer Pages files: [No]:
        Deploy enterprise beans: [No]:
        Create MBeans for resources: [Yes]:
        Deploy Web services: [No]:
        Process embedded configuration: [No]:
        Allow EJB reference targets to resolve automatically: [No]:
    [Network Deployment 9.0.5.24 or later]The following options are unavailable for 9.0.5.24 and later.
    Task[1]: Specifying application options
        Asynchronous request dispatch type: [No]:
        Precompile JavaServer Pages files: [No]:
        Directory to install application: []:
        Deploy enterprise beans: [No]:
        Create MBeans for resources: [Yes]:
        Override class reloading settings for Web and EJB modules: [No]:
        Reload interval in seconds: []:
        Deploy Web services: [No]:
        Process embedded configuration: [No]:
        File permission: [..dll=755#..so=755#..a=755#..sl=755]:
        Business level application name: []:
        Allow EJB reference targets to resolve automatically: [No]:
        Deploy client modules: [No]:
        Client deployment mode: [isolated]:
    [Network Deployment 9.0.5.25 or later]The following options are available for 9.0.5.25 and later.
    Task[1]: Specifying application options
        Asynchronous request dispatch type: [No]:
        Precompile JavaServer Pages files: [No]:
        Directory to install application: []:
        Deploy enterprise beans: [No]:
        Create MBeans for resources: [Yes]:
        Override class reloading settings for Web and EJB modules: [No]:
        Reload interval in seconds: []:
        Deploy Web services: [No]:
        Process embedded configuration: [No]:
        File permission: [..dll=755#..so=755#..a=755#..sl=755]:
        Business level application name: []:
        Deploy client modules: [No]:
        Client deployment mode: [isolated]:
        Application edition: []:
        Edition description: []:
        Allow dispatching includes to remote resources: [No}:
        Allow servicing includes from remote resources: [No]:

    The options are available for application installation on a WebSphere Application Server traditional target runtime.

For more information, see Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin scripting in the Network Deployment 9.0.5 documentation.

[Network Deployment 9.0.5.25 or later]

SDK commands for the AdminTask object

Several admin tasks exist for configuring the Java SDK to use at the node and server level.

The AdminSDKCmds command group for the AdminTask object includes the following SDK commands.
  • getNodeDefaultSDK
  • setNodeDefaultSDK
  • getServerSDK

    When the getServerSDK command runs on a traditional application server, it returns the Java 8 SDK even if that server is on a MoRE enabled node.

  • setServerSDK
  • getSDKVersion
  • getUnusedSDKsOnNode
The ManagedObjectMetadata command group for the AdminTask object includes the following SDK commands.
  • getAvailableSDKsOnNode
  • getSDKPropertiesOnNode
When MoRE is installed at the deployment manager, these commands work with the Java SDKs that are available to managed Liberty servers as shown in the following example.
wsadmin>print AdminTask.getAvailableSDKsOnNode('[-nodeName node1]')
17.0
21.0

wsadmin>print AdminTask.getNodeDefaultSDK('[-nodeName node1]')
[[javahome /opt/liberty/wlp/java/21.0] [sdkname 21.0] ]
An exception is when a traditional application server is the subject of the command as shown in the following example.
wsadmin>print AdminTask.getSDKVersion('[-nodeName node1 -serverName server1]')
8.0

When a MoRE node is not a deployment manager node, the getAvailableSDKsOnNode command and the getSDKPropertiesOnNode command return only the SDKs relevant to managed Liberty servers.

The parameters of these commands in the AdminSDKCmds command group and the ManagedObjectMetadata command group remain unchanged.

When MoRE is installed at the target node, or the target cluster is a managed Liberty cluster, commands in the AdminSDKCmds command group and the ManagedObjectMetadata command group deal with Liberty SDKs.

When MoRE is not installed at the deployment manager, the behavior for these commands is unchanged.