国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

java - Spring boot啟動(dòng)時(shí)報(bào)錯(cuò)?

瀏覽:108日期:2023-12-04 14:29:40

問(wèn)題描述

. ____ _ __ _ _ / / ___’_ __ _ _(_)_ __ __ _ ( ( )___ | ’_ | ’_| | ’_ / _` | / ___)| |_)| | | | | || (_| | ) ) ) ) ’ |____| .__|_| |_|_| |___, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot ::(v1.5.3.RELEASE)2017-04-25 20:13:52.771 INFO 6852 --- [ main] com.example.SpringDemoApplication: Starting SpringDemoApplication on northwedding66 with PID 6852 (D:javadaimaspring-demotargetclasses started by Administrator in D:javadaimaspring-demo)2017-04-25 20:13:52.774 INFO 6852 --- [ main] com.example.SpringDemoApplication: No active profile set, falling back to default profiles: default2017-04-25 20:13:52.864 INFO 6852 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@fdefd3f: startup date [Tue Apr 25 20:13:52 GMT+08:00 2017]; root of context hierarchy2017-04-25 20:13:54.016 INFO 6852 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!2017-04-25 20:13:54.037 INFO 6852 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data MongoDB - Could not safely identify store assignment for repository candidate interface com.example.UserDao.2017-04-25 20:13:54.052 INFO 6852 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!2017-04-25 20:13:54.064 INFO 6852 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.example.UserDao.2017-04-25 20:13:54.684 INFO 6852 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean ’org.springframework.ws.config.annotation.DelegatingWsConfiguration’ of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$6bb5a6e5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2017-04-25 20:13:54.743 INFO 6852 --- [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]2017-04-25 20:13:55.221 INFO 6852 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 9090 (http)2017-04-25 20:13:55.244 INFO 6852 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat2017-04-25 20:13:55.245 INFO 6852 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.142017-04-25 20:13:55.438 INFO 6852 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2017-04-25 20:13:55.439 INFO 6852 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2580 ms2017-04-25 20:13:55.697 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: ’dispatcherServlet’ to [/]2017-04-25 20:13:55.699 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: ’messageDispatcherServlet’ to [/services/*]2017-04-25 20:13:55.706 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ’characterEncodingFilter’ to: [/*]2017-04-25 20:13:55.707 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ’hiddenHttpMethodFilter’ to: [/*]2017-04-25 20:13:55.707 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ’httpPutFormContentFilter’ to: [/*]2017-04-25 20:13:55.709 INFO 6852 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: ’requestContextFilter’ to: [/*]2017-04-25 20:13:55.764 WARN 6852 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ’org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration’: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ’javax.sql.DataSource’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}2017-04-25 20:13:55.767 INFO 6852 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat2017-04-25 20:13:55.781 WARN 6852 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143) com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:41)2017-04-25 20:13:55.793 INFO 6852 --- [ main] utoConfigurationReportLoggingInitializer : Error starting ApplicationContext. To display the auto-configuration report re-run your application with ’debug’ enabled.2017-04-25 20:13:55.928 ERROR 6852 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************APPLICATION FAILED TO START***************************Description:Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type ’javax.sql.DataSource’ that could not be found. - Bean method ’dataSource’ not loaded because @ConditionalOnClass did not find required class ’org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’ - Bean method ’dataSource’ not loaded because @ConditionalOnClass did not find required class ’org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’Action:Consider revisiting the conditions above or defining a bean of type ’javax.sql.DataSource’ in your configuration.

連了一下MySQL,改了pom

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId></dependency>

然后下面是application的

spring.datasource.url = jdbc:mysql://localhost:1204/testspring.datasource.username = rootspring.datasource.password = 1204spring.datasource.driverClassName = com.mysql.jdbc.Driver# Specify the DBMSspring.jpa.database = MYSQL# Show or not log for each sql queryspring.jpa.show-sql = true# Hibernate ddl auto (create, create-drop, update)spring.jpa.hibernate.ddl-auto = update# Naming strategyspring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy# stripped before adding them to the entity manager)spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

啟動(dòng)的時(shí)候就會(huì)出現(xiàn)這個(gè)錯(cuò)誤,求各位大佬解決一下

求個(gè)大佬遠(yuǎn)程解決一下...弄了半個(gè)月沒(méi)弄好QAQ

Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type ’javax.sql.DataSource’ that could not be found. - Bean method ’dataSource’ not loaded because @ConditionalOnClass did not find required class ’org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’ - Bean method ’dataSource’ not loaded because @ConditionalOnClass did not find required class ’org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’Action:Consider revisiting the conditions above or defining a bean of type ’javax.sql.DataSource’ in your configuration.

現(xiàn)在就是這個(gè)問(wèn)題了,xml文件里要配置bean嗎?我看教程好像都是沒(méi)有的,下過(guò)marketplace里的jpa沒(méi)用,一直是這個(gè)問(wèn)題,看了網(wǎng)上的教程好像大家都沒(méi)有這個(gè)問(wèn)題...求遠(yuǎn)程QAQ

問(wèn)題解答

回答1:

你有在pom.xml依賴mysql的JDBC驅(qū)動(dòng)嘛

回答2:

還是外部包有問(wèn)題,檢查一下org.springframework.jdbc

回答3:

沒(méi)有看到你的具體配置,只好猜測(cè)了:是不是沒(méi)有進(jìn)行自定義數(shù)據(jù)源實(shí)現(xiàn)反而把springboot默認(rèn)的數(shù)據(jù)源排除掉了?試試把@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})中的exclude = {DataSourceAutoConfiguration.class}去掉,或者使用druid或者dbcp之類的數(shù)據(jù)源替換。

回答4:

是不是沒(méi)加mysql依賴?

發(fā)個(gè)我自己最近在用的配置,供你參考:就發(fā)個(gè)必要配置,其他的省略1.pom.xml配置:

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId></dependency><dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope></dependency>

2.application.properties配置

spring.datasource.url=jdbc:mysql://localhost:3306/vgiftspring.datasource.username=vosonspring.datasource.password=123spring.datasource.driverClassName=com.mysql.jdbc.Driver# hibernate 配置spring.jpa.database=MYSQLspring.jpa.show-sql=truespring.jpa.hibernate.ddl-auto=updatespring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect回答5:

重新下載jpa,換個(gè)源,我之前也碰到過(guò)這問(wèn)題

標(biāo)簽: java
相關(guān)文章:
主站蜘蛛池模板: 日本巨乳中文字幕 | 一级片一区 | 亚洲黄色三级视频 | 久久伊人免费视频 | 欧美成人小视频 | 激情性爽三级成人 | 九热视频在线观看 | 男女扒开双腿猛进入爽爽视频 | 午夜国产高清精品一区免费 | 欧美xxxx成人免费网站 | 久久精品国产免费看久久精品 | 日本视频在线观看不卡高清免费 | 久久99国产精品视频 | 成人在线中文字幕 | 黄a视频 | 亚洲 欧美 日韩 丝袜 另类 | 日本欧美久久久久免费播放网 | 99在线在线视频免费视频观看 | 免费一级毛片麻豆精品 | 国产精品欧美亚洲韩国日本不卡 | 久久精品视频观看 | 欧美精品首页 | 国产一级强片在线观看 | 亚洲精品视频观看 | 欧美精品一区二区在线观看 | 久久精品99精品免费观看 | 日韩黄色一级毛片 | a成人在线 | 日本阿v视频在线观看高清 日本波多野结衣视频 | 欧美日韩亚洲国内综合网俺 | 亚洲欧美一区二区三区在线播放 | 欧美级毛片 | 亚洲免费人成在线视频观看 | 88精品视频| 日韩视频在线观看中字 | 久久香蕉国产线看观看式 | 韩国毛片 | youjizz日韩| 免费国产在线观看 | 久久精品2020| 中国一级毛片免费观看 |