10 Replies Latest reply on Aug 2, 2006 5:24 AM by lapoutre

    IllegalAccessError initializing ehcache.CacheManager

    masonoise

      I'm wondering if anyone else has run into this problem; some searching showed similar reports using other JBoss products, but nothing quite the same as what I'm seeing. This may or may not actually be a Hibernate issue, but I thought folks in this forum would be most likely to have run into this.

      I did a new install of JBoss server 4.0.4.GA with the ejb3 option, on a new Intel MacBook running Mac OS X 10.4.6. JBoss itself runs fine; the problem occurs running the app I'm working on. However, I need to mention that after installation I discovered that for some reason the ehcache jar wasn't installed. I grabbed one from another installation I had and dropped it into /server/default/lib.

      I deployed my app, and when it tries to do the first Hibernate-related call I get an IllegalAccessError trying to run ehcache.CacheManager.init(). It is possible that JBossAS 4.0.4.GA needs a newer version of ehcache, I suppose, but since that jar file wasn't put in the lib directory when I installed the server, I can't be sure which version it might be expecting.

      Has anyone else encountered this or had similar installation issues? Thanks in advance for any ideas or advice.

      Here's the relevant log output:

      17:18:22,073 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
      17:18:22,145 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
      17:18:22,176 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      17:18:22,177 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
      17:18:22,177 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
      17:18:22,177 INFO [SettingsFactory] JDBC batch size: 15
      17:18:22,177 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
      17:18:22,177 INFO [SettingsFactory] Scrollable result sets: enabled
      17:18:22,177 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
      17:18:22,177 INFO [SettingsFactory] Connection release mode: auto
      17:18:22,177 INFO [SettingsFactory] Maximum outer join fetch depth: 2
      17:18:22,177 INFO [SettingsFactory] Default batch fetch size: 1
      17:18:22,178 INFO [SettingsFactory] Generate SQL with comments: disabled
      17:18:22,178 INFO [SettingsFactory] Order SQL updates by primary key: disabled
      17:18:22,178 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      17:18:22,178 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      17:18:22,179 INFO [SettingsFactory] Query language substitutions: {}
      17:18:22,179 INFO [SettingsFactory] Second-level cache: enabled
      17:18:22,179 INFO [SettingsFactory] Query cache: disabled
      17:18:22,179 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
      17:18:22,441 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
      17:18:22,441 INFO [SettingsFactory] Structured second-level cache entries: disabled
      17:18:22,480 INFO [SettingsFactory] Statistics: disabled
      17:18:22,480 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      17:18:22,500 INFO [SettingsFactory] Default entity-mode: pojo
      17:18:23,858 INFO [SessionFactoryImpl] building session factory
      17:18:23,932 ERROR [jsp] Exception happened while executing page: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
      java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
      at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:180)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
      at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
      at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
      at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
      at com.foobar.builders.BuilderUtil.(BuilderUtil.java:35)
      at com.foobar.util.EntityManagerUtil.createEntityManager(EntityManagerUtil.java:25)
      at org.apache.jsp.index_jsp._jspService(index_jsp.java:130)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:613)