Uploaded image for project: 'Demographic Data Server'
  1. Demographic Data Server
  2. DDS-184

Extract datasource configuration

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None
    • Account:
      Maintenance 2018 (MAINTENANCE2018)

      Description

      Extract the datasource configuration from the EAR file.

      1.1 - Remove these properties of persistence.xml (and hibernate.cfg.xml if exists):
                  <property name="hibernate.connection.url" value="${jdbc.connection.url}"/>
                  <property name="hibernate.connection.username" value="${jdbc.user}"/>
                  <property name="hibernate.connection.password" value="${jdbc.password}"/>
                  <property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"/>
      1.2 - Add this property to persistence.xml (and hibernate.cfg.xml if exists):
                   <property name="hibernate.connection.datasource" value="JBOSS/DATASOURCE/PATH"/>
      JBOSS/DATASOURCE/PATH is the jndi-name defined in the datasource configuration file.

      2 - Create zip containing the datasource file:
        2.1 - In the pom.xml file of the ear, if the maven-assembly-plugin is set, add
      <descriptor>src/main/assembly/datasource.xml</descriptor>
       otherwise add the plugin :
                              <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>2.2.1</version>
      <configuration>
      <descriptors>
      <descriptor>src/main/assembly/datasource.xml</descriptor>
      </descriptors>
      </configuration>
      <executions>
      <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
      <goal>single</goal>
      </goals>
      </execution>
      </executions>
      </plugin>
        2.2 - Create the 'src/main/assembly' folder if doesn't exist and create the datasource.xml file into this folder with the following content:
      <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
          <id>datasource</id>
          <baseDirectory>/</baseDirectory>
          <formats>
              <format>zip</format>
          </formats>
          <fileSets>
              <fileSet>
                  <directory>src/main/datasource</directory>
                  <outputDirectory>/</outputDirectory>
              </fileSet>
          </fileSets>
      </assembly>
        2.3 - Create the folder 'src/main/datasource' and move the datasource configuration file from 'src/main/application/META-INF' to 'src/main/datasource'

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marif Maxime Arif (Inactive)
              Reporter:
              marif Maxime Arif (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Time Spent - 30 minutes Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - 30 minutes Remaining Estimate - 30 minutes
                  30m

                    Potential Duplicates