Exception encountered during context initialization - cancelling refresh attempt: org.springframe...

springboot项目启动失败

  .  ____          _            __ _ _

/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot ::        (v2.0.6.RELEASE)

2019-05-28 15:22:42.878  INFO 20348 --- [          main] com.BackstageApplication                : Starting BackstageApplication on GoldFu with PID 20348 (F:\idea\backstage\target\classes started by GoldFu in F:\idea\backstage)

2019-05-28 15:22:42.885  INFO 20348 --- [          main] com.BackstageApplication                : No active profile set, falling back to default profiles: default

2019-05-28 15:22:42.943  INFO 20348 --- [          main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@475c9c31: startup date [Tue May 28 15:22:42 CST 2019]; root of context hierarchy

2019-05-28 15:22:46.912  INFO 20348 --- [          main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8989 (http)

2019-05-28 15:22:46.932  INFO 20348 --- [          main] o.apache.catalina.core.StandardService  : Starting service [Tomcat]

2019-05-28 15:22:46.932  INFO 20348 --- [          main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.34

2019-05-28 15:22:46.936  INFO 20348 --- [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: [D:\develop\file_packet\java\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\develop\file_packet\java\bin;D:\develop\file_packet\java\jre\bin;D:\develop\file_packet\maven\bin;D:\develop\file_packet\Git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseGit\bin;D:\develop\file_packet\node\;C:\Users\GoldFu\AppData\Local\Microsoft\WindowsApps;;D:\develop\tools\IntelliJ IDEA 2018.3.5\bin;;D:\develop\tools\WebStorm 2018.3.5\bin;;C:\Users\GoldFu\AppData\Roaming\npm;.]

2019-05-28 15:22:47.062  INFO 20348 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]      : Initializing Spring embedded WebApplicationContext

2019-05-28 15:22:47.062  INFO 20348 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4119 ms

2019-05-28 15:22:47.178  INFO 20348 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]

2019-05-28 15:22:47.183  INFO 20348 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean  : Mapping filter: 'characterEncodingFilter' to: [/*]

2019-05-28 15:22:47.183  INFO 20348 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean  : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]

2019-05-28 15:22:47.184  INFO 20348 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean  : Mapping filter: 'httpPutFormContentFilter' to: [/*]

2019-05-28 15:22:47.184  INFO 20348 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean  : Mapping filter: 'requestContextFilter' to: [/*]

2019-05-28 15:22:47.648  WARN 20348 --- [          main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController': Unsatisfied dependency expressed through field 'adminService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminServiceImpl': Unsatisfied dependency expressed through field 'adminDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminDao' defined in file [F:\idea\backstage\target\classes\com\dao\AdminDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\idea\backstage\target\classes\mapping\OrderMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [F:\idea\backstage\target\classes\mapping\OrderMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'XpenseTracker'.  Cause: java.lang.ClassNotFoundException: Cannot find class: XpenseTracker

2019-05-28 15:22:47.650  INFO 20348 --- [          main] o.apache.catalina.core.StandardService  : Stopping service [Tomcat]

Disconnected from the target VM, address: '127.0.0.1:63331', transport: 'socket'

Process finished with exit code 1


原因是这里的xml没有扫描到实体类

解决办法


在配置文件中添加对象的扫描包

启动成功

启动成功
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 首先环境的搭建,我是将zookeeper MongoDB redis 放在了203的服务器上,tomcat放在20...
    setsun阅读 5,929评论 0 1
  • sqlmap用户手册 说明:本文为转载,对原文中一些明显的拼写错误进行修正,并标注对自己有用的信息。 ======...
    wind_飘阅读 6,333评论 0 5
  • 问题描述: 解决思路: 用BRTOOLS扩展表空间,操作如下:[2016/1/21 22:01:35] bvprd...
    SmalltalkVoice阅读 9,715评论 0 1
  • 星辰里孤寂的猫 失去了魂魄 紫色光滑的皮毛 慢慢的褪色 双眼空洞无神的凝望 一颗星星陨落 一只猫死亡 繁华里耀眼的...
    小太阳rrr阅读 3,211评论 18 2
  • 北北前段时间做了个门诊手术,今天带去儿研所拆线。快到清明假期,医院人少,很快弄完回家。 在车里北北吃着奶就在我怀里...
    北北的麻麻阅读 1,950评论 0 3