WebLogic Server J2EE applications are packaged according to J2EE specifications. J2EE defines component behaviors and packaging in a generic, portable way, postponing run-time configuration until the component is actually deployed on an application server.
J2EE includes deployment specifications for Web applications, EJB modules, enterprise applications, client applications, and resource adapters. J2EE does not specify how an application is deployed on the target server—only how a standard component or application is packaged.
For each component type, the specifications define the files required and their location in the directory structure. Components and applications may include Java classes for EJBs and servlets, resource adapters, Web pages and supporting files, XML-formatted deployment descriptors, and JAR files containing other components.
An application that is ready to deploy on WebLogic Server may require WebLogic-specific deployment descriptors and, possibly, container classes generated with the WebLogic EJB, RMI, or JSP compilers.
JAR Files
A file created with the Java jar tool bundles the files in a directory into a single Java ARchive (JAR) file, maintaining the directory structure. The Java classloader can search for Java class files (and other file types) in a JAR file the same way that it searches a directory in its classpath. Because the classloader can search a directory or a JAR file, you can deploy J2EE components on WebLogic Server in either an "exploded" directory or a JAR file.
JAR files are convenient for packaging components and applications for distribution. They are easier to copy, they use up fewer file handles than an exploded directory, and they can save disk space with file compression. If your Administration Server manages a domain with multiple WebLogic Servers, you can only deploy JAR or EAR files, because the Administration Console does not copy expanded directories to Managed Servers.
The jar utility is in the bin directory of your Java Development Kit. If you have javac in your path, you also have jar in your path. The jar command syntax and behavior is similar to the UNIX tar command.
- jar cf jar-file files ...
- Creates a JAR file named jar-file containing listed files. If you include a directory in the list of files, all files in that directory and its subdirectories are added to the JAR file.
- jar xf jar-file
- jar tf jar-file
The first flag specifies the operation: create, extract, or list (tell). The f flag must be followed by a JAR file name. Without the f flag, jar reads or writes JAR file contents on stdin orstdout which is usually not what you want. See the documentation for the JDK utilities for more about jar command options
- Create a temporary staging directory anywhere on your hard drive.
- Compile or copy the resource adapter Java classes into the staging directory.
- Create a JAR to store the resource adapter Java classes. Add this JAR to the top level of the staging directory.
- Create a META-INF subdirectory in the staging directory.
- Create an ra.xml deployment descriptor in the META-INF subdirectory and add entries for the resource adapter.
- Create a weblogic-ra.xml deployment descriptor in the META-INF subdirectory and add entries for the resource adapter.
- When the resource adapter classes and deployment descriptors are set up in the staging directory, you can create the RAR with a JAR command such as:
jar cvf jar-file.rar -C staging-dir
Packaging Enterprise Applications: Main Steps ( EAR Files )
- Create a temporary staging directory anywhere on your hard drive.
- Copy the Web archives (WAR files) and EJB archives (JAR files) into the staging directory.
- Create a META-INF subdirectory in the staging directory.
- Set up your shell environment.
- Execute the following command to automatically generate the application.xml deployment descriptor in the META-INF subdirectory:
java weblogic.ant.taskdefs.ear.DDInit staging-dir
- Optionally create the weblogic-application.xml file manually in the META-INF directory.
- Create the Enterprise Archive (EAR file) for the application, using a jar command such as:
jar cvf application.ear -C staging-dir
Staging and Packaging EJBs ( JAR files )
To stage and package an Enterprise JavaBean (EJB):
- Create a temporary staging directory anywhere on your hard drive (for example, c:\stagedir).
- Compile or copy the bean's Java classes into the staging directory.
- Create a META-INF subdirectory in the staging directory.
- Set up your shell environment.
- If you are using EJB 1.1, e the following command to automatically generate the ejb-jar.xml, weblogic-ejb-jar.xml, and weblogic-rdbms-cmp-jar-bean_name.xml (if needed) deployment descriptors in the META-INF subdirectory:
java weblogic.ant.taskdefs.ejb11.DDInit staging-dir
-
java weblogic.ant.taskdefs.ejb20.DDInit staging-dir
- Alternatively, you can create the EJB deployment descriptor files manually. Create an ejb-jar.xml and weblogic-ejb-jar.xml files in the META-INF subdirectory. If the bean is an entity bean with container-managed persistence, create a weblogic-rdbms-cmp-jar—bean_name.xml deployment descriptor in the META-INF directory with entries for the bean. Map the bean to this CMP deployment descriptor with a <type-storage> attribute in the weblogic-ejb-jar.xml file.When all of the enterprise bean classes and deployment descriptors are set up in the staging directory, create the EJB JAR file with a jar command such as:
jar cvf jar-file.jar -C staging-dir
The -C staging-dir option instructs the jar command to change to the staging-dir directory so that the directory paths recorded in the JAR file are relative to the directory where you staged the enterprise beans.Enterprise beans require container classes, classes the WebLogic EJB compiler generates to allow the bean to deploy in a WebLogic Server. The WebLogic EJB compiler reads the deployment descriptors in the EJB JAR file to determine how to generate the classes. You can run the WebLogic EJB compiler on the JAR file before you deploy the beans, or you can let WebLogic Server run the compiler for you at deployment time.
To stage and package a Web application:
- Create a temporary staging directory anywhere on your hard drive. You can name this directory anything you want.
- Copy all of your HTML files, JSP files, images, and any other files that these Web pages reference into the staging directory, maintaining the directory structure for referenced files. For example, if an HTML file has a tag such as <img src="images/pic.gif">, the pic.gif file must be in the images subdirectory beneath the HTML file.
- Create META-INF and WEB-INF/classes subdirectories in the staging directory to hold deployment descriptors and compiled Java classes.
- Copy or compile any servlet classes and helper classes into the WEB-INF/classes subdirectory.
- Copy the home and remote interface classes for enterprise beans used by the servlets into the WEB-INF/classes subdirectory.
- Copy JSP tag libraries into the WEB-INF subdirectory. (Tag libraries may be installed in a subdirectory beneath WEB-INF; the path to the .tld file is coded in the .jsp file.)
- Set up your shell environment.
- Execute the following command to automatically generate the web.xml and weblogic.xml deployment descriptors in the WEB-INF subdirectory:
java weblogic.ant.taskdefs.war.DDInit staging-dir
-
Alternatively, you can create the web.xml and weblogic.xml files manually in the WEB-INF subdirectory manuallyBundle the staging directory into a WAR file by executing a jar command such as:
jar cvf myapp.war -C staging-dir
The resulting WAR file can be added to an Enterprise application (EAR file) or deployed independently using the Administration Console or the weblogic.Deployercommand-line utility.
-
1 comment:
Hello friends
Today I will mention you my best game collection in 2018. What app store are you using? Do you have the latest version of your app store? I usually install games and apps in the following stores that you can reference and install: Iplaystoredownloadfree
Here are examples of stores that you can refer to and install:
- Download How to fix Play Store errors
- Download Play Store for SamSung
- Download Play Store for PC
Wish you have the best warehouse for your mobile. Thank you!
Post a Comment