JBoss6 Datasource 数据源密码 加密解密机制

安全配置JBoss数据库源
本文介绍了在JBoss环境下安全配置数据库源的方法,包括使用密码加密工具和配置login-config.xml来保护敏感信息,并提供了解密密码的步骤和相关代码。

一、 JBoss下配置数据源时,如果密码直接暴露给了系统的操作员或者维护人员,显然就增加了数据库不安全的因素。

MySQL Datasource配置样例

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  JBoss Server Configuration                                           -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
<!-- $Id: mssql-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ -->

  <!-- ======================================================================-->
  <!-- New ConnectionManager setup for Microsoft SQL Server 2005  driver     -->
  <!-- Further information about the Microsoft JDBC Driver version 1.1      -->
  <!-- can be found here:                                                   -->
  <!-- http://msdn2.microsoft.com/en-us/library/aa496082.aspx               -->  
  <!-- ===================================================================== -->

<datasources>
  <local-tx-datasource>
    <jndi-name>MSSQLDS</jndi-name>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MyDatabase</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <user-name>admin</user-name>
    <password>password</password>
        
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    -->

    <!-- sql to call on an existing pooled connection when it is obtained from pool 
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    -->

    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <metadata>
        <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
  </local-tx-datasource>

</datasources>

 

不用担心,JBoss本身提供了对密码进行加密的工具org.jboss.resource.security.SecureIdentityLoginModule

可以在Windows下用如下命令拿到密码的加密字串:

D:\JBoss\jboss-6.1.0.Final>java -cp client\jboss-logging.jar;lib\jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule password

Encoded password: 5dfc52b51bd35553df8592078de921bc

 

二、 拿到加密的密码后就可以进行加密的数据源配置了
1. 配置 MySQL Datasource

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  JBoss Server Configuration                                           -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
<!-- $Id: mssql-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ -->

  <!-- ======================================================================-->
  <!-- New ConnectionManager setup for Microsoft SQL Server 2005  driver     -->
  <!-- Further information about the Microsoft JDBC Driver version 1.1      -->
  <!-- can be found here:                                                   -->
  <!-- http://msdn2.microsoft.com/en-us/library/aa496082.aspx               -->  
  <!-- ===================================================================== -->

<datasources>
  <local-tx-datasource>
    <jndi-name>MSSQLDS</jndi-name>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MyDatabase</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    
    <!-- REPLACED WITH security-domain BELOW
    <user-name>admin</user-name>
    <password>password</password>
    -->
    <security-domain>EncryptDBPassword</security-domain>
    
    
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    -->

    <!-- sql to call on an existing pooled connection when it is obtained from pool 
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    -->

    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <metadata>
       <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
  </local-tx-datasource>

</datasources>

 

 

2. 配置login-config.xml(一般放到 src\main\resources\META-INF 目录下)

<?xml version='1.0'?>
<!DOCTYPE policy PUBLIC
      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/security_config.dtd">

<policy>
	<!-- Example usage of the SecureIdentityLoginModule -->
	<application-policy name="EncryptedMySQLDbRealm">
		<authentication>
			<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
				<module-option name="username">admin</module-option>
				<module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
				<module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
			</login-module>
		</authentication>
	</application-policy>
</policy>

 

3. 配置jboss-service.xml(一般放到 src\main\resources\META-INF 目录下。我是通过EJB实现DynamicLoginConfig,希望各位提供更便捷的方案)

<?xml version="1.0" encoding="UTF-8"?>
<server>
	<mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="jboss:service=Test.DynamicLoginConfig">
		<attribute name="AuthConfig">META-INF/login-config.xml</attribute>
		<!-- The service which supports dynamic processing of login-config.xml configurations. -->
		<depends optional-attribute-name="LoginConfigService">jboss.security:service=XMLLoginConfig</depends>
		<!-- Optionally specify the security mgr service to use when this service 
			is stopped to flush the auth caches of the domains registered by this service. -->
		<depends optional-attribute-name="SecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
	</mbean>
</server>

 

三、 最后给大家介绍一种解密JBoss加密工具加密的密码
1. 找到SecureIdentityLoginModule所在的包 D:\JBoss\jboss-6.1.0.Final\lib\jbosssx.jar
找到SecureIdentityLoginModule.class,反编译一下就全明白了
加密使用的是: private static String encode(String secret)
自然解密的到是:private static char[] decode(String secret)

注: 推荐反编译工具 JDGUI

