-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Anfänger: BeanCreationException in Zusammenhang mit Linux
PostPosted: Mon Jul 10, 2006 5:52 pm 
Newbie

Joined: Sun Jul 09, 2006 6:56 pm
Posts: 3
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)


Top
 Profile  
 
 Post subject: Could not set attribute "path"
PostPosted: Fri Aug 25, 2006 4:30 pm 
Newbie

Joined: Tue Aug 01, 2006 3:10 pm
Posts: 7
I am having this same problem. Have you solved it yet?


Top
 Profile  
 
 Post subject: Security Exception...
PostPosted: Thu Sep 07, 2006 7:29 pm 
Newbie

Joined: Thu Sep 07, 2006 7:23 pm
Posts: 1
Location: Wellington, New Zealand
I can't give an exact solution, but perhaps a pointer...

I was getting the same exception from the same location when trying to run Hibernate in a web start application. Once I changed the permissions in web start to allow the bean handler to use run time type information to set the attribute, the problem went away...

Martin


Top
 Profile  
 
 Post subject: problem solved?
PostPosted: Thu Sep 07, 2006 8:53 pm 
Newbie

Joined: Tue Aug 01, 2006 3:10 pm
Posts: 7
I was having the same issue with a web start application and I was able to solve it by adding
<security>all-permissions</security>
to the jnlp file.

I also had to sign the jar resources in order for it to work.

I know chmod 777 does not work because it's not a permissions problem with the single file, the problem is with accessing the actual system running the program. So you have to programmatically let the computer know your application is safe to use system resources.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.