美文网首页
我的ssh框架学习-排错日志

我的ssh框架学习-排错日志

作者: 黄昭鸿 | 来源:发表于2018-05-22 22:35 被阅读0次

    1.缺少包2018-05-22

    Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager
        at com.tjcsims.dao.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:13)
        at com.tjcsims.test.DBtest.test1(DBtest.java:26)
        at com.tjcsims.test.DBtest.main(DBtest.java:19)
    Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ReflectionManager
    

    这是由于缺少Hibernate commons注释库引起的。

    解决方法:

    加入hibernate-commons-annotations-*.jar包
    或构建路径,加入hibernate5.1的library

    2. hibernate包和struts2包冲突

    NoSuchMethodError: antlr.collections.AST.getLine()I
    

    解决办法

    构建路径>库,移除hibernate和struts的依赖,复制tomcat对应项目的WEB-INF\lib\下的所有包
    粘贴到项目的WebRoot\WEB-INF\lib并删除重复的包

    3. findByCode方法中抛出DaoException("查询失败!", e)异常

    java.lang.NoClassDefFoundError: javassist/util/proxy/Proxy
        org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:123)
    ----------
    com.tjcsims.dao.DaoException: 查询失败!
        com.tjcsims.impl.LoginDaoImpl.findByCode(LoginDaoImpl.java:42)
        com.tjcsims.action.TeacherLoginAction.execute(TeacherLoginAction.java:26)
    
    

    解决办法

    javassist包中要有Proxy类
    将javassist-3.7.ga.jar替换为javassist-3.20.0-GA.jar,因为javassist-3.20.0-GA.jar中有Proxy类

    4.ssss

    相关文章

      网友评论

          本文标题:我的ssh框架学习-排错日志

          本文链接:https://www.haomeiwen.com/subject/poxljftx.html