when setting up springboot, boot fails with the error
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
the solution: add a exclude = DataSourceAutoConfiguration. Class p>
before:
package App;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
after:
package App;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
works normally, solve
. ____ _ __ _ _
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, |////
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.5.RELEASE)
2018-10-13 10:38:15.265 INFO 7288 --- [ main] App.App : Starting App on Y9SVAFMN942HYRY with PID 7288 (D:\boot_1\target\classes started by Administrator in D:\boot_1)
2018-10-13 10:38:15.271 INFO 7288 --- [ main] App.App : No active profile set, falling back to default profiles: default
2018-10-13 10:38:15.453 INFO 7288 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@50a6f6: startup date [Sat Oct 13 10:38:15 CST 2018]; root of context hierarchy
2018-10-13 10:38:18.881 INFO 7288 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-10-13 10:38:18.942 INFO 7288 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-10-13 10:38:18.942 INFO 7288 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-10-13 10:38:18.967 INFO 7288 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_161\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_161/bin/client;C:/Program Files/Java/jre1.8.0_161/bin;C:/Program Files/Java/jre1.8.0_161/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\namd-tutorial\NAMD_2.8\NAMD_2.8_Win32-multicore;D:\Program Files\Anaconda3;D:\Program Files\Anaconda3\Scripts;D:\Program Files\Anaconda3\Library\bin;;D:\eclipse-jee-oxygen-3-win32\eclipse;;.]
2018-10-13 10:38:19.506 INFO 7288 --- [ost-startStop-1] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-10-13 10:38:19.515 INFO 7288 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-10-13 10:38:19.515 INFO 7288 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4066 ms
2018-10-13 10:38:20.059 INFO 7288 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-10-13 10:38:20.068 INFO 7288 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-10-13 10:38:20.069 INFO 7288 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-10-13 10:38:20.069 INFO 7288 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-10-13 10:38:20.070 INFO 7288 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-10-13 10:38:20.367 INFO 7288 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-13 10:38:20.993 INFO 7288 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@50a6f6: startup date [Sat Oct 13 10:38:15 CST 2018]; root of context hierarchy
2018-10-13 10:38:21.159 INFO 7288 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-10-13 10:38:21.162 INFO 7288 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-10-13 10:38:21.216 INFO 7288 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-13 10:38:21.216 INFO 7288 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-13 10:38:21.662 INFO 7288 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-10-13 10:38:21.920 INFO 7288 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-10-13 10:38:21.926 INFO 7288 --- [ main] App.App : Started App in 7.938 seconds (JVM running for 8.682)
p>
div>
Read More:
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded
- Failed to configure a DataSource: ‘ url’ attribute
- Failed to configure a DataSource
- Springboot startup error failed to configure a datasource
- This application has no explicit mapping for /error, so you are seeing this as a fallback (How to Fix)
- How to Fix Session is not Connecting (How to Diagnose it)
- Uncaught TypeError: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node How to Fix
- Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory (How to Fix)
- How to Fix Failed to open \EFI\BOOT\grubx64.efi Not Found
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- ERROR 1524 (HY000): Plugin ‘auth_socket’ is not loaded How to Fix
- How to Fix Module build failed: Error: ENOENT: no such file or directory, scandir xxxxxx\node_…
- ERROR: Failed to parse POMs (How to Fix)
- Module build failed Error Plugin/Preset files are not allowed to export objects, only functions (How to Fix)
- How to Fix ”is not in the sudoers file“ in Linux
- No qualifying bean of type ‘javax.sql.DataSource‘ available: expected at least 1
- How to Fix nbconvert failed: Pandoc wasn’t found. Please check that pandoc is installed:
- How to Fix Tomcat Error: Failed to destroy end point associated with ProtocolHandler[ajp-nio-8009]
- error: a label can only be part of a statement and a declaration is not a statement (How to Fix)