Hi,
I am having some bad luck trying to figure out how and why I will get PropertyAccess Exceptions on differnet occasions, and on different configurations. On our setup we have a small cluster of machines running an app built on top of SpringFramework. We just took TreeCacheProvider into production and witnessed strange problems, getting null pointer exceptions in places where it should not happen.
These problems went away when we removed max_fetch_depth = 0 from the configuration - and everything was sweet.
However now I stumbeled into new batch of PropertyAccessExceptions that went away, when I adjusted max_fetch_depth into 1. If it was 3 we got errors, if it was 0 we got errors - if it was 1 - it worked.
I'm happy that this kind of 'try something and see if it works' solved the immediate problem, but I am worried about not really understanding what causes the problems -- what is the root of these property access exceptions.
Any help or hint would be appreciated.
Here is our Hibernate configuration from Spring application context.
<prop key="hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.jdbc.batch_size">20</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.max_fetch_depth">1</prop>
<prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</prop>
<prop key="hibernate.cache.region_prefix">portaali</prop>
Hibernate version:
2.1.3
Mapping documents:
<class name="fi.hy.sitetree.Node" table="nodes" >
<cache usage="transactional"/>
<id name="id" column="id" type="long" unsaved-value="0">
<generator class="sequence">
<param name="sequence">node_seq</param>
</generator>
</id>
<property name="title">
<column name="title" sql-type="varchar(255)" not-null="false" />
</property>
<property name="state" type="fi.hy.sitetree.NodeState">
<column name="state" not-null="true" />
</property>
<many-to-one name="parent" class="fi.hy.sitetree.Node" column="parent_id" />
<list name="children" lazy="true" cascade="delete">
<cache usage="transactional"/>
<key column="parent_id" />
<index column="position" type="int" />
<one-to-many class="fi.hy.sitetree.Node" />
</list>
<many-to-one name="group" class="fi.hy.privilege.PrincipalGroup"
column="owner_group_id" unique="true" cascade="all" />
<joined-subclass name="fi.hy.sitetree.DocumentLink" table="document_links">
<key column="ID" />
<many-to-one name="document" class="fi.hy.document.Document" column="document_id" cascade="none" />
<property name="publishDate">
<column name="publish_date" sql-type="DATE" not-null="false" />
</property>
<property name="expirationDate">
<column name="expiration_date" sql-type="DATE" not-null="false" />
</property>
<property name="publishMode">
<column name="publish_mode" sql-type="CHAR(1)" not-null="false" />
</property>
<property name="expirationMode">
<column name="expiration_mode" sql-type="CHAR(1)" not-null="false" />
</property>
</joined-subclass>
</class>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
58935 [SocketListener1-8] ERROR org.springframework.web.servlet.DispatcherServlet - Could not complete request
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false
for more info) getter of fi.hy.sitetree.DocumentLink.?
at net.sf.hibernate.persister.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:234)
at net.sf.hibernate.impl.CacheEntry.disassemble(CacheEntry.java:33)
at net.sf.hibernate.impl.CacheEntry.<init>(CacheEntry.java:27)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2203)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:240)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.NormalizedEntityPersister.load(NormalizedEntityPersister.java:405)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1942)
at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:68)
at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:232)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2194)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:240)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
at net.sf.hibernate.loader.Loader.list(Loader.java:946)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1536)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at fi.hy.controller.dao.implementation.SiteTreeManagerImpl.getDocumentLinksForDocument(SiteTreeManagerImpl.java:514)
at fi.hy.controller.service.implementation.SiteTreeServiceSpringImpl.getDocumentLinksForDocument(SiteTreeServiceSpringImpl.java:81
9)
at fi.hy.controller.web.contentserver.DocumentController.printDocumentElement(DocumentController.java:105)
at fi.hy.controller.web.contentserver.DocumentController.handleRequestInternal(DocumentController.java:161)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:121)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:485)
at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:342)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:405)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:520)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:520)
at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:117)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:73)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:511)
at fi.hy.controller.web.EncodingFilter.doFilter(EncodingFilter.java:21)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:511)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:463)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:525)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1457)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1409)
at org.mortbay.jetty.plus.PlusWebAppContext.handle(PlusWebAppContext.java:157)
at org.mortbay.http.HttpServer.service(HttpServer.java:889)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:829)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:998)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:846)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:345)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:530)
Caused by: java.lang.NullPointerException
at fi.hy.document.Document.getLanguageVersion(Document.java:131)
at fi.hy.sitetree.DocumentLink.getTitle(DocumentLink.java:64)
at fi.hy.sitetree.DocumentLink.getTitle(DocumentLink.java:59)
at fi.hy.sitetree.DocumentLink$$BulkBeanByCGLIB$$58c92c7.getPropertyValues(<generated>)
at net.sf.cglib.beans.BulkBean.getPropertyValues(BulkBean.java:86)
at net.sf.hibernate.persister.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:230)
... 54 more
Name and version of the database you are using:
Oracle 9
_________________ -huima
|