The appc compiler generates and compiles the classes needed to deploy EJBs and JSPs to WebLogic Server. It also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level. The application-level checks include checks between the application-level deployment descriptors and the individual modules as well as validation checks across the modules.
Advantages of Using appc
The appc tool offers the following benefits:
The flexibility of compiling an entire application, rather than compiling individual modules separately and combining them into an EAR after the fact.
Validation checks across all modules and validation of application-level deployment descriptors against the various modules, because WebLogic Server has access to all modules during EAR compilation.
Without appc, a user wanting to compile all modules within an EAR file had to extract the individual components of an EAR and manually execute the appropriate compiler (jspc or ejbc) to prepare the module for deployment. appc automates this process and makes additional pre-deployment validation checks not previously possible.
It is easy to identify and correct errors appc produces.
If an error occurs while running appc from the command line, appc exits with an error message.
By contrast, if you defer compilation to the time of deployment and a compilation error occurs, the server fails the deployment and goes on with its work. To determine why deployment failed, you must examine the server output, fix the problem and then redeploy.
By running appc prior to deployment, you potentially reduce the number of time a bean is compiled.
For example, if you deploy a JAR file to a cluster of 3 servers, the JAR file is copied to each of the three servers for deployment. If the JARfile wasn't precompiled, each of the three servers will have to compile the file during deployment.
Use the following syntax to run appc:
prompt>java weblogic.appc [options]<ear, jar, or war file or directory>
Designating Alternative Deployment Descriptors
J2EE allows you to designate an alternative J2EE deployment descriptor for an EJB or Web application module, using the <alt-dd> element in the <module> element of application.xml.
You can use <alt-dd> to specify an alternate deployment descriptor only for the J2EE deployment descriptors, web.xml and ejb-jar.xml. As of WebLogic Server 8.1 SP01, if you specify an alternative deployment descriptor for a module in alt-dd, appc will compile the EJB using the alternative descriptor file.
For more information about the <alt-dd> element, see “module” in Developing Applications with WebLogic Server.
In WebLogic Server 8.1 SP01and later, you can use appc command line options to designate alternative J2EE and WebLogic Server deployment descriptors for an application, as shown below:
-altappdd <file>—Use this option to specify the full path and file name of an alternative J2EE deployment descriptor file, application.xml.
-altwlsappdd <file>—Use this option to specify the full path and file name of an alternative WebLogic application deployment descriptor, weblogic-application.xml
Designates an alternative J2EE application deployment descriptor.
Designates an alternative WebLogic Server application deployment descriptor.
Does not include deployment descriptors in client JARs generated for EJBs.
Selects the classpath to use during compilation.
Specifies a directory to place generated client jar files. If not set, generated jar files are placed into the same directory location where the JVM is running.
Selects the Java compiler to use.
Warns about deprecated calls.
Forces generation of EJB and JSP classes. Without this flag, the classes will not be regenerated unless a checksum indicates that it is necessary.
Compiles debugging information into a class file.
Prints the standard usage message.
Generates IDL for EJB remote interfaces.
Specifies the directory where IDL files will be created (default: target directory or JAR)
Generates factory methods for valuetypes.
Specifies the method signatures used to trigger IDL code generation.
Does not generate abstract interfaces and methods/attributes that contain them.
Does not generate valuetypes and the methods/attributes that contain them.
Generates IDL somewhat compatible with Orbix 2000 2.0 C++.
Always overwrites existing IDL files.
Displays verbose information for IDL generation.
Generates IDL somewhat compatible with Visibroker 4.5 C++.
Generates CORBA stubs for EJBs.
Specifies the directory where IIOP stub files will be written (default: target directory or JAR)
Passes flags through to Java runtime.
Keeps the generated .java files.
Comma-separated list of libraries. Each library may optionally set its name and versions, if not already set in its manifest, with the syntax:
Registers all files in the specified directory as libraries.
Adds line numbers to generated class files to aid in debugging.
Passes flags through to Symantec's sj.
Compiles without warnings.
Compiles with optimization on.
Specifies an alternate output archive or directory. If not set, the output is placed in the source archive or directory.
Specifies and optional deployment plan.
Compiles with verbose output.
Prints appc version information.
appc and EJBs
weblogic.appc performs the following EJB-related functions:
Generates WebLogic Server container classes for the EJBs.
Checks all EJB classes and interfaces for compliance with the EJB specification.
Checks deployment descriptors for potential configuration problems. For example, if there is a cmp field declared in ejb-jar.xml, appc verifies that the column is mapped in the weblogic-cmp-rdbms.xml deployment descriptor.
Runs each EJB container class through the RMI compiler to create RMI descriptors necessary to dynamically generate stubs and skeletons.
By default, appc uses javac as a compiler. For faster performance, specify a different compiler (such as Symantec’s sj) using the command-line -compiler flag or via the Administration Console. See Configuring Compiler Options.