![]() |
Application assemblers assemble enterprise Java applications from JavaServer Pages, Taglibs, Servlets and EJB components. Packaging standards make the application portable for deployment on any J2EE application server.
Studio Package Tool provides a mechanism to package the application components and generates the standard specification-defined XML based deployment descriptors.
Web components are packaged into Web Archives (WAR) and EJB components are packaged into Java Archives (JAR). JARs and WARs can be assembled into an Enterprise Archive (EAR). All the components can be deployed independently.
The ejb-jar file must contain the deployment descriptor. The deployment descriptor must be stored with the name META-INF/ejb-jar.xml in the ejb-jar file. For each enterprise bean, the ejb-jar file must include the class files of the following:
The ejb-jar file must also contain the class files for all the classes and interfaces that the enterprise bean class, and the remote and home interfaces depend on. This includes their super-classes and super-interfaces, and the classes and interfaces used as method parameters, results, and exceptions. An ejb-jar file does not have to include the class files of the home and remote interfaces of an enterprise bean that is referenced by an enterprise bean in the ejb-jar, or other classes needed by the referenced enterprise bean.
Studio provides Export As Archive support for Java Module. You can export a Java module. This is needed for utility JARs where you want to create utility files required by other EJB or web modules. You can configure the location and name of exported JAR file in Properties > Build tab of a Java module.
A Web Archive is an assembly of Web components that is deployed on the web server. It consists of one or more of the following:
A Web application is rooted at a specific path within a Web server. The URL by which a Servlet is known on the J2EE platform depends on the J2EE application in which it was deployed, so for reasons of robustness, servlets that call one another must be packaged and deployed together. Since a WAR is typically deployed under its own context root, static content that is cross-linked has to be packaged in a single .war file to avoid broken links. Static content is also typically reusable.
A tag library (taglib) is a collection of custom actions described by a tag library descriptor and Java classes. They are portable and can be used in any JSP Page regardless of the scripting language used in that page. It consists of one or more of the following:
The EJB and Web components are created and assembled into JARs and WARs. JARs and WARs are assembled into EAR files. This assembled application is then deployed in a target Server environment. The EAR consists of one or more JARs and WARs, and an XML deployment descriptor.
Deployment Descriptors are critical for any archive. They are stored in XML format and provide both the structural and assembly information (information not included directly in the code) meant for the use of the particular archive - JAR, WAR, and EAR files. Accordingly, there are different types of deployment descriptors: JAR deployment descriptor, WAR deployment descriptor, and EAR deployment descriptor. The deployment descriptors describe:
Now, you can export server specific archive in Studio. Export as Archive on any module or desk, creates an archive which is deployable in built-in Pramati Server. To deploy modules in a different server, there is no particular way of getting a server specific archive. It can be obtained only after deploying the archive. For example, the temporary location for oracle can be orclEAR. Export Generic Archive generates archives specific to built-in Pramati Server. Export Server Specific Archive generates archives for third party servers. Clicking this option displays a dialog asking for server name and archive name. All servers configured in studio, except built-in Server are shown in the server name dropdown. This creates a sever specific archive and stores it under <Selected_Server_Vendor_Name> directory. For example, exporting a EJB module for WebLogic-7.0 stores the archive in <Web logic Server 7.0> folder.
To keep ejb-jar.xml in a location other than deskDir/classes/ /META-INF, there are certain requirements. In the Properties panel, select Build tab and specify the storage location in 'ejb-jar.xml Path' text field. This path is picked during packaging time. The default path is deskDir/classes/ejbModuleName/META-INF/ejb-jar.xml. During JAR creation, the respective ejb-jar.xml is picked and placed in the specified name and location.
There are two ways to create JARs, WARs, Taglibs and EARs
To create a JAR, it is possible to:
For packaging into a WAR, when New is clicked, a new Web archive is created. This file is then added to the WAR folder specified at the time of creation. The archive will consist of Servlets, classes, security constraints, the XML deployment descriptor file, and related static content. In the archive, add Servlets, JavaServer Pages, Taglibs, Classes, Security Constraints, JARs containing supporting classes, and static content files. Follow a similar procedure to create a new Taglib by clicking on Taglib > New. For packaging into an EAR file, when New is clicked, a new Enterprise archive is opened. As soon as it is saved, it gets added to the EAR folder specified at the time of creation. In the archive, it is possible to:
Only JARs and WARs that are present in active desk can be added to an EAR. To add an "external" JAR or WAR to the EAR, first import it on to the desk.
From the package tool, select Jar/WAR/Taglib/EAR > Open > Choose/Archive Name. Clicking on Choose pops up the dialog box where the JARs/WARs/EARs/ Taglibs are selected. Checking the All Files checkbox selects all the available files. It is also possible to open an archive file in the Package Tool by double clicking on the required node on the desk.
In case of a JAR, the Package Tool displays an additional detail for manifest files. Add a new manifest file in the classpath by clicking the Manifest node and entering details in the text box. Studio checks for syntax errors.
If a JAR being opened is corrupt, classes required for loading a bean may not be found. These bean entries are removed from the XML in the JAR and need to be added again. A JAR can be corrupt if it does not have all the necessary classes needed to load the beans or if the XML in the JAR not been created properly. If such a JAR is opened, a dialog box pops up and the list of corrupt entries in the JAR are displayed. Select the entries to be removed from the JAR. These have to be added back to the JAR to create a well-formed JAR.
Once an archive is opened in the Package Tool, the displayed names of the JARs, WARs, Taglibs and EARs can be modified using the Display Name textfield. This name will now be the superseded name of the opened file and will be reflected on the tree node corresponding to the opened archive. It is also possible to set new icons for the archives. Either the small or the large icon can be opted for, by selecting the relevant icon from the file-system. The corresponding icon will then be displayed in the tree beside the file name. Some other details that can all be sorted are, Name, Date, Time, Size, Ratio, Packed, and Path.
Sorting can be performed on multiple columns by pressing shift and clicking on the next column you want to sort. For example, to sort by both Path and Name, click on the path header and then press shift and click on the name Header.
All the archives that are currently open are saved using Archive > Save All option. Select Archive > Save & Exit to save all currently opened archives and exit from Package Tool. Closing the tool also achieves the same as Save and Exit.
| Pramati Technologies © Copyright |
|