java小白日常报错

CRM项目中使用逆向工程生成mappper.xml文件、pojo文件、和mapper文件时产生的错误*

作为一个java小白人,开始学习写博客,一个是为了为了记笔记,另一个是为了让更多小白解决错误,不喜勿喷

错误类型

启动tomcat后,出现下边错误:
Illegal access: this web application instance has been stopped already. Could not load .The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
然后就不停的弹出上边这一句
再去查看上边异常:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.powernode.setting.service.UserService com.powernode.setting.controller.UserController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userServiceImpl’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.powernode.setting.mapper.TblUserMapper com.powernode.setting.service.impl.UserServiceImpl.tblUserMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘tblUserMapper’ defined in file [D:\sh2020\four\class\spring-ssm\target\classes\com\powernode\setting\mapper\TblUserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’: : Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-tx.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\sh2020\four\class\spring-ssm\target\classes\mapper\TblUserMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [D:\sh2020\four\class\spring-ssm\target\classes\mapper\TblUserMapper.xml]’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘com.powernode.pojo.TblUser’. Cause: java.lang.ClassNotFoundException: Cannot find class: com.powernode.pojo.TblUser; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-tx.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\sh2020\four\class\spring-ssm\target\classes\mapper\TblUserMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘file [D:\sh2020\four\class\spring-ssm\target\classes\mapper\TblUserMapper.xml]’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘com.powernode.pojo.TblUser’. Cause: java.lang.ClassNotFoundException: Cannot find class: com.powernode.pojo.TblUser
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory 1. g e t O b j e c t ( A b s t r a c t B e a n F a c t o r y . j a v a : 306 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 230 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 302 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 197 ) a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . p r e I n s t a n t i a t e S i n g l e t o n s ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 772 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . f i n i s h B e a n F a c t o r y I n i t i a l i z a t i o n ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 839 ) a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 538 ) a t o r g . s p r i n g f r a m e w o r k . w e b . c o n t e x t . C o n t e x t L o a d e r . c o n f i g u r e A n d R e f r e s h W e b A p p l i c a t i o n C o n t e x t ( C o n t e x t L o a d e r . j a v a : 446 ) a t o r g . s p r i n g f r a m e w o r k . w e b . c o n t e x t . C o n t e x t L o a d e r . i n i t W e b A p p l i c a t i o n C o n t e x t ( C o n t e x t L o a d e r . j a v a : 328 ) a t o r g . s p r i n g f r a m e w o r k . w e b . c o n t e x t . C o n t e x t L o a d e r L i s t e n e r . c o n t e x t I n i t i a l i z e d ( C o n t e x t L o a d e r L i s t e n e r . j a v a : 107 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d C o n t e x t . l i s t e n e r S t a r t ( S t a n d a r d C o n t e x t . j a v a : 4939 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . S t a n d a r d C o n t e x t . s t a r t I n t e r n a l ( S t a n d a r d C o n t e x t . j a v a : 5434 ) a t o r g . a p a c h e . c a t a l i n a . u t i l . L i f e c y c l e B a s e . s t a r t ( L i f e c y c l e B a s e . j a v a : 150 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e 1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase 1.getObject(AbstractBeanFactory.java:306)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)atorg.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1549 ) a t j a v a . u t i l . c o n c u r r e n t . F u t u r e T a s k . r u n ( F u t u r e T a s k . j a v a : 266 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1142 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor StartChild.call(ContainerBase.java:1549)atjava.util.concurrent.FutureTask.run(FutureTask.java:266)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.C
lassNotFoundException: Cannot find class: com.powernode.pojo.TblUser
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:200)
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)
at org.apache.ibatis.io.Resources.classForName(Resources.java:261)
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:116)
… 69 more

主要是因为逆行工程插件生成文件路径和自己的文件不匹配,因为我是粘贴过来的,后来检查了pojo最上头的路径,mapper文件的路径,mapper.xml的路径,发现有一个***xml文件引用实体类路径***错了,而且xml文件中每一个sql语句都有配套路径,所以使用逆向工程生成,或者是自己手写的童鞋千万要注意!!!

