The createEJBStubs command creates stub classes for remote interfaces of Enterprise JavaBeans™ (EJB) Version 3.0 beans 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 below for more details.
The command searches the input JAR or EAR file, looking for EJB version 3.0 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. In the case where the input specified is a single interface class, the tool assumes this class is an EJB version 3.0 remote interface class and generates a remote stub class.
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. See below for more details.
createEJBStubs com.ibm.myRemoteInterface -cp my_path
Generate the stub class for one remote interface class and place it in the package-defined directory structure, starting at the current directory. The my_path directory will be used as the class path. If the remote interface class to process is in a JAR file, the –cp my_path/my_interfaces.jar syntax must be used for the class path specification.createEJBStubs my_path/my_beans.jar -newfile –quiet
Generate the stub classes for all level 3.0 enterprise beans in the my_beans.jar file that have remote interfaces. Both the generated stub classes and the original JAR file contents are packaged into a new JAR file named “my_beans_withStubs.jar” because the optional new_file name parameter is not specified along with the –newfile option. Output messages are suppressed except for error notifications.createEJBStubs my_path/my_Server_App.ear -logfile myLog.out
Generate the stub classes for all level 3.0 enterprise beans in the my_Server_App.ear file that have remote interfaces. The generated stub classes are placed into the original EAR file because the –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.createEJBStubs my_path/my_Server_App.ear -updatefile my_path/my_Client_interfaces.jar
Generate the stub classes for all level 3.0 enterprise beans in the my_Server_App.ear file that have remote interfaces. The generated stub classes are placed into both the original EAR file and the my_Client_interfaces.jar file. The stub classes are packaged into the same module or modules as the remote interface classes because the –updatefile option is specified.createEJBStubs my_path/my_Server_App.ear –updatefile
Generate the stub classes for all level 3.0 enterprise beans in the my_Server_App.ear file that have remote interfaces. The generated stub classes are only placed into the original EAR file because the optional 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.