Change or add EJB JAR files
We can change enterprise bean (EJB) JAR files on application servers without having to stop the server and start it again.
The following note applies to the file references with .xmi extensions in this topic:
Supported configurations: For IBM extension and binding files, the .xmi or .xml file name extension is different depending on whether you are using a pre-Java EE 5 application or module or a Java EE 5 or later application or module. An IBM extension or binding file is named ibm-*-ext.xmi or ibm-*-bnd.xmi where * is the type of extension or binding file such as app, application, ejb-jar, or web. The following conditions apply:
- For an application or module that uses a Java EE version prior to version 5, the file extension must be .xmi.
- For an application or module that uses Java EE 5 or later, the file extension must be .xml. If .xmi files are included with the application or module, the product ignores the .xmi files.
However, a Java EE 5 or later module can exist within an application that includes pre-Java EE 5 files and uses the .xmi file name extension.
The ibm-webservices-ext.xmi, ibm-webservices-bnd.xmi, ibm-webservicesclient-bnd.xmi, ibm-webservicesclient-ext.xmi, and ibm-portlet-ext.xmi files continue to use the .xmi file extensions. sptcfg
Restriction: The hot deployment and dynamic reloading function is not supported when the product is running on these operating systems. The JAR files within the associated Java Development Kit (JDK) are memory mapped. If these JAR files are updated by the hot deployment and dynamic reloading functionality when they are being used by the JVM (JVM), the files become inconsistent, which results in an application server crash. When we make changes to an application on these operating systems, do not use the hot deployment and dynamic reloading functionality. Instead, restart the application to reflect the changes.
There are several changes that we can make to EJB JAR files without stopping the server and starting it again.
Important: See Ways to update enterprise application files and determine whether hot deployment is the appropriate way for you to update the EJB JAR files. Other ways are easier and hot deployment is appropriate only for experienced users. We can use the update wizard of the console to make the changes without having to stop and restart the server.
The following table lists the changes that we can make to EJB JAR files by manipulating an EJB file on the server where the application is deployed. The table also states whether you use hot deployment or dynamic reloading to make the changes.
changes to EJB JAR files . Available changes using hot
Change Hot deployment Dynamic reloading Change the ejb-jar.xml file of an EJB JAR file. Not applicable Yes Change the ibm-ejb-jar-ext.xmi or ibm-ejb-jar-bnd.xmi file of an EJB JAR file. Not applicable Yes Change the Table.ddl file for an EJB JAR file. Not applicable Not applicable Change the Map.mapxmi or Schema.dbxmi file for an EJB JAR file. Not applicable Yes Update the implementation class for an EJB file or a dependent class of the implementation class for an EJB file. Not applicable Yes Update the Home/Remote interface class for an EJB file. Not applicable Yes Add a new EJB file to an existing EJB JAR file. Yes Yes
- Change the ejb-jar.xml file of an EJB JAR file.
Restart the application. Automatic reloading will not detect the change. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
- Change the ibm-ejb-jar-ext.xmi or ibm-ejb-jar-bnd.xmi file of an EJB JAR file.
Restart the application. Automatic reloading will not detect the change. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
- Change the Table.ddl file for an EJB JAR file.
Rerun the DDL file on the user database server. Changing the Table.ddl file has no effect on the application server and is a change to the database table schema for the EJB files.
- Change the Map.mapxmi or Schema.dbxmi file for an EJB JAR file.
- Change the Map.mapxmi or Schema.dbxmi file for an EJB JAR file.
- Regenerate the deployed code artifacts for the EJB file.
- Apply the new EJB JAR file to the server.
- Restart the application. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
- Update the implementation class for an EJB file or a dependent class of the implementation class for an EJB file.
- Update the class file in the application_root/module_name.jar file.
- If automatic reloading is enabled, we do not need to take further action. Automatic reloading will detect the change.
If automatic reloading is not enabled, restart the application of which the EJB file is a member. If the updated module is used by other modules in other applications, restart those applications as well. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
- Update the Home/Remote interface class for an EJB file.
- Update the interface class of the EJB file.
- Regenerate the deployed code artifacts for the EJB file.
- Apply the new EJB JAR file to the server.
- If automatic reloading is enabled, we do not need to take further action. Automatic reloading will detect the change.
If automatic reloading is not enabled, restart the application of which the EJB file is a member. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
- Add a new EJB file to an existing EJB JAR file.
- Apply the new or updated JAR file to the application_root location.
- If automatic reloading is enabled, we do not need to take further action. Automatic reloading will detect the change.
If automatic reloading is not enabled, restart the application. Use the console to restart the application. Or use the startApplication and stopApplication attributes of the AdminControl object with wsadmin.sh.
Related tasks
Hot deployment and dynamic reloading Start applications Stopping applications