Commit 7606b694 authored by 张俊's avatar 张俊

升级tomcat版本改造

parent f6a2cb52
......@@ -12,7 +12,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller()
@Controller
@RequestMapping(value = "/encrypt")
public class EncryptController {
......
......@@ -3,8 +3,6 @@ package com.changda.gjjapp.encryptor;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.StandardPBEByteEncryptor;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.jasypt.spring4.properties.EncryptablePropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
......@@ -14,21 +12,40 @@ import org.springframework.core.io.DefaultResourceLoader;
@Configuration
public class EncryptorConfig {
/*@Bean
public StandardPBEStringEncryptor standardPBEStringEncryptor() {
EnvironmentStringPBEConfig stringPBEConfig = new EnvironmentStringPBEConfig();
stringPBEConfig.setAlgorithm("PBEWithMD5AndDES");
stringPBEConfig.setPassword("root");
StandardPBEStringEncryptor pbeStringEncryptor = new StandardPBEStringEncryptor();
pbeStringEncryptor.setConfig(stringPBEConfig);
return pbeStringEncryptor;
}*/
/**
* 必须为 static 方法,确保 BeanFactoryPostProcessor 最先被 Spring 创建,
* 且不依赖其他 Bean(如 StringEncryptor),避免循环依赖导致占位符未被解析。
* 同时加载 gjj.properties 和 gjj_bussiness.property,确保所有 ${...} 占位符都能被解析。
*/
@Bean
public EncryptablePropertyPlaceholderConfigurer propertyConfigurer(StringEncryptor pbeStringEncryptor) {
EncryptablePropertyPlaceholderConfigurer placeholderConfigurer = new EncryptablePropertyPlaceholderConfigurer(pbeStringEncryptor);
public static EncryptablePropertyPlaceholderConfigurer propertyConfigurer() {
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
// 加密盐值
config.setPassword("gjjcdgs856177110");
// 加密算法
config.setAlgorithm(StandardPBEByteEncryptor.DEFAULT_ALGORITHM);
// key迭代次数
config.setKeyObtentionIterations("1000");
// 池大小
config.setPoolSize("1");
config.setProviderName("SunJCE");
// 随机盐生成器
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator");
// 加密后输出字符串编码方式
config.setStringOutputType("base64");
encryptor.setConfig(config);
EncryptablePropertyPlaceholderConfigurer placeholderConfigurer = new EncryptablePropertyPlaceholderConfigurer(encryptor);
DefaultResourceLoader defaultResourceLoader = new DefaultResourceLoader();
placeholderConfigurer.setLocations(defaultResourceLoader.getResource("classpath:gjj.properties"));
// 加载两个配置文件,确保 gjj.properties 中的 jdbc.* 属性和 gjj_bussiness.property 中的业务属性都能被解析
placeholderConfigurer.setLocations(
defaultResourceLoader.getResource("classpath:gjj.properties"),
defaultResourceLoader.getResource("classpath:gjj_bussiness.property")
);
// 不忽略无法解析的占位符,发现问题更早暴露
placeholderConfigurer.setIgnoreUnresolvablePlaceholders(false);
return placeholderConfigurer;
}
......@@ -55,5 +72,4 @@ public class EncryptorConfig {
}
}
......@@ -15,15 +15,15 @@ FileTemplatPath=D:\\JavaFileDir
jdbc.type=oracle
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=ENC(O/MRgz1LcC4g+4JLVPeEEQYSJQ8MNNvUJ6ri4Izl5IdK1NEkMhRvmi+54sNI/HmoOOxZpcZY/64vTaXZvKBNQg==)
jdbc.username=GJJ80
jdbc.password=GJJ80_Hg41RG
jdbc.url=jdbc:oracle:thin:@192.168.101.196:1521:zfgjj
jdbc.username=ZHFW80
jdbc.password=ZHFW80_Hg41RG
jdbc.type.ss=oracle
jdbc.driver.ss=oracle.jdbc.driver.OracleDriver
jdbc.url.ss=ENC(O/MRgz1LcC4g+4JLVPeEEQYSJQ8MNNvUJ6ri4Izl5IdK1NEkMhRvmi+54sNI/HmoOOxZpcZY/64vTaXZvKBNQg==)
jdbc.username.ss=GJJ80
jdbc.password.ss=GJJ80_Hg41RG
jdbc.url.ss=jdbc:oracle:thin:@192.168.101.196:1521:zfgjj
jdbc.username.ss=ZHFW80
jdbc.password.ss=ZHFW80_Hg41RG
#jdbc.type=oracle
#jdbc.driver=oracle.jdbc.driver.OracleDriver
......
......@@ -28,7 +28,7 @@
</aop:aspectj-autoproxy>
<!-- 加载配置属性文件 -->
<!--<context:property-placeholder ignore-unresolvable="true" location="classpath:gjj.properties" />-->
<context:property-placeholder ignore-unresolvable="true" location="classpath:gjj_bussiness.property" />
<!--<context:property-placeholder ignore-unresolvable="true" location="classpath:gjj_bussiness.property" />-->
<!-- 加载应用属性实例,可通过 @Value("#{APP_PROP['jdbc.driver']}") String jdbcDriver
方式引用 -->
......@@ -56,9 +56,8 @@
<!-- MyBatis begin -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.changda" />
<property name="typeAliasesSuperType"
value="com.changda.cd4j.foundation.core.persistence.BaseEntity" />
<property name="typeAliasesPackage" value="com.changda.**.entity" />
<property name="typeAliasesSuperType" value="com.changda.cd4j.foundation.core.persistence.BaseEntity" />
<property name="mapperLocations" value="classpath*:/mappings/**/*.xml" />
<property name="configLocation" value="classpath:/mybatis-config.xml"></property>
</bean>
......
......@@ -121,18 +121,18 @@
<activiti.version>5.22.0</activiti.version>
</properties>
<repositories>
<repository>
<id>nexus-central</id>
<name>Central</name>
<url>http://192.168.101.124:8889/nexus/content/repositories/central/</url>
</repository>
<repository>
<id>nexus-repos</id>
<name>Team Nexus Repository</name>
<url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty</url>
</repository>
</repositories>
<!-- <repositories>-->
<!-- <repository>-->
<!-- <id>nexus-central</id>-->
<!-- <name>Central</name>-->
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/central/</url>-->
<!-- </repository>-->
<!-- <repository>-->
<!-- <id>nexus-repos</id>-->
<!-- <name>Team Nexus Repository</name>-->
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty</url>-->
<!-- </repository>-->
<!-- </repositories>-->
<dependencyManagement>
<dependencies>
......@@ -812,17 +812,17 @@
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>nexus distribution snapshot repository</name>
<url>http://192.168.101.124:8889/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus-3rd</id>
<url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty/</url>
</repository>
</distributionManagement>
<!-- <distributionManagement>-->
<!-- <snapshotRepository>-->
<!-- <id>nexus-snapshots</id>-->
<!-- <name>nexus distribution snapshot repository</name>-->
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/snapshots/</url>-->
<!-- </snapshotRepository>-->
<!-- <repository>-->
<!-- <id>nexus-3rd</id>-->
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty/</url>-->
<!-- </repository>-->
<!-- </distributionManagement>-->
<build>
......@@ -834,9 +834,9 @@
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<source>${java.version}</source>
<!--<source>${java.version}</source>
<target>${java.version}</target>
<showWarnings>true</showWarnings>
<showWarnings>true</showWarnings>-->
<encoding>UTF-8</encoding>
</configuration>
</plugin>
......@@ -856,10 +856,10 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>2.6</version>
<configuration>
<source>${java.version}</source>
<!-- <source>${java.version}</source>
<target>${java.version}</target>
<showWarnings>true</showWarnings>
<encoding>UTF-8</encoding>
<encoding>UTF-8</encoding>-->
</configuration>
</plugin>
<plugin>
......@@ -901,10 +901,10 @@
</developer>
</developers>
<modules>
<module>gjjapp-web</module>
<module>gjjapp-common</module>
<module>gjjapp-db</module>
<module>gjjapp-gedai</module>
<module>gjjapp-zhfwpt</module>
<module>gjjapp-db</module>
<module>gjjapp-common</module>
<module>gjjapp-web</module>
</modules>
</project>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment