How do I migrate my application from AS5 or AS6 to AS7 - JBoss AS 7.0 - Project Documen... - 0 views
-
Configure changes for applications that use Hibernate and JPA
- ...16 more annotations...
-
if your application uses Hibernate 3 classes that are not available in Hibernate 4, for example, some of the validator or search classes, you may see ClassNotFoundExceptions when you deploy your application. If you encounter this problem, you can try one of two approaches: You may be able to resolve the issue by copying the specific Hibernate 3 JARs containing those classes into the application "/lib" directory or by adding them to the classpath using some other method. In some cases this may result in ClassCastExceptions or other class loading issues due to the mixed use of the Hibernate versions, so you will need to use the second approach. You need to tell the server to use only the Hibernate 3 libraries and you will need to add exclusions for the Hibernate 4 libraries. Details on how to do this are described here: JPA Reference Guide.
-
In previous versions of the application server, the JCA data source configuration was defined in a file with a suffix of *-ds.xml. This file was then deployed in the server's deploy directory. The JDBC driver was copied to the server lib/ directory or packaged in the application's WEB-INF/lib/ directory. In AS7, this has all changed. You will no longer package the JDBC driver with the application or in the server/lib directory. The *-ds.xml file is now obsolete and the datasource configuration information is now defined in the standalone/configuration/standalone.xml or in the domain/configuration/domain.xml file. A JDBC 4-compliant driver can be installed as a deployment or as a core module. A driver that is JDBC 4-compliant contains a META-INF/services/java.sql.Driver file that specifies the driver class name. A driver that is not JDBC 4-compliant requires additional steps, as noted below.
-
<connection-url>jdbc:mysql://localhost:3306/YourApplicationURL</connection-url> <driver-class> com.mysql.jdbc.Driver </driver-class> <driver> mysql-connector-java-5.1.15.jar </driver>
-
<security> <user-name> USERID </user-name> <password> PASSWORD</password> </security>
-
example of the driver element for driver that is not JDBC 4-compliant. The driver-class must be specified since it there is no META-INF/services/java.sql.Driver file that specifies the driver class name.
-
JDBC driver can be installed into the container in one of two ways: either as a deployment or as a core module
-
In AS7 standalone mode, you simply copy the JDBC 4-compliant JAR into the AS7_HOME/standalone/deployments directory
-
example of a MySQL JDBC driver installed as a deployment: AS7_HOME/standalone/deployments/mysql-connector-java-5.1.15.jar