nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
起初一直以为是配置文件本身的问题,直到看到target没有该yaml文件,以前一直都是只引入src/main/java中的内容,并无引入resources文件夹中的内容,才导致了该难以发现的Bug。
解决办法就是在pom文件中加入resource,引入resources目录中的配置文件:
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.yaml</include>
</includes>
<filtering>false</filtering>
</resource>
Bug复现:nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class起初一直以为是配置文件本身的问题,直到看到target没有该yaml文件,以前一直都是只引入src/main/java中的内容,并无引入resources文件夹中
# global cli
npm i -g serverless-config-generator
yarn global add serverless-config-generator
npm i -D serverless-config-generator
yarn add -D serverless-config-generator
如果你全局安装,你可以运行
# in your
target
dir
sls-gen
# serverless.js to serverless.yml
sls-gen -i serverless.layer.js -o serverless.layer.yml
或者在 Node.js 中编写 jscode
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: linux-aarch64-gnu-g++ (arm64, CPU features: neon)
Target
compiler: gcc 6.3.1
Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports stl
Build options:
Mode ................................... release
Optimize release build for size ........ no
Building shared libraries .............. yes
Using C standard ....................... C11
Using C++ standard ..................... C++14
Using ccache ........................... no
Using gold linker ...................... yes
Using new DTAGS ........................ yes
Using precompiled headers .............. yes
Using LTCG ............................. no
Target
compiler supports:
NEON ................................. yes
Build parts ............................ libs
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... yes
udev ................................... no
Using system zlib ...................... yes
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. yes
ICU .................................... no
Tracing backend ........................
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getifaddrs() ........................... yes
IPv6 ifname ............................ yes
libproxy ............................... no
Linux AF_NETLINK ....................... yes
OpenSSL ................................ yes
Qt directly linked to OpenSSL ........ no
OpenSSL 1.1 ............................ no
DTLS ................................... yes
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ no
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... yes
PNG .................................. yes
Using system libpng ................ no
EGL .................................... no
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon .............................. no
X11 specific:
XLib ................................. no
EGL on X11 ........................... no
QPA backends:
DirectFB ............................... no
EGLFS .................................. no
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
Qt Sql:
SQL item models ........................ yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... no
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt Testlib:
Tester for item models ................. yes
Qt SerialBus:
Socket CAN ............................. yes
Socket CAN FD .......................... yes
Qt QML:
QML network support .................... yes
QML de
bug
ging and profiling support .... yes
QML sequence object .................... yes
QML list model ......................... yes
QML XML http request ................... yes
QML Locale ............................. yes
QML delegate model ..................... yes
Qt Quick:
Direct3D 12 ............................ no
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
TableView item ......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
Repeater item .......................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Scxml:
ECMAScript data model for QtScxml ...... yes
Qt Gamepad:
SDL2 ................................... no
Qt 3D:
Assimp ................................. yes
System Assimp .......................... no
Output Qt3D Job traces ................. no
Output Qt3D GL traces .................. no
Use SSE2 instructions .................. no
Use AVX2 instructions .................. no
Aspects:
Render aspect ........................ yes
Input aspect ......................... yes
Logic aspect ......................... yes
Animation aspect ..................... yes
Extras aspect ........................ yes
Qt 3D Renderers:
OpenGL Renderer ........................ yes
Qt 3D GeometryLoaders:
Autodesk FBX ........................... no
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Qt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
WinRT Bluetooth API (desktop & UWP) .... no
Qt Sensors:
sensorfw ............................... no
Qt Quick Controls 2:
Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Qt.labs.location experimental QML plugin . yes
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. no
Itemsoverlay ......................... yes
QtXmlPatterns:
XML schema support ..................... yes
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ yes
OpenAL ................................. no
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... no
Qt Tools:
QDoc ................................... no
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... no
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... no
Geolocation ............................ yes
WebChannel support ..................... yes
Use v8 snapshot ........................ yes
Kerberos Authentication ................ no
Building v8 snapshot supported ......... yes
Use ALSA ............................... no
Use PulseAudio ......................... no
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . no
opus ................................. no
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
glib ................................. no
zlib ................................. yes
minizip .............................. no
libevent ............................. no
jsoncpp .............................. no
protobuf ............................. no
libxml2 and libxslt .................. no
lcms2 ................................ no
png .................................. no
JPEG ................................. no
harfbuzz ............................. no
freetype ............................. no
x11 .................................. no
Required system libraries:
fontconfig ........................... no
dbus ................................. no
nss .................................. no
khr .................................. no
glibc ................................ yes
Required system libraries for qpa-xcb:
libdrm ............................... no
xcomposite ........................... no
xcursor .............................. no
xi ................................... no
xrandr ............................... no
xtst ................................. no
Note: Also available for Linux: linux-clang linux-icc
spring boot
启动
报错:
Factory method ‘dataSource’ threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
原因1:未
配置
数据源
解决方法:
@
SpringBoot
App
在做
文件
上传为服务和搜索为服务时候,没有用到数据库连接,但是
springboot
会自动帮我们注入数据源,但是我们又没有
配置
数据源和驱动就会报错:
解决:
启动
了i注解中加:exclude={DataSourceAutoConfiguration.class}如下
@
SpringBoot
Application(exclude={DataSourceAutoConfiguration.class})
最近在做
springboot
项目,
启动
application的时候就报上面图片里的错,花了一天半的时候才解决了这个问题,成功
启动
了项目。
经过细致的排查,如反复检查
配置
文件
中的信息是否填写错误、MySQL和MongoDB是否在虚拟机中已
启动
等,最终终于找到了原因,有以下两个:
src包下的
配置
文件
的图标是这样的,而实际上
配置
文件
如果能生效,图标应该是下图这样的:
对于这个问题,我的解决办法是:
找到project structure,然后点击modules,点击右边正在做的项目,看是否有spr.
1.spring boot升级到2.0之后,
配置
数据源会遇到这样的错误:
jdbcUrl is required with driverClassName.
Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.] with root cause
解决...