今天在整合Hibernate和Struts2的时候遇到一个问题

总是出现各种异常,经过仔细检查,代码本身并没有问题,

-----------------------------------------------------------------------------------------------

Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

-----------------------------------------------------------------------------------------------

Unable to load configuration. - [unknown location]
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)

-----------------------------------------------------------------------------------------------

 

查看网上教程无果.....

通过测试发现原来是导入的时候jar包存在冲突

(我是用的是MyEclipse导入的Hibernate的jar包,struts2使用的是struts2-blank\WEB-INF\lib目录下的文件)

解决第一个问题:

     删除多余的asm.jar

解决第二个问题:

     xerce.jar和xml-apis.jar这两个jar包冲突,删除xerce.jar

Hibernate整合Struts2时报错的更多相关文章

  1. spring+hibernate整合:报错org.hibernate.HibernateException: No Session found for current thread

    spring+hibernate整合:报错信息如下 org.hibernate.HibernateException: No Session found for current thread at o ...

  2. Spring整合Redis时报错:java.util.NoSuchElementException: Unable to validate object

    我在Spring整合Redis时报错,我是犯了一个很低级的错误! 我设置了Redis的访问密码,在Spring的配置文件却没有配置密码这一项,配置上密码后,终于不报错了!

  3. 整合SSM时报错:java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;

    在整合Spring和MyBatis时,只进行了简单的插入操作,结果报了这个错,顿时整个人都崩溃了 -- 一点都看不懂嘛!只有网上搜索 结果是在使用MyBatis3.x和Spring4.x整合是 导入的 ...

  4. Hibernate创建hqll时报错

    Hibernate 问题,在执行Query session.createQuery(hql) 报错误 出错截图: 这条语句在java运行环境下,直接连数据库不出错,如果在hiberante,strut ...

  5. hibernate mysql 分页时报错 显示的代码和sql server 类似 select top 1……

    [ERROR][com.alibaba.druid.filter.stat.StatFilter]merge sql error, dbType mysql, sql : select top 1 d ...

  6. 使用Mybatis整合spring时报错Injection of autowired dependencies failed;

    这是无法自动注入,通过查找,我出错的原因在于配置文件的路径没有写对,在applicationContext.xml中是这样写的. <bean id="sqlSessionFactory ...

  7. hibernate自动生成时报错问题

    创建好了实体类和.hbm.xml文件,运行项目报上错: 实体类和xml文件中的字段要一致.(顺序和字段)

  8. 写hibernate.cfg.xml时报错The content of element type "property" must match "(meta*,(column|formula)*,type?)".

    原配置文件是这样的 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-ma ...

  9. hibernate操作数据库时报错解决方式

    java.sql.SQLException: Parameter index out of range (28 > number of parameters, which is 27). 这个说 ...

随机推荐

  1. iOS工程结构

          好的架构不是设计出来的,而是进化而来的! 写在前面 从2011年底开始学习iOS开发,到现在也已经快3年了,虽然中途没有一直进行iOS的开发(总是在Android和iOS间切换),但始终没 ...

  2. hdu 1385 Minimum Transport Cost

    http://acm.hdu.edu.cn/showproblem.php?pid=1385 #include <cstdio> #include <cstring> #inc ...

  3. hdu 畅通工程再续

    http://acm.hdu.edu.cn/showproblem.php?pid=1875 #include <cstdio> #include <cstring> #inc ...

  4. 深入理解7816(2)---关于ATR

    智能卡(此处主要指接触式CPU卡)本身始终处于被动的状态,所以终端设备在和智能卡进行数据交互的时候,需要首先给智能卡发指令,智能卡才会对应地给出应答.而智能卡告诉终端的第一句话就是ATR,亦即“复位应 ...

  5. android 让图片充满整个屏幕

    方法1: <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent&quo ...

  6. 开始使用Logstash

    开始使用Logstash 本节将指导处理安装Logstash 和确认一切是运行正常的, 后来的章节处理增加负载的配置来处理选择的使用案例. 这个章节包含下面的主题: Installing Logsta ...

  7. 【转】Android 定时器实现的几种方式和removeCallbacks失效问题详解--不错

    原文网址:http://blog.csdn.net/xiaanming/article/details/9011193 实现定时器有很多种方式,在这里我简单的介绍几种方式 (1)使用Handler + ...

  8. 【转】win7+ubuntu双系统安装方法--不错

    原文网址:http://blog.csdn.net/lvanneo/article/details/16885121 前段时间又安装一下win7+ubuntu双系统,过段时间就会忘记,这次自己写下来, ...

  9. cf493C Vasya and Basketball

    C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  10. ZOJ3519-Beautiful People:最长上升子序列的变形

    Beautiful People Special JudgeTime Limit: 10000/5000MS (Java/Others)Memory Limit: 128000/64000KB (Ja ...