项目使用Gradle构建
使用Spring Boot
调试时没有出现这个错误,但是执行build命令打包后运行war包,第一次访问数据库的时候就会报com.alibaba.druid.util.JdbcUtils - load druid-driver.properties error
这个错误,查看包的文件信息,这个文件是存在的
下面是堆栈信息
java.io.FileNotFoundException: JAR entry !/META-INF/druid-driver.properties not found in /var/folders/72/vvqq14pn0yb10g0gzyfkt22w0000gn/T/jar_cache3599884772922813489.tmp
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:142)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
at java.net.URL.openStream(URL.java:1038)
at com.alibaba.druid.util.JdbcUtils.(JdbcUtils.java:65)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:507)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:876)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:211)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
1条答案
按热度按时间gz5pxeao1#
我也遇到了相同的问题,使用maven构建基于spring boot 的war包。
pom配置
启动方式
运行环境
MacOS 10.12.3
Java 1.8.0_101
Apache Maven 3.3.9
异常堆栈