The createEJBStubs command creates stubs for EJB 3.0 specification
remote interfaces found in the enterprise beans Java archive (JAR) or Enterprise
archive (EAR) file.
The stubs are stored in the JAR file where the remote interfaces are accessed.
The command is found in the <WAS_HOME>/bin directory as:
- createEJBStubs.bat - Windows platforms
- createEJBStubs.sh - Unix based platforms
- createEjbStubs - iSeries platform
The command first tries to determine if the standalone JAR file, or a JAR
in the EAR file, is an EJB 3.0 JAR. If the JAR has a deployment descriptor
based on the EJB 3.0 specification, or if it has no deployment descriptor,
it is processed as a EJB 3.0 JAR file. Stubs are generated into the JAR file
for each enterprise bean remote interface that is found.
For many client-side scenarios, the WebSphere Application Server Just-In-Time
(JIT) deployment feature dynamically generates the RMI-IIOP stub classes that
are required for invocation of remote EJB 3.0 business interfaces. However,
there are some scenarios where the JIT deploy environment is not available
to dynamically generate these classes. In these scenarios, the createEJBStubs
command must be used instead to generate and embed the client-side stub class
files in your client application. If your client environment is one of the
following, use the createEJBStubs command:
- "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_EAR_name | input_Jar_name [
-help]
[
-newfile [new_file]] [
-quiet] [
-verbose] [
-logfile
log_file] [
-appendlog] [
-cp classpath] [
-trace]
- createEJBStubs
- The command to create the ejb stubs for a JAR file or an EAR file. If
run without any arguments, the createEJBStubs command displays a list of arguments
that can be run with the command.
- input_EAR_name or input_JAR_name
- The fully qualified name of the input JAR or EAR file that contains the
enterprise beans with remote interfaces for which you want to generate stubs.
This is the required first element for the command.
- -help
- Provides a list of arguments that can be run with the command.
- -newfile [new_file]
- Requests that a new file be generated containing the original files in
the input JAR or EAR and the stubs. If this option is not specified, the stubs
are written to the original JAR file or JARs in the original EAR file. If
this option is specified, but new_file is not specified, the new file name
is the same as the input JAR or EAR file name appended with "_withStubs".
- -quiet
- Requests the suppression of status messages. The -quiet option cannot
be specified with the -verbose option.
- -verbose
- Requests that additional informational messages be output. The -verbose
option cannot be specified with the -quiet option.
- -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 argument must be specified.
- -appendlog
- Requests that messages be appended to the current log. If this option
is specified, the -logfile option must also be specified.
- -cp classpath
- Specifies the classpath where additional files are located that are necessary
for the tool to run. Each path must be separated from a previous path by the
default path separator of the operating system. Each path can be either a
JAR file or a directory.
- -trace
- Specifies that trace be generated. This is intended for use by IBM service
in resolving problems.
Examples
To generate stubs for each JAR
EJB3
JAR file in the MyEar.ear and add them to the corresponding JAR files
in MyEar.ear:
createEJBStubs MyEar.ear
To generate stubs
and put them into MyJar_withStubs.JAR, along with the original files from
MyJar.JAR type the following:
createEJBStubs MyJar.JAR -newFile
To
generate stubs for each JAR EJB3 JAR file in the MyEar.ear and copy the original
files to the NewEar.ear , and add the stubs to the corresponding JAR files,
type the following:
createEJBStubs MyEar.ear -newfile NewEar.ear -logfile MyLog.log -verbose
Information
messages appear on the console, as well as in the MyLog.log file.