serverSchemaGen command

The serverSchemaGen command generates a schema for a specified Open Liberty server. The schema is created as a file that is named server.xsd in the ${server.config.dir}/schemagen directory.

To generate a schema with this command, the specified server must be running and the Admin Local Connector feature must be enabled.

This command generates a schema for a specific server. To generate a schema for an entire Open Liberty installation, use the schemaGen command.

Usage examples

Generate a schema for an Open Liberty server that is named myServer.

serverSchemaGen myServer

Generate a schema in the Brazilian Portuguese language for an Open Liberty server that is named myServer.

serverSchemaGen myServer --locale=pt_BR

Display help information for the serverSchemaGen command.

serverSchemaGen serverName --help

You must specify a server name in the command to generate help information.

Syntax

Run the command from the path_to_liberty/wlp/bin directory.

serverSchemaGen serverName [options]

Options

The following options are available for the serverSchemaGen command.

Options for the serverSchemaGen command
OptionDescription

--encoding=charset

This option specifies the name of a character set to use in the generated output file, where charset is the name of the character set.

--locale=language

This option specifies the language to use in the output file, where language is an ISO-639 two-letter lowercase language code, optionally followed by an underscore and the ISO-3166 uppercase two-letter country code.

--schemaVersion=1.1

This option specifies that both explicitly named child elements and the xsd:any element are written to the output file.

--outputVersion=2

This option specifies that only the xsd:any element is used in the output file. When this option is specified, unknown elements pass XSD validation at the expense of losing validation for known elements.

Exit codes

The following exit codes are available for the serverSchemaGen command.

Exit codes for the serverSchemaGen command
CodeExplanation

20

This code indicates that the command contains an invalid argument.

22

This code indicates that the local connector URL was not found.

23

This code indicates that the MBean was not found.

24

This code indicates that the MBean reported a bad result. Check the server log for exceptions.

25

This code indicates that the the WLP_OUTPUT_DIR/logs directory couldn’t be found, likely because the environment value is set to something other than what the server is using.

225

This code indicates unexpected errors. Use the printed message to identify the errors.