0

I'm using hibernate3.6.10 final version.I have build path and created classes and trying to run the application ,its shows error net.sf.ehcache.CacheException, so i have added the ecahe jar too.But even though it throwing the error. Please help me.

Jar screen shot.

enter image description here

Hibernate.cfg.xml :

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
    <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
    <property name="connection.url">******</property>
    <property name="connection.username">*****</property>
    <property name="connection.password">*****</property>
    <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
    <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property> 
    <property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property> 
    <property name="show_sql">true</property>
    <mapping class="com.DAO.Part"/> 
   </session-factory>
</hibernate-configuration>

Error Trace :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
        SLF4J: Defaulting to no-operation (NOP) logger implementation
        SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
        Initial SessionFactory creation failed.org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
        Dec 12, 2013 10:55:07 AM org.apache.catalina.core.StandardWrapperValve invoke
        SEVERE: Servlet.service() for servlet ReleaseRegistrationAdminServlet threw exception
        java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:409)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:280)
        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
        at com.DAO.HibernateUtil.buildSessionFactory(HibernateUtil.java:26)
        at com.DAO.HibernateUtil.<clinit>(HibernateUtil.java:18)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:619)
4
  • @RC what version need to include for hibernate3.6.10 ? Commented Dec 12, 2013 at 19:55
  • I added hinerate ehcache-3.6.10.Fianl jar Commented Dec 12, 2013 at 19:56
  • Good, its working.Please post as answer, will accept it. Commented Dec 12, 2013 at 20:03
  • On a side note, it's a good idea to use EHCacheRegionFactory rather than the deprecated EHCacheProvider as explained here Commented Dec 12, 2013 at 20:04

1 Answer 1

3

You need to add ehcache jar (from ehcache.org)

net.sf.ehcache / ehcache-core / 2.4.3 according to mavenrepository

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.