2. 在Eclipse下新建包 org.jboss.resource.security ,新建SecureIdentityLoginModule.javaPasswordDecoder.java

SecureIdentityLoginModule.java
(这个类只是为了能让 PasswordDecoder 编译通过,没有实际意义)

package org.jboss.resource.security;

public class SecureIdentityLoginModule {
	private static String encode(String secret) {
		return secret;
	}

	private static char[] decode(String secret) {
		System.out.println("Input password: " + secret);
		return new char[] { '0', '1', '2', '3', '4', '5' };
	}
}

 

PasswordDecoder.java (利用反射 调用SecureIdentityLoginModule 里 private static char[] decode(String secret) 方法)

package org.jboss.resource.security;

import java.lang.reflect.Method;

/**
 * Decode the encoded password.
 * 
 * @author 酒樽舞曲
 * 
 */
public class PasswordDecoder {
	public static void main(String args[]) throws Exception {
		Class<SecureIdentityLoginModule> cla = SecureIdentityLoginModule.class;
		Method m = cla.getDeclaredMethod("decode", String.class);
		m.setAccessible(true);

		Object obj = m.invoke(null, args[0]);
		char[] chars = (char[]) obj;

		System.out.println("Decoded password: " + new String(chars));
	}
}

 

3. 将编译好的 PasswordDecoder.class 放到 D:\JBoss\jboss-6.1.0.Final\lib\jbosssx.jar 中 \org\jboss\resource\security\ 下 (做坏事前先备份)

4. 解密
在Windows下用如下命令拿到密文的解密字串:

D:\JBoss\jboss-6.1.0.Final>java -cp client\jboss-logging.jar;lib\jbosssx.jar org.jboss.resource.security.PasswordDecoder 5dfc52b51bd35553df8592078de921bc

