Jboss Deploy Jdbc Driver Maven



Note on MySQL driver and JDBC Type 4 compliance: while the MySQL driver (at least up to 5.1.18) is designed to be a Type 4 driver, its jdbcCompliant method always return false. The reason is that the driver does not pass SQL 92 full compliance tests, says MySQL. Thus, you will need to install the MySQL JDBC driver as a module (see below). For example, the following command deploys a MySQL JDBC driver. Deploy /path/to /mysql-connector-java-8.0.12.jar. A message will be displayed in the JBoss EAP server log that displays the deployed driver name, which will be used when defining datasources. WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-8.0.12.jar. Dear all, I'm trying to set up an EAR project from Netbeans, using the wildfly-maven-plugin (1.0.2-Final) in a maven project. I'm able to upload the mysql connector as a jdbc driver, and I can create a datasource manually based on it.

Postgresql Jdbc Driver Maven

JBoss Seam is a Java EE-based framework that provides a uniform component model for all the business logic in a Web application and integration between the presentation and the business logic layers. JBoss Seam provides fine-grained state management with its new state contexts. Seam introduces the conversation context, which spans across multiple requests, making it feasible for a user to carry on multiple conversations concurrently, a conversation being a unit of user interaction with an application. The HTTP Session also preserves state across requests, but the state from multiple interactions with an application is not isolated; conversations are not demarcated, and no conversation context is provided. JBoss Seam provides the business process context for long-running business processes consisting of multiple interactions with multiple users. In this tutorial, we shall create a JBoss Seam Model View Controller (MVC) application consisting of an EJB 3.0 entity bean, a stateful session bean, and a JSF user interface.

This tutorial has the following sections.

  • Setting the Environment
  • Creating a JBoss Seam Web Project
  • Creating the JBoss Seam Deployment Structure

Setting the Environment

We need to install the following software:

  • JBoss Application Server 7
  • MySQL 5.6 Database (Community Edition)
  • Eclipse IDE for Java EE Developers
  • JBoss Tools (installed as a plug-in to Eclipse
  • Apache Maven (version 3.4 or later)

  • Figure 4: Configuring the Web Module settings

    For JSF Capabilities, select JSF Implementation Library as Library Provided by Target Runtime. Select Configure JSF servlet in the deployment descriptor. Select the default settings for JSF Configuration File (/WEB-INF/faces-config.xml), JSF Servlet Name (Faces Servlet), JSF Servlet Class Name (javax.faces.webapp.FacesServlet), and URL Mapping Patterns (*.seam).


    Figure 5: Selecting the JSF Implementation Library

    Next, configure the Seam Facet. Select Deploy as EAR. To add a Seam Runtime, click Add. In Home Folder, select the folder in which the JBoss Seam 2.2.0 is installed. Specify a Name (jboss-seam-2.2.0) and click Finish.


    Figure 6: Configuring the Seam Facet

    The Seam runtime gets configured. The EJB project name and the EAR project name get specified. In Libraries, select Copy Libraries from Seam Runtime. Select Database Type as MySQL 5(InnoDB). To create a new Connection profile, click New.


    Figure 7: Configuring the Seam runtime

    Select Connection Profile Type as MySQL and specify Name (MySQLConnection). Click Next.


    Figure 8: Selecting the Connection Profile Type

    Next, specify the driver and connection details. Select the MySQL JDBC Driver. In Properties, specify Database as test, URL as jdbc:mysql://localhost:3306/test, Username as root, and the Password. Click Test Connection to test the connection. If the message Ping succeeded gets displayed, click Next.


    Figure 9: Specifying the driver and connection details

    Db2 Jdbc Driver Maven

    In Summary, click Finish.


    Figure 10: Clicking Finish

    Deploy

    The new Connection Profile gets added. Click Finish.

    Jboss Deploy Jdbc Driver Maven Dependency


    Figure 11: The Connection Profile is added

    The Seam facet gets installed.


    Figure 12: The Seam facet is installed

    This project is associated with a Seam Perspective. A Seam Web Project, catalog, gets created as shown in the Package Explorer.


    Figure 13: Associating the project with a Seam Perspective

    We won't be using the default Seam project. Delete all the files and directories from the project root folder catalog. Add the sample Seam project for this tutorial to the catalog folder. Select File|Refresh to add the sample Seam project to the Package Explorer.


    Figure 14: Deleting files and directories from the catalog project root folder

    Next, we shall discuss each of the sub-projects catalog-ear, catalog-ejb, and catalog-web.

    Creating the JBoss Seam Deployment Structure

    Classloading in JBoss AS 7 is based on modules, with each module providing some class packages. Classes in one module are not available in another module. Some module dependencies are added by default to a JBoss application based on its requirements; for example, the Hibernate JPA API module is made available in a EJB 3.0 JPA application. The module dependencies added by default are the implicit module dependencies. The catalogcatalog-earsrcmainapplicationMETA-INFjboss-deployment-structure.xml file may be used for fine-grained class loading, such as add additional module dependencies or excluding some implicit module dependencies. Because we are using JSF 2.0, we need to exclude the JSF 1.2 modules and add the JSF 2.0 modules. Also, add the org.dom4j module. The jboss-deployment-structure.xml file is listed below.

    The jboss-deployment-structure.xml file is shown in the Project Explorer.


    Figure 15: The jboss-deployment-structure.xml file

    We also need to create a MySQL datasource with JNDI MySQLDS. In the next article, we shall discuss creating an entity bean and a session bean façade.


    This article was originally published on September 28, 2016

    Maven Jdbc Driver