Este contenido no está disponible en el idioma seleccionado.
Chapter 4. Tools and Tips
4.1. Resources to Assist With Migration Copiar enlaceEnlace copiado en el portapapeles!
4.1.1. Resources to Assist in Your Migration Copiar enlaceEnlace copiado en el portapapeles!
- Tools
- There are several tools that help automate some of the configuration changes. For more information, refer: Section 4.1.2, “Become Familiar with Tools That Can Assist with the Migration”.
- Debugging Tips
- For a list of the most common causes and resolutions of issues and errors you may see when you migrate your application, refer: Section 4.2.1, “Debug and Resolve Migration Issues”.
- Example migrations
- For examples of applications that have been migrated to JBoss EAP 6, refer: Section 4.3.1, “Review Migration of Example Applications”.
4.1.2. Become Familiar with Tools That Can Assist with the Migration Copiar enlaceEnlace copiado en el portapapeles!
There are some tools that can assist you in your migration efforts. The following is a list of these tools along with a description of what they do.
- Tattletale
- With the change to modular class loading, you need to find and rectify application dependencies. Tattletale can help you identify dependent module names and generate the configuration XML for your application.
- IronJacamar Migration Tool
- In JBoss EAP 6, datasources and resource adapters are no longer configured in a separate file. They are now defined in the server configuration file and use new schemas. The IronJacamar Migration Tool can help convert the old configuration into the format expected by JBoss EAP 6.
4.1.3. Use Tattletale to Find Application Dependencies Copiar enlaceEnlace copiado en el portapapeles!
Due to the modular class loading changes in JBoss EAP 6, you might see ClassNotFoundException or ClassCastException traces in the JBoss log when you migrate your application. To resolve these errors, you need to find the JARs that contain the classes specified by the exceptions.
jboss-deployment-structure.xml file.
Procedure 4.1. Install and run Tattletale to find application dependencies
Note
4.1.4. Download and Install Tattletale Copiar enlaceEnlace copiado en el portapapeles!
Procedure 4.2. Download and Install Tattletale
- Download Tattletale version 1.2.0.Beta2 or newer from http://sourceforge.net/projects/jboss/files/JBoss%20Tattletale.
- Unzip the file into the directory of your choice.
- Modify the
TATTLETALE_HOME/jboss-tattletale.propertiesfile by doing the following:- Add
ee6andas7to theprofilesproperty.profiles=java5, java6, ee6, as7
profiles=java5, java6, ee6, as7Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Uncomment the
scanandreportsproperties.
4.1.5. Create and Review the Tattletale Report Copiar enlaceEnlace copiado en el portapapeles!
- Create the Tattletale report by issuing the command:
java -jarTATTLETALE_HOME/tattletale.jarAPPLICATION_ARCHIVEOUTPUT_DIRECTORYFor example:java -jar tattletale-1.2.0.Beta2/tattletale.jar ~/applications/jboss-seam-booking.ear ~/output-results/ - In a browser, open the
OUTPUT_DIRECTORY/index.htmlfile and click on "JBoss AS 7" under the "Reports" section.- The column on the left lists the archives used by the application. Click on the ARCHIVE_NAME link to view details about the archive, such as its location, manifest information, and classes it contains.
- The
jboss-deployment-structure.xmllink in the column on the right shows how to specify the module dependency for the archive named in the left column. Click on this link to see how to define the deployment dependency module information for this archive.
4.1.6. Use the IronJacamar Tool to Migrate Datasource and Resource Adapter Configurations Copiar enlaceEnlace copiado en el portapapeles!
In previous versions of the application server, datasources and resource adapters were configured and deployed using a file with a suffix of *-ds.xml. The IronJacamar 1.1 distribution contains a migration tool that can be used to convert these configuration files into the format expected by JBoss EAP 6. The tool parses the source configuration file from the previous release, then creates and writes the XML configuration to an output file in the new format. This XML can then be copied and pasted under the correct subsystem in the JBoss EAP 6 server configuration file. This tool makes a best effort to convert old attributes and elements into the new format, however, it may be necessary to make additional modifications to the generated file.
Procedure 4.3. Install and run the IronJacamar Migration tool
Note
4.1.7. Download and Install the IronJacamar Migration Tool Copiar enlaceEnlace copiado en el portapapeles!
Note
- Download the latest distribution of IronJacamar from here: http://www.ironjacamar.org/download.html
- Unzip the downloaded file into a directory of your choice.
- Find the converter script in the IronJacamar distribution.
- The Linux script is located here:
IRONJACAMAR_HOME/doc/as/converter.sh - The Windows batch file is located here:
IRONJACAMAR_HOME/doc/as/converter.bat
4.1.8. Use the IronJacamar Migration Tool to Convert a Datasource Configuration File Copiar enlaceEnlace copiado en el portapapeles!
Note
Procedure 4.4. Convert a Datasource Configuration File
- Open a command line and navigate to the
IRONJACAMAR_HOME/doc/as/directory. - Run the converter script by typing the following command:
- For Linux:
./converter.sh -dsSOURCE_FILETARGET_FILE - For Microsoft Windows:
./converter.bat -dsSOURCE_FILETARGET_FILE
TheSOURCE_FILEis the datasource -ds.xml file from the previous release. TheTARGET_FILEcontains the new configuration.For example, to convert thejboss-seam-booking-ds.xmldatasource configuration file located in the current directory, you would type:- For Linux:
./converter.sh -dsjboss-seam-booking-ds.xmlnew-datasource-config.xml - For Microsoft Windows:
./converter.bat -dsjboss-seam-booking-ds.xmlnew-datasource-config.xml
Note that the parameter for datasource conversion is-ds. - Copy the
<datasource>element from the target file and paste it into the server configuration file under the<subsystem xmlns="urn:jboss:domain:datasources:1.1"><datasources>element.Important
You must stop the server before editing the server configuration file for your change to be persisted on server restart.- If you are running in a managed domain, copy the XML into the
EAP_HOME/domain/configuration/domain.xmlfile. - If you are running as a standalone server, copy the XML into the
EAP_HOME/standalone/configuration/standalone.xmlfile.
- Modify the generated XML in the new configuration file.Here is an example of the
jboss-seam-booking-ds.xmldatasource configuration file for the Seam 2.2 Booking example that shipped with JBoss EAP 5.x:The following is the configuration file that was generated by running the converter script. The generated file contains aCopy to Clipboard Copied! Toggle word wrap Toggle overflow <driver-class>element. The preferred way to define the driver class in JBoss EAP 6 is to use a<driver>element. Here is the resulting XML in the JBoss EAP 6 configuration file with modifications to comment out the<driver-class>element and add the corresponding<driver>element:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.1.9. Use the IronJacamar Migration Tool to Convert a Resource Adapter Configuration File Copiar enlaceEnlace copiado en el portapapeles!
Note
- Open a command line and navigate to the
IRONJACAMAR_HOME/docs/as/directory. - Run the converter script by typing the following command:
- For Linux:
./converter.sh -raSOURCE_FILETARGET_FILE - For Microsoft Windows:
./converter.bat -raSOURCE_FILETARGET_FILE
TheSOURCE_FILEis the resource adapter -ds.xml file from the previous release. TheTARGET_FILEcontains the new configuration.For example, to convert themttestadapter-ds.xmlresource adapter configuration file located in the current directory, you would type:- For Linux:
./converter.sh -ramttestadapter-ds.xmlnew-adapter-config.xml - For Microsoft Windows:
./converter.bat -ramttestadapter-ds.xmlnew-adapter-config.xml
Note that the parameter for resource adapter conversion is-ra. - Copy the entire
<resource-adapters>element from the target file and paste it into the server configuration file under the<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">element.Important
You must stop the server before editing the server configuration file for your change to be persisted on server restart.- If you are running in a managed domain, copy the XML into the
EAP_HOME/domain/configuration/domain.xmlfile. - If you are running as a standalone server,copy the XML into the
EAP_HOME/standalone/configuration/standalone.xmlfile.
- Modify the generated XML in the new configuration file.Here is an example of the
mttestadapter-ds.xmlresource adapter configuration file from the JBoss EAP 5.x TestSuite:The following is the configuration file that was generated by running the converter script. Replace the class-name attribute value "FIXME_MCF_CLASS_NAME" in the generated XML with the correct class name of the managed connection factory, in this case, "org.jboss.test.jca.adapter.TestManagedConnectionFactory". Here is the resulting XML in the JBoss EAP 6 configuration file with modifications to theCopy to Clipboard Copied! Toggle word wrap Toggle overflow <class-name>element value:Copy to Clipboard Copied! Toggle word wrap Toggle overflow