BEA WebLogic Enterprise 4.2    Developer Center     

        HOME   |   SITE MAP   |   SEARCH   |   CONTACT   |   GLOSSARY  |   PDF FILES |   WHAT'S NEW 
 
        JAVA REFERENCE    |   TABLE OF CONTENTS   |   PREVIOUS TOPIC   |   NEXT TOPIC  

Java Development and Administration Commands


This chapter describes the following commands:

This chapter is an alphabetical reference that describes each WebLogic Enterprise development command and Interface Repository administration command for developing Java applications for the Windows NT and UNIX environments. A list of valid parameters and options is shown for each command. For information about building C++ client and server applications, see the C++ Programming Reference.

Note: For descriptions of the idl2ir, irdel, and ir2idl commands, see the Administration Guide.

Before executing a WebLogic Enterprise command, you must ensure that the WebLogic Enterprise bin directory is in your defined path:

On Windows NT:

Set Path=%TUXDIR%\Bin;%Path%

On UNIX:

For c shell (csh): set path = ($TUXDIR/bin $path)

For Bourne (sh) or Korn (ksh): PATH=$TUXDIR/bin:$PATH
export PATH

Before executing a WebLogic Enterprise command, you must set the environment variables that are listed with each command.

On Windows NT systems, the syntax for setting an environment variable is:

set var=value

On UNIX systems, the syntax for setting an environment variable is:

buildjavaserver

Synopsis

Constructs a Java WebLogic Enterprise server application jar file.

Syntax

buildjavaserver [-s searchpath] input_file

Description

Once the class files that make up a server application have been created and specified, along with interface activation and transaction policies, in the Server Description File, you use the buildjavaserver command to create the jar file. The jar file contains all the server application class files and a server descriptor. The server descriptor is a serialized Java object that contains:

Options

-s
Specifies a path to be used by the buildjavaserver command to locate the classes and packages needed for building the jar file. If you do not specify this option, the buildjavaserver command uses the class path by default.

input_file
Specifies the name of the Server Description File. For information about creating this file, see Chapter 2, "Server Description File."

Environment
Variables

TUXDIR
Finds the WebLogic Enterprise libraries and include files to use when compiling the server application.

LD_LIBRARY_PATH (Solaris systems)
Indicates which directories contain shared objects to be used by the compiler, in addition to the WebLogic Enterprise shared objects. A colon (:) is used to separate the list of directories.

LIB (Windows NT systems)
Indicates a list of directories within which to find libraries. A semicolon (;) is used to separate the list of directories.

Portability

The buildjavaserver command is not supported on client-only WebLogic Enterprise systems.

Example

The following example builds a Java WebLogic Enterprise server application jar file on a Solaris system. This example uses the com/acme path for locating classes and packages for the archive and also uses the Server Description File MyServer.xml.

buildjavaserver -s com/acme MyServer.xml

buildXAJS

Synopsis

Constructs an XA resource manager to be used with a Java server application group.

Syntax

buildXAJS [-v] -r rmname [-o outfile]

Description

Use this command to build an XA resource manager that you want to use with a Java server application group. In the application's UBBCONFIG file, you use the JavaServerXA element in place of the JavaServer element to associate the XA resource manager with a specified server group. Note that a server application configured to use the default XA resource manager (that is, NULL) cannot coexist in a server group that uses a nondefault XA resource manager, such as Oracle. Refer to the Administration Guide for more information about configuring server groups with an XA resource manager.

Options

-v
Specifies that the buildXAJS command should work in verbose mode. In particular, it writes the build command to its standard output.

-r rmname
Specifies the resource manager associated with this server. The value rmname must appear in the resource manager table located in $TUXDIR/udataobj/RM on Solaris systems, or %TUXDIR%\udataobj\RM on Windows NT systems.
On Solaris systems, each entry in this file is of the form rmname:rmstructure_name:library_names. On NT systems, each entry in this file is of the form rmname;rmstructure_name;library_names.
Using the rmname value, the entry in $TUXDIR/udataobj/RM or %TUXDIR%\udataobj\RM automatically includes the associated libraries for the resource manager and properly sets up the interface between the transaction manager and the resource manager. The value TUXEDO/SQL includes the libraries for the BEA TUXEDO System/SQL resource manager. Other values can be specified as they are added to the resource manager table. If the -r option is not specified, the default is to use the null resource manager.

-o outfile
Specifies the name of the output file. If no name is specified, the default is JavaServerXA.

