Hi all,
i am a newbie in hibernate and spring, so i try to learn it from book "spring in action". For this reason i use the old version from hibernate and spring. so that easy for me to recognize the code and technics.
I try to build a simple webapp with one jsp, one controller and use hibernate to access my table in MySql DB.
But i can't start my webapp...
I got the following Error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/hwms-servlet.xml]: Initialization of bean failed; nested exception is net.sf.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Error configuring from file:/var/lib/tomcat5/work/Catalina/localhost/hwms/loader/ehcache-failsafe.xml. Initial cause was Error configuring from input stream. Initial cause was null:15: Could not set attribute "path".. Message was: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
I found some solutions for similar problem but they didn't work for me.
Someone writ to upgrad the ehcache jar, and i did it...
the result, the same error.
Someone wirt "chown 777 /tmp" can solve this problem...
but i have the same error again...
so i hope you girls and guys can help me... orz
Hibernate version:
hibernate 2.1.8
with
cglib-full-2.0.2.jar
ehcache-1.2.1.jar
Linux version:
kernelversion 2.6
Name and version of the database you are using:
MySql version: 5.0.21-3
Tomcat version:
tomcat5 5.0.30-9
Mapping documents:
hwms-servlet.xml:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
net.sf.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>WEB-INF/classes/com/hwms/model</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
Full stack trace of any exception that occurs:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/hwms-servlet.xml]: Initialization of bean failed; nested exception is net.sf.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Error configuring from file:/var/lib/tomcat5/work/Catalina/localhost/hwms/loader/ehcache-failsafe.xml. Initial cause was Error configuring from input stream. Initial cause was null:15: Could not set attribute "path".. Message was: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:403)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:306)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:114)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)
|