Hallo,
ich lerne zur Zeit Hibernate + Spring mit "Spring in Action", damit ich das Buch besser verstehen kann, benutze ich keine aktuelle Version von Hibernate und Spring.
Ich versuche nach dem Buch eine kleine Webapp zu erstellen, leider bekomme ich folgende Fehlermeldung:
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)
Es gibt zwar im google ein paar Lösungen für ähnliches Problem.
z.B. soll man neue Version von ehcacheXX.jar einsetzen oder per "chown 777 /tmp" leider funktionieren die gefundene Lösungen nicht bei mir. :(
Ich galube, dass es ein Berechtigungsproblem ist, jedoch weiß ich nicht wie ich es lösen sollen, vielleicht kann jemand von euch mir hier weiter helfen!
vielen Dank im voraus.
Hibernate version: hibernate 2.1.8
mit
cglib-full-2.0.2.jar
ehcache-1.2.1.jar
Spring version: Spring 1.2.6
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:
Code:
<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)