见下面问题:
Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.<init>(Ljava/net/URL;)V from class org.hibernate.cache.EhCacheProvider
2010-04-10 16:47:54 [main:6484] - [ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\help\soft\tomcat\tomcat-5.5\webapps\wyw\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.<init>(Ljava/net/URL;)V from class org.hibernate.cache.EhCacheProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
从这面的问题看,是因为配置EhCache错误,找到源码后,调试发现,有的类没有引进来,仔细查看是发现,原来我导入lib下的类为ehcache-1.2.3.jar,而现在调用的类却是来自与Hibernate 3.1 Core Liberries引用lib下的ehcache 1.1.jar.现在问题终于弄清楚了,在网上找了相关问题的解决方法,很多都是与包有关,但是遇到这种问题还是第一次。做一个标记,下次遇到类似问题切记仔细。
分享到:
相关推荐
此项目整合了目前主流和最前源的web开发技术:采用ehcache实现二级缓存(包含查询缓存);用sf4j及logback(log4j的升级版)记录日志;proxool(据说是dbcp和c3p0三者中最优秀的)做连接池;使用jquery的ajax实现仿...
spring,spring mvc,hibernate,ehcache JavaWeb后台框架
整合S2SH+Freemarker+oscache,后台用Spring管理各个bean,Hibernate做数据库持久化,viewer用Freemarker。整合中对Struts2,Hibernate,Spring都采用Annotation进行注解类。
spring,spring mvc,hibernate,ehcache Java后台框架
spring、 spring mvc、 hibernate、 ehcache Java后台框架
spring3 hibernate4 ehcache整合的实例
hibernate+ehcache hibernate+ehcache hibernate+ehcache hibernate+ehcache hibernate+ehcache
spring、 spring mvc、 hibernate、 ehcache JavaWeb后台框架
NULL 博文链接:https://luyao123127.iteye.com/blog/1312099
自己整合的Spring+Hibernate+Ehcache 整合的项目 需要struts的自己添加。 里面带有注释,而且带Jar.写的很清楚,良心分。
1.通过google ehcache-spring-annotatios.jar自动注解方式实现整合Spring+Ehcache。 2.Action里通过struts2-spring-plugin.jar插件自动根据名字注入。 3.Ajax无刷新异步调用Struts2,返回Json数据,以用户注册为例。...
同时使用了Struts2、Spring4、Hibernate4、log4j、slf4j、junit4、ehcache等库或框架,搭建一个最基本的项目原型。 三、 三大框架最新版本下载:截止2014-10-01 Struts2.3.6:发布于2014-05-03,目前的最新版本。...
该包是hibernate中所用的一个包,专门用来去处理特定的问题,它是和ehcache一起用的一个包
spring+springmvc+hibernate+ehcache JavaWeb后台框架,不仅提高了开发程序的速度,且其中还是用到hibernate和ehcache缓存的使用,加快了程序运行的数据,该框架亲测好用。值得注意的是该种框架现在还算是用的比较多...
Spring-boot,hibernate ehcache 整合源码,可直接运行
Spring 2.0的'spring-jdo.jar', 'spring-jpa.jar', 'spring-hibernate3.jar', 'spring-toplink.jar' 和 'spring-ibatis.jar' 被合并到Spring 2.5大粒度的'spring-orm.jar'中。 Spring 2.5的 'spring-test.jar' 取代...
此配置和包,是springMVC4.3.3 +spring4+hibernate5.1.3+二级缓存ehcache(不用可以关闭)+fastjson。 是正常运行的项目里拷出来的,方便大家使用。
在Spring+Hibernate集成环境中使用EhCache缓存做的开发测试,在线程中打开数据库查询数据,及关闭数据库后查询数据的结果.
hibernate-ehcache-4.1.0.Final.jar 是hibernate4.1使用缓存的jar包
3.Ehcache方法缓存及页面缓存。见applicationContext-cache.xml及web.xml的pageEhCacheFilter 4.MyBatis+Maven代码生成工具。见bin目录 5.作为项目或者技术研究的基础架构。必要的jar包依赖都已配置好,基本都采用较...