Create stubs command
The createEJBStubs command creates stub classes for remote interfaces of Enterprise JavaBeans (EJB) packaged in Java™ archive (JAR) or enterprise archive (EAR) files. It also provides an option to create a single stub class from an interface class located in a directory or a JAR file. Several command options are provided to package the generated stub classes in different ways. See the Syntax and Examples sections later in this topic for more details.
createEJBStubs
createEJBStubs.bat
createEJBStubs.sh
The command searches the input JAR or EAR file for EJB modules that contain beans with remote interfaces. When remote interfaces are found, the corresponding stub classes are generated and packaged according to the command options specified. If the input specified is a single interface class, the tool assumes this class is an EJB remote interface class and generates a remote stub class.
Bare
Java Standard Edition (SE) clients, where a Java SE Java virtual machine (JVM) is the client environment.- A WebSphere Application Server container (web container, EJB container, or application client container) from a version earlier than version 7, or without the Feature Pack for EJB 3.0 applied.
- Non-WebSphere Application Server environments.
Syntax
createEJBStubs input_ class_ name | input_JAR_name | input_EAR_name [-help] [-newfile [new_file]] [-updatefile [update_file]] [-quiet] [-verbose] [-logfile log_file] [-appendlog] [-cp class_path] [-trace]- createEJBStubs
- This is the command to create EJB stub classes for a single interface class file, a JAR file, or an EAR file. When invoked without any arguments, or only -help, the createEJBStubs command displays a list of options that can be specified, and a list of example invocations with detailed explanations.
- input_class_name or input_EAR_name or input_JAR_name
The first parameter is a required element for the command. It must contain the source class, JAR, or EAR file to process.
This parameter may be the fully qualified name of a single interface class (e.g. com.ibm.myRemoteInterface). Note that the package name segments are separated by
.
characters, no path name proceeds the class name, and the.class
extension is not included. For this interface class input, you must use the class path option (e.g. -cp my_path, or -cp my_path/my_interfaces.jar) to specify where the interface class will be found. The generated stub class will be placed in the package-defined directory structure, starting with the current directory where the command is invoked.This parameter may also be a JAR or EAR file. In this case the path must be specified (e.g. my_path/my_Server_App.ear). The generated stub classes will be placed in the same module or modules with the beans, or in the same module or modules with the remote interface classes, depending on whether the -updatefile option is specified. Details follow later in this section.
- -help
- Provides the command syntax, including a list of options that can be specified, and example invocations with detailed explanations.
- -newfile [new_file]
- Requests that a new file is generated containing the original
files in the input JAR or EAR plus the stub classes. When this option
is not specified, the stubs are written back into the original JAR
or EAR file. If this option is specified, but the new_file name is
not provided, a new file name is constructed by appending the input
JAR or EAR file name with
_withStubs
. This option is not allowed when the first input parameter is an interface class. - -updatefile [update_file]
- Requests that a second file (e.g. in addition to the input file) is updated with stub classes. This option also provides a different packaging behavior. The stub classes are packaged in the same module or modules as the remote interface classes. By contrast, when this option is not specified, the stub classes are packaged in the same module or modules with the bean classes. If this option is specified, but the update_file name is not provided only the original JAR or EAR file is updated with stub classes. This option is not allowed when the first input parameter is an interface class.
- -quiet
- Requests the suppression of messages. The -quiet option cannot be specified with either the -verbose or the -trace options. Error messages are still displayed.
- -verbose
- Requests that additional informational messages be output. The -verbose option cannot be specified with either the -quiet or the -trace options.
- -logfile log_file
- Requests that messages be printed to a log file in addition to the console. If this option is specified, the log_file name must also be provided.
- -appendlog
- Requests that messages be appended to an existing log file. If this option is specified, the -logfile option must also be specified.
- -cp class_path
- Requests that the classloader includes the specified the class path where additional class or jar files are located, which are necessary for the remote interface classes to be loaded. The class path may include multiple segments where each path is separated from a previous path by the default path separator character of the operating system. Each path can specify either a JAR file, or a directory. If this option is specified, the class_path name must also be provided.
- -trace
- Request that detailed trace output be generated. This is intended to collect information for use by IBM® service to resolve problems. The trace output is English-only. This option cannot be specified with either the -quiet or the -verbose options.
Examples
-cp
my_path/my_interfaces.jar syntax must be used for the class path
specification.
new_file name parameter is not specified along with the -newfile
option. Output messages are suppressed except for error
notifications.-newfile option is not specified. The stub classes are packaged into the same
module or modules as the bean classes because the -updatefile option is not
specified. Messages are written to both the myLog.out log file and the command
window.-updatefile option is
specified.update_file name parameter is not provided with the
-updatefile option. The stub classes are packaged into the same module or modules
as the remote interface classes because the -updatefile option is
specified.