Parcourir la source

fix dev datasource

arkha il y a 1 an
Parent
commit
070d4e82e6

+ 2 - 0
MWUI/.dockerignore

@@ -0,0 +1,2 @@
+.DS_Store
+pom.xml

+ 25 - 0
MWUI/Dockerfile

@@ -0,0 +1,25 @@
+FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi
+
+ARG VERSION=1.0
+ARG REVISION=SNAPSHOT
+
+LABEL \
+    org.opencontainers.image.authors="Arkhadius" \
+    org.opencontainers.image.vendor="Hanoman" \
+    org.opencontainers.image.url="local" \
+    org.opencontainers.image.source="https://code.senomas.com/arkha/btnmw-was/MWUI" \
+    org.opencontainers.image.version="$VERSION" \
+    org.opencontainers.image.revision="$REVISION" \
+    vendor="Hanoman" \
+    name="mwui" \
+    version="$VERSION-$REVISION" \
+    summary="The MWUI microservice from the Containerizing microservices MWUI" \
+    description="This image contains the MWUI microservice running with the Open Liberty runtime."
+
+USER root
+
+COPY --chown=1001:0 dev/config/server.xml /config/
+RUN features.sh
+COPY --chown=1001:0 target/MWUI-1.0.war /config/apps
+RUN configure.sh
+USER 1001

BIN
MWUI/dev/config/lib/db2jcc4.jar


+ 72 - 1
MWUI/dev/config/server.xml

@@ -1,15 +1,86 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <server description="new server">
-
     <!-- Enable features -->
     <featureManager>
         <feature>jsp-2.3</feature>
         <feature>ssl-1.0</feature>
+        <feature>jdbc-4.2</feature>
         <feature>servlet-4.0</feature>
+        <feature>jndi-1.0</feature>
     </featureManager>
 
     <variable name="http.port" defaultValue="9080" />
     <variable name="https.port" defaultValue="9443" />
+    <variable name="serverdb.name" defaultValue="10.10.10.36" />
+    <variable name="serverdb.port" defaultValue="50000" />
+    <variable name="db.user" defaultValue="db2inst1" />
+    <variable name="db.pwd" defaultValue="mdw4dm1n" />
+
+    <library id="DB2Library">
+        <fileset dir="lib" includes="db2jcc4.jar" />
+    </library>
+
+    <dataSource id="MWAPP_DS" jndiName="jdbc/db2/mwapp_mwapp_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            databaseName="MWAPP"
+            currentSchema="MWAPP"
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+    <dataSource id="MWBP_DS" jndiName="jdbc/db2/mwapp_mwbp_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            currentSchema="MWBP"
+            databaseName="MWAPP"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+    <dataSource id="MWTEMP_DS" jndiName="jdbc/db2/mwtemp_mwtemp_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            currentSchema="MWTEMP"
+            databaseName="MWTEMP"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+    <dataSource id="MWRECON_DS" jndiName="jdbc/db2/mwapp_mwrecon_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            currentSchema="MWRECON"
+            databaseName="MWAPP"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+    <dataSource id="MWLOG_DS" jndiName="jdbc/db2/mwlog_mwlog_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            currentSchema="MWLOG"
+            databaseName="MWLOG"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+    <dataSource id="MWCONFIG_DS" jndiName="jdbc/db2/mwconfig_mwconfig_ds">
+        <jdbcDriver libraryRef="DB2Library" />
+        <properties.db2.jcc
+            serverName="${serverdb.name}"
+            portNumber="${serverdb.port}"
+            currentSchema="MWCONFIG"
+            databaseName="MWCONFIG"
+            user="${db.user}"
+            password="${db.pwd}" />
+    </dataSource>
+
     <!-- To access this server from a remote client add a host attribute to the following element,
     e.g. host="*" -->
     <httpEndpoint id="defaultHttpEndpoint"

+ 1 - 1
MWUI/src/main/resources/hibernate-mwapp-config.cfg.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
 	<session-factory>
-		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 		<property name="hibernate.connection.datasource">jdbc/db2/mwapp_mwapp_ds</property>
+		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>

+ 1 - 1
MWUI/src/main/resources/hibernate-mwapp.cfg.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
 	<session-factory>
+		<property name="hibernate.connection.datasource">jdbc/db2/mwapp_mwbp_ds</property>
 		<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
-		<property name="hibernate.connection.datasource">jdbc/db2/mwconfig_mwui_ds</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>

+ 1 - 1
MWUI/src/main/resources/hibernate-mwrecon.cfg.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
 	<session-factory>
-		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 		<property name="hibernate.connection.datasource">jdbc/db2/mwapp_mwrecon_ds</property>
+		<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
 
 		<property name="hibernate.show_sql">false</property>
 		<property name="hibernate.format_sql">true</property>