Environment
Variables

TUXDIR
Finds the WebLogic Enterprise libraries and include files to use when compiling the server application.

LD_LIBRARY_PATH (Solaris systems)
Indicates which directories contain shared objects to be used by the compiler, in addition to the WebLogic Enterprise shared objects. A colon (:) is used to separate the list of directories.

LIB (Windows NT systems)
Indicates a list of directories within which to find libraries. A semicolon (;) is used to separate the list of directories.

Portability

The buildXAJS command is not supported on client-only WebLogic Enterprise systems.

Example

The following example builds a Java server XA resource manager on a Solaris system:

buildXAJS -r oracle7

m3idltojava

Synopsis

Compiles the Object Management Group (OMG) Interface Definition Language (IDL) file and generates client stub and server skeleton files required for the interface definitions being implemented in Java. Use this command only when you are creating a Java server application.

Syntax

m3idltojava [-p] [-j javaDirectory] [-Idirectory][-Dsymbol]
[-U
symbol] [-foptions] idl-filename...

Description

The m3idltojava command compiles OMG IDL source files into Java source code. You then use the javac compiler to compile that source into Java bytecodes. The OMG IDL declarations from the named OMG IDL files are translated to Java declarations according to the mapping from OMG IDL to Java.

Given the provided idl-filename file(s), the m3idltojava command generates the following files for each interface defined in the server application's OMG IDL file:

interface-name.java
Contains the Java version of the interface definitions in the OMG IDL file. Each interface implementation extends the org.omg.CORBA.Object class.

_interface-nameStub.java
Is the client stub file.

_interface-nameImplBase.java
Is the Server skeleton file, which is extended by the server application's object implementation classes.

interface-nameHelper.java
Contains the helper class for the object.

interface-nameHolder.java
Contains the holder class for the object.

The m3idltojava compiler generates the client stub and server skeleton files. Any previous versions are overwritten.

If an unknown option is passed to this command, the offending option and a usage message is displayed to the user, and the compile is not performed.

For more information about OMG IDL syntax, see Chapter 1, "OMG IDL Syntax."

Parameter

idl-filename

Represents the name of one or more files that contain OMG IDL statements.

Options

-p package
Specifies that generated Java classes should be part of the given package. The compiler creates the appropriate directory hierarchy and stores the generated files in the directory that corresponds to their package. If you specify the -j option, the hierarchy is created under the specified directory. Otherwise, the hierarchy is created under the current directory. You can override this option by using #pragma javaPackage in the OMG IDL source file.

-j javaDirectory
Specifies that generated Java files should be written to the specified directory. This directory is independent of the -p option, if used.

-Idirectory
Specifies directories within which to search for include files, in addition to any directories specified with the #include OMG IDL preprocessor directive. Multiple directories can be specified by using multiple -I options.

There are two types of #include OMG IDL preprocessor directives: system (for example, <a.idl>) and user (for example, "a.idl"). The path for system #include directories is the system include directory and any directories specified with the -I option. The path for user #include directives is the location of the file containing the #include directive, followed by the path specified for the system #include directive.

By default, the text in files included with an #include directive is not included in the client and server code that is generated.

-Dsymbol
Specifies a symbol to be defined during OMG IDL file preprocessing. The m3idltojava command passes this symbol to the preprocessor.

-Usymbol
Specifies a symbol to be undefined during OMG IDL file preprocessing. The m3idltojava command passes this symbol to the preprocessor.

-foptions
You can enable the following options by specifying them as shown, and disable them by appending the string no-. For example, to prevent the C preprocessor from being run on the input OMG IDL files, specify -fno-cpp.

-flist-flags
Displays the state of all -f flags. By default, this option is disabled.

-fclient
Generates the client application files. By default, this option is enabled.

-fserver
Generates the server application files. By default, this option is enabled.

-fverbose
Specifies that the m3idltojava command should work in verbose mode. In particular, it writes command output to its standard output. By default, this option is disabled.

-fversion
Specifies that the compiler prints its version and timestamp. By default, this option is disabled.

Examples

The following command generates only the server application files for Simple.idl:

m3idltojava -fno-client Simple.idl

The following command generates only the client application files for Simple.idl:

m3idltojava -fno-server Simple.idl


Copyright © 1999 BEA Systems, Inc. All Rights Reserved.
Required browser version: Netscape Communicator version 4.0 or higher, or Microsoft Internet Explorer version 4.0 or higher.
Last update: July 01, 1999.