Browse Source

Merge remote-tracking branch 'origin/master'

heqinwei 7 years ago
parent
commit
3e94a99f36

+ 13 - 0
.settings/.jsdtscope

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/webapp"/>
+	<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+		<attributes>
+			<attribute name="hide" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

+ 45 - 45
Dockerfile

@@ -1,46 +1,46 @@
-######################
-## Dockerfile to build container images consisting of Node.js and nginx environment
-# Based on Ubuntu
-#####
-
-# Set the base image to Ubuntu
-FROM ubuntu
-# File Author / Maintainer
-# MAINTAINER name Chunteng Xiao
-RUN apt-get clean
-RUN apt-get update
-RUN apt-get install -y software-properties-common
-RUN add-apt-repository ppa:webupd8team/java
-RUN apt-get update
-RUN apt-get -f install -y curl unzip wget tar
-RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
-RUN apt-get install -y oracle-java8-installer 
-RUN apt-get install -y oracle-java8-set-default
-RUN curl --insecure -o ./sonarscanner.zip -L https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip
-RUN unzip sonarscanner.zip
-RUN rm sonarscanner.zip
-ENV SONAR_RUNNER_HOME=/sonar-scanner-3.2.0.1227-linux
-ENV PATH $PATH:/sonar-scanner-3.2.0.1227-linux/bin
-RUN wget http://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.10/bin/apache-tomcat-9.0.10.tar.gz
-RUN tar xzf apache-tomcat-9.0.10.tar.gz
-RUN mv apache-tomcat-9.0.10 apache-tomcat9
-RUN wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
-RUN tar xzvf apache-maven-3.5.4-bin.tar.gz
-RUN ln -s apache-maven-3.5.4 apache-maven
-ENV M2_HOME=//apache-maven
-ENV CATALINA_HOME=/apache-tomcat9
-ENV TOMCAT_HOME=/apache-tomcat9
-ENV MAVEN_HOME=/apache-maven
-ENV PATH=${M2_HOME}/bin:${PATH}
-ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle
-ENV JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
-ADD ca.crt ./
-COPY ./additional_jars ./additional_jars
-COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml
-COPY context.xml ${CATALINA_HOME}/webapps/manager/META-INF/context.xml
-RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
-RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/jssecacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
-RUN mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.2.0.1.0 -Dpackaging=jar -Dfile=./additional_jars/ojdbc7.jar
-COPY sonar-runner.properties ./sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
-EXPOSE 84
+######################
+## Dockerfile to build container images consisting of Node.js and nginx environment
+# Based on Ubuntu
+#####
+
+# Set the base image to Ubuntu
+FROM ubuntu
+# File Author / Maintainer
+# MAINTAINER name Chunteng Xiao
+RUN apt-get clean
+RUN apt-get update
+RUN apt-get install -y software-properties-common
+RUN add-apt-repository ppa:webupd8team/java
+RUN apt-get update
+RUN apt-get -f install -y curl unzip wget tar
+RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
+RUN apt-get install -y oracle-java8-installer 
+RUN apt-get install -y oracle-java8-set-default
+RUN curl --insecure -o ./sonarscanner.zip -L https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip
+RUN unzip sonarscanner.zip
+RUN rm sonarscanner.zip
+ENV SONAR_RUNNER_HOME=/sonar-scanner-3.2.0.1227-linux
+ENV PATH $PATH:/sonar-scanner-3.2.0.1227-linux/bin
+RUN wget http://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.10/bin/apache-tomcat-9.0.10.tar.gz
+RUN tar xzf apache-tomcat-9.0.10.tar.gz
+RUN mv apache-tomcat-9.0.10 apache-tomcat9
+RUN wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
+RUN tar xzvf apache-maven-3.5.4-bin.tar.gz
+RUN ln -s apache-maven-3.5.4 apache-maven
+ENV M2_HOME=//apache-maven
+ENV CATALINA_HOME=/apache-tomcat9
+ENV TOMCAT_HOME=/apache-tomcat9
+ENV MAVEN_HOME=/apache-maven
+ENV PATH=${M2_HOME}/bin:${PATH}
+ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle
+ENV JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
+ADD ca.crt ./
+COPY ./additional_jars ./additional_jars
+COPY tomcat-users.xml ${CATALINA_HOME}/conf/tomcat-users.xml
+COPY context.xml ${CATALINA_HOME}/webapps/manager/META-INF/context.xml
+RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
+RUN keytool -import -trustcacerts -keystore $JAVA_HOME/jre/lib/security/jssecacerts -storepass changeit -noprompt -alias maven2.ca -file ca.crt
+RUN mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.2.0.1.0 -Dpackaging=jar -Dfile=./additional_jars/ojdbc7.jar
+COPY sonar-runner.properties ./sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
+EXPOSE 84
 EXPOSE 8080

BIN
lib/ojdbc6-11.2.0.1.0.jar


+ 3 - 5
pom.xml

@@ -83,11 +83,9 @@
 
     <!-- oracle -->
     <dependency>
-      <groupId>org.oracle</groupId>
-      <artifactId>oracle</artifactId>
-      <version>1.0</version>
-      <scope>system</scope>
-      <systemPath>${project.basedir}/lib/ojdbc6-11.2.0.1.0.jar</systemPath>
+      <groupId>com.oracle</groupId>
+      <artifactId>ojdbc7</artifactId>
+      <version>12.2.0.1.0</version>
     </dependency>
 
     <!-- 引入json处理包 -->

+ 3 - 1
src/main/java/com/util/BasesSource/DynamicDataSourceRegister.java

@@ -124,7 +124,7 @@ public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar,
                 DataSource ds = buildDataSource(dsMap);
                 slaveDataSources.put(rs.getString("id"), ds);
             }
-            } catch (ClassNotFoundException e) {
+        } catch (ClassNotFoundException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         } catch (SQLException e) {
@@ -132,6 +132,8 @@ public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar,
             e.printStackTrace();
         }finally {
             try {
+            	rs.close();
+            	pstmt.close();
                 conn.close();
             } catch (SQLException e) {
                 e.printStackTrace();