Assembling an enterprise bean JAR file into an EAR file

You can assemble an enterprise bean Java™ archive (JAR) file into an enterprise archive (EAR) file with an assembly tool. Assembling the JAR file, and now the EAR file, are required tasks to enable Java code for web services.

Before you begin

You can assemble Java-based web services modules with assembly tools provided with WebSphere® Application Server.

Before assembling a web services-enabled EAR file you must assemble an enterprise bean JAR file that you want to enable for Web services. To learn more about the artifacts that are needed for the assembly of the enterprise bean JAR file, see the information on assembling an enterprise bean JAR file from Java code that is enabled for web services.
Restriction: 請勿在套裝於應用程式保存檔內的檔案名稱中包含井字號 (#)。 由於內部處理之故,當應用程式保存檔內的檔案名稱中包含井字號時,應用程式伺服器將無法正確部署應用程式。如果發生這種失敗,則可能會在處理應用程式時發生異常狀況。此外,在部署應用程式之後,部分應用程式可能會遺失。 為處理這個問題,請將應用程式保存檔內的所有檔名重新命名,讓它們不包含井字號。

About this task

To assemble a web services-enabled EAR file:

Procedure

  1. Start an assembly tool. Read about starting the assembly tool in the Rational® Application Developer documentation.
  2. If you have not done so already, configure the assembly tool so that it works on Java EE modules. You need to make sure that the Java EE and Web categories are enabled. Read about configuring the assembly tool in the Rational Application Developer documentation.
  3. Assemble the web services-enabled JAR file into an EAR file. The EAR file can contain an enterprise bean or application client JAR files, WAR files, web applications, and metadata describing the applications or application.xml files.

Results

A web services-enabled EAR file.

Example

In the following example, there is an application.xml deployment descriptor packaged with a web services-enabled JAR file called AddressBook.jar that is packaged into an EAR file called AddressBook.ear. The EAR file contains:

META-INF/MANIFEST.MF
META-INF/application.xml
AddressBook.jar

An example of the application.xml deployment descriptor is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" 
"http://java.sun.com/dtd/application_1_3.dtd">
	<application id="Application_ID">
		<display-name>AddressBookJ2WEE</display-name>
		<description>AddressBook EJB Example from Java</description>
		<module id="EjbModule_1">
			<ejb>AddressBook.jar</ejb>
		</module>
	</application>

What to do next

You can enable an EAR file for EJB modules that contain web services. Then, deploy the EAR file into WebSphere Application Server.


指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:17
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twbs_assembearjar
檔名:twbs_assembearjar.html