java小白日常报错相关推荐

  1. 使用cmd打开java文件,报错:“错误,编码GBK的不可映射字符”

    使用cmd打开java文件,报错:"错误,编码GBK的不可映射字符" 今天使用EditPlus写了一个小程序,用cmd运行时报错--"错误,编码GBK的不可映射字符&qu ...

  2. java exec执行tar_用java调用rpmbuild 报错,同一条命令直接复制到终端却能运行

    用java调用rpmbuild 报错,同一条命令直接复制到终端却能运行. 命令如下: rpmbuild --define "_topdir /var/lib/jenkins/workspac ...

  3. Linux运行Java出现“Exception in thread main java.lang.OutOfMemoryError: Java heap space”报错...

    在运行如下程序时出现"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space&quo ...

  4. 图解Myeclipse 导入Java Web项目报错的解决办法听语音

    图解Myeclipse 导入Java Web项目报错的解决办法听语音 https://jingyan.baidu.com/article/046a7b3e953ef3f9c27fa93d.html

  5. java程序连接MinIO 报错The request signature we calculated does not match the signature you provided.

    java程序连接MinIO 报错The request signature we calculated does not match the signature you provided. Check ...

  6. Caused by: java.lang.IllegalArgumentException报错

    报错内容: java.lang.IllegalStateException: Failed to load ApplicationContextat org.springframework.test. ...

  7. java连接OPC 报错汇总

    java连接OPC 报错汇总 最近在弄utgard连接opc服务器 状态码 原因 解决方案 80070005: Unknown error (80070005) 账号没有权限 服务器在win10下 没 ...

  8. 记录---ClassCastException: java.util.Date cannot be cast to java.sql.Date报错解决方法

    记录-ClassCastException: java.util.Date cannot be cast to java.sql.Date报错解决方法 先po代码: //1.读取配置文件中的基本信息I ...

  9. 使用eclipse查看java源码报错source not found

    使用eclipse查看java源码报错source not found的解决办法 问题: 编写java代码时想要查看调用的系统的类或者接口时,使用快捷键(按住Ctrl,单击类或接口名)报错source ...

最新文章

  1. Wpf消息循环之消息传递
  2. asp.net 学习笔记 代码块标记
  3. Xshell高级后门完整分析报告
  4. 搭建通用性多用户后台-思路
  5. Java SHAA加密
  6. stcisp一直检测单片机_三种方法对比:STC51单片机实现免冷启动
  7. 条件运算符(?:)和 $替代string.Format()
  8. 第一百二十四期:2019年臭名昭著的勒索软件,网络钓鱼和僵尸网络
  9. 系统架构师学习笔记-基于构件的开发
  10. oracle通信通道的文件结尾_【移民】加拿大安省发放优才计划移民邀请函;NS省干掉特快通道直申种类的申请通道...
  11. Chrome firefox ie等浏览器空格(nbsp;)兼容问题
  12. centos7永久修改ip地址
  13. Windows核心编程学习九:利用内核对象进行线程同步
  14. 以汉字开头,以某个词结尾的一段文字的正则
  15. MES系统如何实现工厂无纸化生产?
  16. c语言求开平方标准库函数,c语言如何求平方根 C语言中开平方函数是什么?
  17. leetcode---1728. 猫和老鼠 II
  18. 操作系统 - Lightdm
  19. 关于中国教育出来的学生
  20. MATLAB使用radon函数和iradon函数计算图像的投影并从投影中重构图像

热门文章

  1. Android直播中弹幕效果实现
  2. texi2dvi - 打印 Texinfo 文档
  3. 大学计算机word操作题步骤,计算机二级题库word操作步骤
  4. 三维空间坐标的旋转算法详解_三维空间几何坐标变换矩阵.ppt
  5. TCP/IP中的拥塞窗口控制机制
  6. ArcGIS 对道路名称进行标注
  7. Spark复习大纲,有需要的小伙伴可以点个赞找我私信
  8. 编写批量修改扩展名脚本
  9. php error reporting,php error_reporting
  10. 论文笔记:图像分割——ExFuse DFN