• 项目实战 —— Java项目运行报错及决绝方案


    单个SSM框架

    1报LifecycleException,再配置一下jdk即可,然后再手动添加maven

       

      

     

    解决方法:

       

      

       

     然后,手动添加jar包

      


     

    2、maven 项目,右键maven build启动项目的时候,报下面错误,没有在pom配置tomcat7插件

     


     

    3、报找不到beans插件:更新一下项目就好

     


     

    4、也许你运行的是jre而不是jdk ,并且报MojoExCeption,这时候就要配置jdk了,步骤如下

     

     


     

    5ClassNotFoundException,类找不到异常,通常是mapper.xml里,返回值数据类型或参数类型映射的实体类不对,还有就是tomcat下WEB-INF里少了jar包,右键项目properties,Deployment Assembly ,add,然后把Maven Dependencies添加,下步在eclipse部署项目,部署完后clean一下即可解决

    解决方法:

       

       


     6.报Unsupported major.minor version 52.0 (unable to load class com.platform.framework.web.SessionListener),先检查本地的JDK环境变量配了没有,输入java -version  ,然后重启项目即可


     

     7.报 org.apache.jasper.JasperException , /index,jsp   not  found   错误。

    解决方法

    (1)右键点击项目 build   path---Add Libraries--Myeclipse Library  相当于把jstl的jar包加上了,点击finish

      (2)  或者找到tomcat下的 webapps,把原来部署的项目删掉,从新部署再启动项目即可正常运行


    8.报错提示:The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files;

    就是当你在myeclipse引用了不同版本的JDK,解决方法是修改myeclipse工具prefenence的jdk版本为1.6即可


    9.报找不到beans,或者无法读取文档,原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是,就是网络不好,在网络好的情况下重新启动项目即可


    10.smm框架,调用mapper接口插入方法报空指针

    解决办法:把接口的方法copy到另一个正常的mapper,xml中也对应sql也copy


    11. 报XX属性在string没有getter属性,

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'business' in 'class java.lang.String'

    解决办法:

    检查,mapper.xml  条件入参是否有误,如 下,

    <select id="getYycgdBm" parameterType="string" resultType="string">
    select '${value}' || yycgdbm${business}.nextval bm from dual
    </select>


    12 报错  org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): yycg.business.dao.mapper

     经过查找为mapper.xml的id前面多了一个空格


    13.ssm ,service业务实现类impl调用mapper接口报空指针,因为在业务实现类注入rmappe时没有加@Autowired 或其他注解


    14ssm,查询报无效的列索引,模糊查询那应该用$符号而不是#号


    15.报java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Sat Sep 26 11:19:55 CST 2020]; root of context hierarchy

    解决办法;把pom里配置的内置tomcat去掉


    16.报result Maps collection already contains value for yycg.base.dao.mapper.SysuserMapperCustom.mapper_resultMap[findMenuByroleidResultMap]_collection[menus]


    17.报错  Caused by: org.apache.catalina.LifecycleException: A child container failed during start

    原因及解决:路径找不到,在本地添加相关目录或改路径

  • 相关阅读:
    【深度学习】吴恩达网易公开课练习(class1 week2)
    【深度学习】吴恩达网易公开课练习(class1 week3)
    【python】内存调试
    【python】threadpool的内存占用问题
    Druid: A Real-time Analytical Data Store
    Mesa: GeoReplicated, Near RealTime, Scalable Data Warehousing
    Presto: SQL on Everything
    The Snowflake Elastic Data Warehouse
    Guava 库
    Java Annotation
  • 原文地址:https://www.cnblogs.com/binghuaZhang/p/10822934.html
Copyright © 2020-2023  润新知