Decoded password: password
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C:\Users\Lenovo\.jdks\corretto-1.8.0_462\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:D:\IntelliJ IDEA 2025.2\lib\idea_rt.jar=12459" -Dfile.encoding=UTF-8 -classpath "C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\charsets.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\access-bridge-64.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\cldrdata.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\dnsns.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\jaccess.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\jfxrt.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\localedata.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\nashorn.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\sunec.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\sunjce_provider.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\sunmscapi.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\sunpkcs11.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\ext\zipfs.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\jce.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\jfr.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\jfxswt.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\jsse.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\management-agent.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\resources.jar;C:\Users\Lenovo\.jdks\corretto-1.8.0_462\jre\lib\rt.jar;E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-auth\target\classes;C:\JAVA\repository\com\alibaba\cloud\spring-cloud-starter-alibaba-nacos-discovery\2021.0.5.0\spring-cloud-starter-alibaba-nacos-discovery-2021.0.5.0.jar;C:\JAVA\repository\com\alibaba\cloud\spring-cloud-alibaba-commons\2021.0.5.0\spring-cloud-alibaba-commons-2021.0.5.0.jar;C:\JAVA\repository\com\alibaba\nacos\nacos-client\2.2.0\nacos-client-2.2.0.jar;C:\JAVA\repository\com\alibaba\nacos\nacos-auth-plugin\2.2.0\nacos-auth-plugin-2.2.0.jar;C:\JAVA\repository\com\alibaba\nacos\nacos-encryption-plugin\2.2.0\nacos-encryption-plugin-2.2.0.jar;C:\JAVA\repository\commons-codec\commons-codec\1.15\commons-codec-1.15.jar;C:\JAVA\repository\com\fasterxml\jackson\core\jackson-core\2.13.5\jackson-core-2.13.5.jar;C:\JAVA\repository\com\fasterxml\jackson\core\jackson-databind\2.13.5\jackson-databind-2.13.5.jar;C:\JAVA\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.5\jackson-annotations-2.13.5.jar;C:\JAVA\repository\org\apache\httpcomponents\httpasyncclient\4.1.5\httpasyncclient-4.1.5.jar;C:\JAVA\repository\org\apache\httpcomponents\httpcore\4.4.16\httpcore-4.4.16.jar;C:\JAVA\repository\org\apache\httpcomponents\httpcore-nio\4.4.16\httpcore-nio-4.4.16.jar;C:\JAVA\repository\org\apache\httpcomponents\httpclient\4.5.14\httpclient-4.5.14.jar;C:\JAVA\repository\io\prometheus\simpleclient\0.15.0\simpleclient-0.15.0.jar;C:\JAVA\repository\io\prometheus\simpleclient_tracer_otel\0.15.0\simpleclient_tracer_otel-0.15.0.jar;C:\JAVA\repository\io\prometheus\simpleclient_tracer_common\0.15.0\simpleclient_tracer_common-0.15.0.jar;C:\JAVA\repository\io\prometheus\simpleclient_tracer_otel_agent\0.15.0\simpleclient_tracer_otel_agent-0.15.0.jar;C:\JAVA\repository\org\yaml\snakeyaml\1.30\snakeyaml-1.30.jar;C:\JAVA\repository\com\alibaba\spring\spring-context-support\1.0.11\spring-context-support-1.0.11.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-commons\3.1.7\spring-cloud-commons-3.1.7.jar;C:\JAVA\repository\org\springframework\security\spring-security-crypto\5.7.9\spring-security-crypto-5.7.9.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-context\3.1.7\spring-cloud-context-3.1.7.jar;C:\JAVA\repository\com\alibaba\cloud\spring-cloud-starter-alibaba-nacos-config\2021.0.5.0\spring-cloud-starter-alibaba-nacos-config-2021.0.5.0.jar;C:\JAVA\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-web\2.7.13\spring-boot-starter-web-2.7.13.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter\2.7.13\spring-boot-starter-2.7.13.jar;C:\JAVA\repository\org\springframework\boot\spring-boot\2.7.13\spring-boot-2.7.13.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-autoconfigure\2.7.13\spring-boot-autoconfigure-2.7.13.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-logging\2.7.13\spring-boot-starter-logging-2.7.13.jar;C:\JAVA\repository\ch\qos\logback\logback-classic\1.2.12\logback-classic-1.2.12.jar;C:\JAVA\repository\ch\qos\logback\logback-core\1.2.12\logback-core-1.2.12.jar;C:\JAVA\repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;C:\JAVA\repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;C:\JAVA\repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;C:\JAVA\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\JAVA\repository\org\springframework\spring-core\5.3.28\spring-core-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-jcl\5.3.28\spring-jcl-5.3.28.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-json\2.7.13\spring-boot-starter-json-2.7.13.jar;C:\JAVA\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.5\jackson-datatype-jdk8-2.13.5.jar;C:\JAVA\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.5\jackson-datatype-jsr310-2.13.5.jar;C:\JAVA\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.5\jackson-module-parameter-names-2.13.5.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-tomcat\2.7.13\spring-boot-starter-tomcat-2.7.13.jar;C:\JAVA\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.76\tomcat-embed-core-9.0.76.jar;C:\JAVA\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.76\tomcat-embed-el-9.0.76.jar;C:\JAVA\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.76\tomcat-embed-websocket-9.0.76.jar;C:\JAVA\repository\org\springframework\spring-web\5.3.28\spring-web-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-beans\5.3.28\spring-beans-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-webmvc\5.3.28\spring-webmvc-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-aop\5.3.28\spring-aop-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-context\5.3.28\spring-context-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-expression\5.3.28\spring-expression-5.3.28.jar;E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-common\ruoyi-common-security\target\classes;E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-api\ruoyi-api-system\target\classes;E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-common\ruoyi-common-core\target\classes;C:\JAVA\repository\org\springframework\cloud\spring-cloud-starter-openfeign\3.1.8\spring-cloud-starter-openfeign-3.1.8.jar;C:\JAVA\repository\io\github\openfeign\feign-core\11.10\feign-core-11.10.jar;C:\JAVA\repository\io\github\openfeign\feign-slf4j\11.10\feign-slf4j-11.10.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-starter-loadbalancer\3.1.7\spring-cloud-starter-loadbalancer-3.1.7.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-loadbalancer\3.1.7\spring-cloud-loadbalancer-3.1.7.jar;C:\JAVA\repository\io\projectreactor\reactor-core\3.4.30\reactor-core-3.4.30.jar;C:\JAVA\repository\org\reactivestreams\reactive-streams\1.0.4\reactive-streams-1.0.4.jar;C:\JAVA\repository\io\projectreactor\addons\reactor-extra\3.4.10\reactor-extra-3.4.10.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-cache\2.7.13\spring-boot-starter-cache-2.7.13.jar;C:\JAVA\repository\com\stoyanr\evictor\1.0.0\evictor-1.0.0.jar;C:\JAVA\repository\org\springframework\spring-context-support\5.3.28\spring-context-support-5.3.28.jar;C:\JAVA\repository\com\alibaba\transmittable-thread-local\2.14.3\transmittable-thread-local-2.14.3.jar;C:\JAVA\repository\com\github\pagehelper\pagehelper-spring-boot-starter\1.4.7\pagehelper-spring-boot-starter-1.4.7.jar;C:\JAVA\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.3.1\mybatis-spring-boot-starter-2.3.1.jar;C:\JAVA\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.3.1\mybatis-spring-boot-autoconfigure-2.3.1.jar;C:\JAVA\repository\org\mybatis\mybatis\3.5.13\mybatis-3.5.13.jar;C:\JAVA\repository\org\mybatis\mybatis-spring\2.1.1\mybatis-spring-2.1.1.jar;C:\JAVA\repository\com\github\pagehelper\pagehelper-spring-boot-autoconfigure\1.4.7\pagehelper-spring-boot-autoconfigure-1.4.7.jar;C:\JAVA\repository\com\github\pagehelper\pagehelper\5.3.3\pagehelper-5.3.3.jar;C:\JAVA\repository\com\github\jsqlparser\jsqlparser\4.5\jsqlparser-4.5.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-validation\2.7.13\spring-boot-starter-validation-2.7.13.jar;C:\JAVA\repository\org\hibernate\validator\hibernate-validator\6.2.5.Final\hibernate-validator-6.2.5.Final.jar;C:\JAVA\repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;C:\JAVA\repository\org\jboss\logging\jboss-logging\3.4.3.Final\jboss-logging-3.4.3.Final.jar;C:\JAVA\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\JAVA\repository\com\alibaba\fastjson2\fastjson2\2.0.39\fastjson2-2.0.39.jar;C:\JAVA\repository\io\jsonwebtoken\jjwt\0.9.1\jjwt-0.9.1.jar;C:\JAVA\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;C:\JAVA\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;C:\JAVA\repository\org\apache\commons\commons-lang3\3.12.0\commons-lang3-3.12.0.jar;C:\JAVA\repository\commons-io\commons-io\2.13.0\commons-io-2.13.0.jar;C:\JAVA\repository\org\apache\poi\poi-ooxml\4.1.2\poi-ooxml-4.1.2.jar;C:\JAVA\repository\org\apache\poi\poi-ooxml-schemas\4.1.2\poi-ooxml-schemas-4.1.2.jar;C:\JAVA\repository\org\apache\xmlbeans\xmlbeans\3.1.0\xmlbeans-3.1.0.jar;C:\JAVA\repository\org\apache\commons\commons-compress\1.19\commons-compress-1.19.jar;C:\JAVA\repository\com\github\virtuald\curvesapi\1.06\curvesapi-1.06.jar;C:\JAVA\repository\org\apache\poi\poi\4.1.2\poi-4.1.2.jar;C:\JAVA\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;C:\JAVA\repository\org\apache\commons\commons-math3\3.6.1\commons-math3-3.6.1.jar;C:\JAVA\repository\com\zaxxer\SparseBitSet\1.2\SparseBitSet-1.2.jar;C:\JAVA\repository\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;C:\JAVA\repository\com\baomidou\mybatis-plus-boot-starter\3.3.0\mybatis-plus-boot-starter-3.3.0.jar;C:\JAVA\repository\com\baomidou\mybatis-plus\3.3.0\mybatis-plus-3.3.0.jar;C:\JAVA\repository\com\baomidou\mybatis-plus-extension\3.3.0\mybatis-plus-extension-3.3.0.jar;C:\JAVA\repository\com\baomidou\mybatis-plus-core\3.3.0\mybatis-plus-core-3.3.0.jar;C:\JAVA\repository\com\baomidou\mybatis-plus-annotation\3.3.0\mybatis-plus-annotation-3.3.0.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-jdbc\2.7.13\spring-boot-starter-jdbc-2.7.13.jar;C:\JAVA\repository\com\zaxxer\HikariCP\4.0.3\HikariCP-4.0.3.jar;C:\JAVA\repository\org\springframework\spring-jdbc\5.3.28\spring-jdbc-5.3.28.jar;C:\JAVA\repository\org\projectlombok\lombok\1.18.28\lombok-1.18.28.jar;C:\JAVA\repository\org\apache\httpcomponents\httpmime\4.5.14\httpmime-4.5.14.jar;C:\JAVA\repository\cn\hutool\hutool-all\5.3.4\hutool-all-5.3.4.jar;C:\JAVA\repository\com\drewnoakes\metadata-extractor\2.15.0\metadata-extractor-2.15.0.jar;C:\JAVA\repository\com\adobe\xmp\xmpcore\6.0.6\xmpcore-6.0.6.jar;C:\JAVA\repository\com\belerweb\pinyin4j\2.5.0\pinyin4j-2.5.0.jar;C:\JAVA\repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;C:\JAVA\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\JAVA\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\JAVA\repository\org\locationtech\proj4j\proj4j\1.3.0\proj4j-1.3.0.jar;C:\JAVA\repository\org\locationtech\proj4j\proj4j-epsg\1.3.0\proj4j-epsg-1.3.0.jar;C:\JAVA\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar;C:\JAVA\repository\org\freemarker\freemarker\2.3.32\freemarker-2.3.32.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-openfeign-core\3.1.8\spring-cloud-openfeign-core-3.1.8.jar;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-aop\2.7.13\spring-boot-starter-aop-2.7.13.jar;C:\JAVA\repository\org\aspectj\aspectjweaver\1.9.7\aspectjweaver-1.9.7.jar;C:\JAVA\repository\io\github\openfeign\form\feign-form-spring\3.8.0\feign-form-spring-3.8.0.jar;C:\JAVA\repository\io\github\openfeign\form\feign-form\3.8.0\feign-form-3.8.0.jar;C:\JAVA\repository\commons-fileupload\commons-fileupload\1.5\commons-fileupload-1.5.jar;E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-common\ruoyi-common-redis\target\classes;C:\JAVA\repository\org\springframework\boot\spring-boot-starter-data-redis\2.7.13\spring-boot-starter-data-redis-2.7.13.jar;C:\JAVA\repository\org\springframework\data\spring-data-redis\2.7.13\spring-data-redis-2.7.13.jar;C:\JAVA\repository\org\springframework\data\spring-data-keyvalue\2.7.13\spring-data-keyvalue-2.7.13.jar;C:\JAVA\repository\org\springframework\data\spring-data-commons\2.7.13\spring-data-commons-2.7.13.jar;C:\JAVA\repository\org\springframework\spring-tx\5.3.28\spring-tx-5.3.28.jar;C:\JAVA\repository\org\springframework\spring-oxm\5.3.28\spring-oxm-5.3.28.jar;C:\JAVA\repository\redis\clients\jedis\3.8.0\jedis-3.8.0.jar;C:\JAVA\repository\org\apache\commons\commons-pool2\2.11.1\commons-pool2-2.11.1.jar;C:\JAVA\repository\com\mysql\mysql-connector-j\8.0.33\mysql-connector-j-8.0.33.jar;C:\JAVA\repository\com\google\guava\guava\30.1.1-jre\guava-30.1.1-jre.jar;C:\JAVA\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\JAVA\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\JAVA\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\JAVA\repository\org\checkerframework\checker-qual\3.8.0\checker-qual-3.8.0.jar;C:\JAVA\repository\com\google\errorprone\error_prone_annotations\2.5.1\error_prone_annotations-2.5.1.jar;C:\JAVA\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-starter-bootstrap\3.1.7\spring-cloud-starter-bootstrap-3.1.7.jar;C:\JAVA\repository\org\springframework\cloud\spring-cloud-starter\3.1.7\spring-cloud-starter-3.1.7.jar;C:\JAVA\repository\org\springframework\security\spring-security-rsa\1.0.11.RELEASE\spring-security-rsa-1.0.11.RELEASE.jar;C:\JAVA\repository\org\bouncycastle\bcpkix-jdk15on\1.69\bcpkix-jdk15on-1.69.jar;C:\JAVA\repository\org\bouncycastle\bcprov-jdk15on\1.69\bcprov-jdk15on-1.69.jar;C:\JAVA\repository\org\bouncycastle\bcutil-jdk15on\1.69\bcutil-jdk15on-1.69.jar" com.ruoyi.auth.RuoYiAuthApplication 14:26:55.068 [main] INFO c.a.n.c.e.SearchableProperties - [sortPropertySourceDefaultOrder,197] - properties search order:PROPERTIES->JVM->ENV->DEFAULT_SETTING 14:26:55.094 [background-preinit] DEBUG org.jboss.logging - [logProvider,152] - Logging Provider: org.jboss.logging.Log4j2LoggerProvider 14:26:55.094 [background-preinit] INFO o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final 14:26:55.099 [background-preinit] DEBUG o.h.v.i.x.c.ValidationXmlParser - [getValidationXmlInputStream,120] - Trying to load META-INF/validation.xml for XML based Validator configuration. 14:26:55.100 [background-preinit] DEBUG o.h.v.i.x.c.ResourceLoaderHelper - [getResettableInputStreamForPath,60] - Trying to load META-INF/validation.xml via TCCL 14:26:55.101 [background-preinit] DEBUG o.h.v.i.x.c.ResourceLoaderHelper - [getResettableInputStreamForPath,66] - Trying to load META-INF/validation.xml via Hibernate Validator's class loader 14:26:55.101 [background-preinit] DEBUG o.h.v.i.x.c.ValidationXmlParser - [getValidationXmlInputStream,127] - No META-INF/validation.xml found. Using annotation based configuration only. 14:26:55.103 [background-preinit] DEBUG o.h.v.i.e.r.TraversableResolvers - [getDefault,60] - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. 14:26:55.116 [background-preinit] DEBUG o.h.v.m.ResourceBundleMessageInterpolator - [buildExpressionFactory,172] - Loaded expression factory via original TCCL 14:26:55.217 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [determinePropertyNodeNameProvider,345] - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider. 14:26:55.220 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [logValidatorFactoryScopedConfiguration,420] - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator. 14:26:55.220 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [logValidatorFactoryScopedConfiguration,421] - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver. 14:26:55.220 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [logValidatorFactoryScopedConfiguration,422] - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider. 14:26:55.221 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [logValidatorFactoryScopedConfiguration,423] - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider. 14:26:55.221 [background-preinit] DEBUG o.h.v.i.e.ValidatorFactoryConfigurationHelper - [logValidatorFactoryScopedConfiguration,424] - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory. 14:26:55.282 [main] INFO c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success. 14:26:55.282 [main] INFO c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.13) 14:27:05.056 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[project-public.yaml] & group[DEV] 14:27:05.395 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[project-mysql.yaml] & group[DEV] 14:27:05.723 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[ruoyi-auth] & group[DEV] 14:27:06.055 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[ruoyi-auth.yaml] & group[DEV] 14:27:06.062 [main] INFO c.r.a.RuoYiAuthApplication - [logStartupProfileInfo,631] - No active profile set, falling back to 1 default profile: "default" 14:27:06.739 [main] DEBUG o.a.i.l.LogFactory - [setImplementation,109] - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter. 14:27:06.740 [main] DEBUG o.m.s.m.ClassPathMapperScanner - [scanCandidateComponents,435] - Identified candidate component class: file [E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-auth\target\classes\com\ruoyi\auth\dao\SysBlackIpDao.class] 14:27:06.740 [main] DEBUG o.m.s.m.ClassPathMapperScanner - [debug,49] - Creating MapperFactoryBean with name 'sysBlackIpDao' and 'com.ruoyi.auth.dao.SysBlackIpDao' mapperInterface 14:27:06.742 [main] DEBUG o.m.s.m.ClassPathMapperScanner - [debug,49] - Enabling autowire by type for MapperFactoryBean with name 'sysBlackIpDao'. 14:27:07.101 [main] INFO o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-8080"] 14:27:07.102 [main] INFO o.a.c.c.StandardService - [log,173] - Starting service [Tomcat] 14:27:07.102 [main] INFO o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.76] 14:27:07.249 [main] INFO o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext 14:27:07.556 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - [refresh,591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tokenController': Unsatisfied dependency expressed through field 'sysLoginService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysLoginService': Unsatisfied dependency expressed through field 'sysBlackIpDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysBlackIpDao' defined in file [E:\前后端代码\shigong-new_20250810 (2)\shigong-new - 副本\ruoyi-auth\target\classes\com\ruoyi\auth\dao\SysBlackIpDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class 14:27:07.559 [main] INFO o.a.c.c.StandardService - [log,173] - Stopping service [Tomcat] 14:27:07.579 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] - *************************** APPLICATION FAILED TO START *************************** Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). 14:27:07.580 [Thread-9] WARN c.a.n.c.n.NotifyCenter - [shutdown,136] - [NotifyCenter] Start destroying Publisher 14:27:07.580 [Thread-3] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,102] - [HttpClientBeanHolder] Start destroying common HttpClient 14:27:07.580 [Thread-9] WARN c.a.n.c.n.NotifyCenter - [shutdown,153] - [NotifyCenter] Destruction of the end 14:27:07.581 [Thread-3] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,111] - [HttpClientBeanHolder] Destruction of the end 进程已结束,退出代码为 1 解析一下生成结果
最新发布
08-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值