3 Replies Latest reply on Feb 8, 2005 3:50 AM by hari sujathan

    NullPointerException: TreeCache.put

    hari sujathan Newbie

      Hi
      "I am using treecache with hibernate on weblogic 8.1.
      While persisting data, I get following exception:
      (I am calling hibernate persistence through spring. )
      Thanks in Advance:
      Hari


      (impl.SessionImpl 2399) Could not synchronize database state
      with session
      <Jan 28, 2005 10:54:20 AM CST> <BEA-101020> <[ServletContext(id=4
      233200,name=vz-esm-vcm-web,context-path=/vcm)] Servlet failed with Exception
      org.springframework.dao.CleanupFailureDataAccessException: Failed to flush sessi
      on before close: org.jboss.util.NestedRuntimeException: - nested throwable: (jav
      a.lang.NullPointerException); nested exception is net.sf.hibernate.cache.CacheEx
      ception: org.jboss.util.NestedRuntimeException: - nested throwable: (java.lang.N
      ullPointerException)
      net.sf.hibernate.cache.CacheException: org.jboss.util.NestedRuntimeException: -
      nested throwable: (java.lang.NullPointerException)
      at net.sf.hibernate.cache.TreeCache.put(Ljava.lang.Object;Ljava.lang.Obj
      ect;)V(TreeCache.java:70)
      at net.sf.hibernate.cache.UpdateTimestampsCache.preinvalidate([Ljava.io.
      Serializable;)V(UpdateTimestampsCache.java:42)
      at net.sf.hibernate.impl.SessionImpl.executeAll(Ljava.util.List;)V(Sessi
      onImpl.java:2437)
      at net.sf.hibernate.impl.SessionImpl.execute()V(SessionImpl.java:2391)
      at net.sf.hibernate.impl.SessionImpl.flush()V(SessionImpl.java:2260)
      at vz.esm.core.web.FlushingSpringSessionInViewFilter.closeSession(Lnet.s
      f.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(FlushingSpringSessionInV
      iewFilter.java:39)
      at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doF
      ilterInternal(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpSer
      vletResponse;Ljavax.servlet.FilterChain;)V(OpenSessionInViewFilter.java:122)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(Ljavax.s
      ervlet.ServletRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;
      )V(OncePerRequestFilter.java:73)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.Ser
      vletRequest;Ljavax.servlet.ServletResponse;)V(FilterChainImpl.java:27)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
      n.run()Ljava.lang.Object;(WebAppServletContext.java:6724)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.se
      curity.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Objec
      t;(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.ac
      l.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSub
      ject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:12
      1)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogi
      c.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponse
      Impl;)V(WebAppServletContext.java:3764)
      at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel
      .ExecuteThread;)V(ServletRequestImpl.java:2644)
      at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest
      ;)V(ExecuteThread.java:219)
      at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
      at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Sourc
      e)
      Caused by: org.jboss.util.NestedRuntimeException: - nested throwable: (java.lang
      .NullPointerException)
      at org.jboss.cache.TreeCache.invokeMethod(Lorg.jgroups.blocks.MethodCall
      ;)Ljava.lang.Object;(TreeCache.java:3184)
      at org.jboss.cache.TreeCache.put(Lorg.jboss.cache.Fqn;Ljava.lang.Object;
      Ljava.lang.Object;)Ljava.lang.Object;(TreeCache.java:1741)
      at net.sf.hibernate.cache.TreeCache.put(Ljava.lang.Object;Ljava.lang.Obj
      ect;)V(TreeCache.java:67)
      ... 16 more
      Caused by: java.lang.NullPointerException
      at org.jboss.cache.eviction.LRUPolicy.nodeAdded(Lorg.jboss.cache.Fqn;)V(
      LRUPolicy.java:54)
      at org.jboss.cache.eviction.LRUPolicy.nodeCreated(Lorg.jboss.cache.Fqn;)
      V(LRUPolicy.java:92)
      at org.jboss.cache.TreeCache.notifyNodeCreated(Lorg.jboss.cache.Fqn;)V(T
      reeCache.java:3449)
      at org.jboss.cache.TreeCache.findNode(Lorg.jboss.cache.Fqn;ZZLorg.jboss.
      cache.GlobalTransaction;I)Lorg.jboss.cache.Node;(TreeCache.java:3276)
      at org.jboss.cache.TreeCache._put(Lorg.jboss.cache.GlobalTransaction;Lor
      g.jboss.cache.Fqn;Ljava.lang.Object;Ljava.lang.Object;Z)Ljava.lang.Object;(TreeC
      ache.java:2341)
      at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.
      lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.l
      ang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
      Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
      I)Ljava.lang.Object;(Unknown Source)
      at org.jgroups.blocks.MethodCall.invoke(Ljava.lang.Object;)Ljava.lang.Ob
      ject;(MethodCall.java:236)
      at org.jboss.cache.interceptors.CallInterceptor.invoke(Lorg.jgroups.bloc
      ks.MethodCall;)Ljava.lang.Object;(CallInterceptor.java:14)
      at org.jboss.cache.interceptors.Interceptor.invoke(Lorg.jgroups.blocks.M
      ethodCall;)Ljava.lang.Object;(Interceptor.java:39)
      at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(Lorg.jgrou
      ps.blocks.MethodCall;)Ljava.lang.Object;(ReplicationInterceptor.java:47)
      at org.jboss.cache.TreeCache.invokeMethod(Lorg.jgroups.blocks.MethodCall
      ;)Ljava.lang.Object;(TreeCache.java:3181)
      ... 18 more
      >









        • 1. Re: NullPointerException: TreeCache.put
          Ben Wang Master

          You will need to supply the JBossCache version. There is little information in your posting to see what's going on.

          -Ben

          • 2. Re: NullPointerException: TreeCache.put
            hari sujathan Newbie

            Hi Ben,
            Exception got fixed after

            <cache usage=""transactional"/>
            tag in one of the hibernate class was removed from hibernate mapping file . and after application was deploed in tomcat 5.0:
            Also please not that, if
            hibernate.cache.provider_class=net.sf.hibernate.cache.TreeCacheProvider
            is replaced with following(coherence caching), everything works without need to change mapping file. And I was able to see cache keys(coherence) on web console(weblogic):
            hibernate.cache.provider_class=net.sf.hibernate.cache.CoherenceCacheProvider

            I am using hibernate 2.1.8 & JBossCache 1.2.
            Here are the files:
            treecache.xml(don't know whether this correct at all):
            <?xml version="1.0" encoding="UTF-8"?>
            <server>
            <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/><mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
             <depends>jboss:service=Naming</depends>
             <depends>jboss:service=TransactionManager</depends>
            <!-- <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>-->
            
             <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
             <attribute name="ClusterName">TreeCache-Cluster</attribute>
             <attribute name="CacheMode">REPL_SYNC</attribute>
             <attribute name="SyncReplTimeout">10000</attribute>
             <attribute name="LockAcquisitionTimeout">15000</attribute>
             <attribute name="FetchStateOnStartup">true</attribute>
             <attribute name="EvictionPolicyClass">
             org.jboss.cache.eviction.LRUPolicy
             </attribute>
             <attribute name="EvictionPolicyConfig">
             <config>
             <attribute name="wakeUpIntervalSeconds">5</attribute>
            
            </config>
            </attribute>
             <attribute name="ClusterConfig">
             <config>
             <UDP mcast_addr="224.10.10.10" mcast_port="45566"
             ip_ttl="64" ip_mcast="true"
             mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
             ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
             loopback="false" bind_addr="127.0.0.1"/>
             <PING timeout="2000" num_initial_members="3"
             up_thread="false" down_thread="false"/>
             <MERGE2 min_interval="10000" max_interval="20000"/>
             <FD_SOCK/>
             <VERIFY_SUSPECT timeout="1500"
             up_thread="false" down_thread="false"/>
             <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
             max_xmit_size="8192" up_thread="false" down_thread="false"/>
             <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
             down_thread="false"/>
             <pbcast.STABLE desired_avg_gossip="20000"
             up_thread="false" down_thread="false"/>
             <FRAG frag_size="8192"
             down_thread="false" up_thread="false"/>
             <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
             shun="true" print_local_addr="true"/>
             <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
             </config>
             </attribute>
            </mbean>
            </server>
            
            



            jdbc.properties which is used to initialize hibernate configuration with spring:
            jdbc.driverClassName=org.hsqldb.jdbcDriver
            jdbc.url=jdbc:hsqldb:hsql://localhost:1476
            jdbc.username=sa
            jdbc.password=
            hibernate.show_sql=true
            hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
            hibernate.cache.provider_class=net.sf.hibernate.cache.TreeCacheProvider
            #hibernate.cache.provider_class=net.sf.hibernate.cache.CoherenceCacheProvider
            hibernate.c3p0.minPoolSize=5
            hibernate.c3p0.maxPoolSize=20
            hibernate.c3p0.timeout=1800
            hibernate.c3p0.max_statement=50
            


            applicationContext.xml of spring:
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
            
            <!--
             - Application context definition for Petclinic on Apache OJB.
             -->
            <beans>
            
            
             <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
             <property name="location"><value>/WEB-INF/jdbc.properties</value></property>
             </bean>
             <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
             <property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
             <property name="url"><value>${jdbc.url}</value></property>
             <property name="username"><value>${jdbc.username}</value></property>
             <property name="password"><value>${jdbc.password}</value></property>
             </bean>
            
             <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
             <property name="dataSource"><ref local="dataSource"/></property>
             <property name="mappingResources">
             <value>vz/esm/vcm/core/vcm-core.hbm.xml</value>
             </property>
             <property name="hibernateProperties">
             <props>
             <prop key="hibernate.dialect">${hibernate.dialect}</prop>
             <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
             <prop key="hibernate.c3p0.minPoolSize">${hibernate.c3p0.minPoolSize}</prop>
             <prop key="hibernate.c3p0.maxPoolSize">${hibernate.c3p0.maxPoolSize}</prop>
             <prop key="hibernate.c3p0.timeout">${hibernate.c3p0.timeout}</prop>
             <prop key="hibernate.c3p0.max_statement">${hibernate.c3p0.max_statement}</prop>
             <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
             </props>
             </property>
             </bean>
            
             <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
             <property name="sessionFactory"><ref local="sessionFactory"/></property>
             </bean>
            
             <bean id="DMS" class="org.springframework.aop.framework.ProxyFactoryBean">
             <property name="target"><ref local="compDMSTarget"/></property>
             <property name="interceptorNames" >
             <list>
             <value>pmTransactionInterceptor</value>
             <value>hibernateInterceptor</value>
             </list>
             </property>
             </bean>
            
             <bean id="compDMS" parent="DMS" >
             <property name="target"><ref local="compDMSTarget"/></property>
             </bean>
            
             <bean id="compDMSTarget" class="vz.esm.vcm.service.ComponentDMS">
             <property name="sessionFactory"><ref local="sessionFactory"/></property>
             </bean>
            
             <bean id="pmTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
             <property name="transactionManager"><ref bean="transactionManager"/></property>
             <property name="transactionAttributes">
             <props>
             <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
             <prop key="*">PROPAGATION_REQUIRED</prop>
             </props>
             </property>
             </bean>
            
             <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.HibernateInterceptor">
             <property name="sessionFactory"><ref bean="sessionFactory"/></property>
             </bean>
            </beans>
            


            part of hibernate mapping file is here:
            <class name="Component" table="Component" discriminator-value="base">
             <cache usage="transactional" />
             <id name="uuid" column="uuid" type="java.lang.String">
             <generator class="uuid.string"/>
             </id>
             <discriminator column="type"/>
            .......
             <set name="contacts" table="contact" lazy="true" cascade="all">
             <key column="component_uuid"/>
             <one-to-many class="Contact"/>
             </set>
             </class>
            ........
            ........
             <class name="Contact" table="Contact">
             <!--following line commented out for jbosscache. But works in coherence cache-->
             <!--<cache usage="transactional" /> -->
             <id name="uuid" column="uuid" type="java.lang.String">
             <generator class="uuid.string"/>
             </id>
            ........
             </class>
            
            


            "Component" class has multiple "Contact"s (one to many relation)
            Does this one to many relationship has anything to do with nullpointer exception?
            Also I am not able to view contents of cache by running: build run.aop.demo

            Also in tomcat nullpointerexception stacktrace was different from weblogic with same mapping file (note:I am not sure whether, I tried different verion of jbosscache & hibernate in weblogic 8.1. ).
            here it is:
            ct contacts0_ where contacts0_.role_uuid=?
            net.sf.hibernate.cache.CacheException: org.jboss.util.NestedRuntimeException: -
            nested throwable: (java.lang.NullPointerException)
             at net.sf.hibernate.cache.TreeCache.put(TreeCache.java:70)
             at net.sf.hibernate.cache.TransactionalCache.put(TransactionalCache.java
            :44)
             at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2
            227)
             at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loade
            r.java:315)
             at net.sf.hibernate.loader.Loader.doQuery(Loader.java:305)
             at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
            (Loader.java:133)
             at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:990)
             at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:965)
             at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.ja
            va:93)
             at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(Ab
            stractCollectionPersister.java:288)
             at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.ja
            va:3303)
             at net.sf.hibernate.collection.PersistentCollection.forceInitialization(
            PersistentCollection.java:336)
             at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(Sessio
            nImpl.java:3156)
             at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
            (Loader.java:138)
             at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
             at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
             at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
             at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553)
             at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
             at vz.esm.vcm.service.ComponentDMS.executeNamedQuery(ComponentDMS.java:1
            29)
             at vz.esm.vcm.service.ComponentDMS.getSMETitleList(ComponentDMS.java:153
            )
             at vz.esm.vcm.web.CreateAtomicElement.populateSMETitleList(CreateAtomicE
            lement.java:130)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:324)
             at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:255)
             at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:553)
             at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:54)
             at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:577)
             at ognl.ASTMethod.getValueBody(ASTMethod.java:84)
             at ognl.SimpleNode.getValue(SimpleNode.java:129)
             at ognl.Ognl.getValue(Ognl.java:335)
             at ognl.Ognl.getValue(Ognl.java:310)
             at org.apache.tapestry.binding.ExpressionBinding.resolveProperty(Express
            ionBinding.java:201)
             at org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBin
            ding.java:194)
             at org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding
            .java:208)
             at org.apache.tapestry.param.AbstractParameterConnector.getBindingValue(
            AbstractParameterConnector.java:105)
             at org.apache.tapestry.param.ObjectParameterConnector.setParameter(Objec
            tParameterConnector.java:53)
             at org.apache.tapestry.param.ParameterManager.setParameters(ParameterMan
            ager.java:105)
             at org.apache.tapestry.AbstractComponent.prepareForRender(AbstractCompon
            ent.java:898)
             at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:8
            53)
             at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.ja
            va:624)
             at org.apache.tapestry.components.Foreach.renderComponent(Foreach.java:1
            22)
             at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:8
            57)
             at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.ja
            va:624)
             at org.apache.tapestry.form.Form.renderComponent(Form.java:362)
             at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:8
            57)
             at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.ja
            va:624)
             at org.apache.tapestry.html.Body.renderComponent(Body.java:269)
             at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:8
            57)
             at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:
            118)
             at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:8
            57)
             at org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
             at org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:
            371)
             at org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngi
            ne.java:732)
             at org.apache.tapestry.engine.PageService.service(PageService.java:77)
             at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java
            :872)
             at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.j
            ava:197)
             at org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:
            158)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
            icationFilterChain.java:237)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
            ilterChain.java:157)
             at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doF
            ilterInternal(OpenSessionInViewFilter.java:117)
             at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
            equestFilter.java:73)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
            icationFilterChain.java:186)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
            ilterChain.java:157)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
            alve.java:214)
             at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
            eContext.java:104)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
            a:520)
             at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
            ContextValve.java:198)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
            alve.java:152)
             at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
            eContext.java:104)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
            a:520)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
            ava:137)
             at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
            eContext.java:104)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
            ava:118)
             at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
            eContext.java:102)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
            a:520)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
            ve.java:109)
             at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
            eContext.java:104)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
            a:520)
             at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            
             at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16
            0)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
            :799)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
            ssConnection(Http11Protocol.java:705)
             at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
            :577)
             at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
            ool.java:683)
             at java.lang.Thread.run(Thread.java:534)
            Caused by: org.jboss.util.NestedRuntimeException: - nested throwable: (java.lang
            .NullPointerException)
             at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3083)
             at org.jboss.cache.TreeCache.put(TreeCache.java:1758)
             at net.sf.hibernate.cache.TreeCache.put(TreeCache.java:67)
             ... 89 more
            Caused by: java.lang.NullPointerException
             at org.jboss.cache.eviction.LRUPolicy.nodeAdded(LRUPolicy.java:54)
             at org.jboss.cache.eviction.LRUPolicy.nodeCreated(LRUPolicy.java:92)
             at org.jboss.cache.TreeCache.notifyNodeCreated(TreeCache.java:3129)
             at org.jboss.cache.interceptors.CreateIfNotExistsInterceptor.createNode(
            CreateIfNotExistsInterceptor.java:71)
             at org.jboss.cache.interceptors.CreateIfNotExistsInterceptor.invoke(Crea
            teIfNotExistsInterceptor.java:43)
             at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:40)
             at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(Replicatio
            nInterceptor.java:51)
             at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3078)
             ... 91 more
            (web.FlushingSpringSessionInViewFilter 134 ) Using SessionFactory 'sessionFactor
            y' for OpenSessionInViewFilter
            







            Thanks in Advance,
            Hari






            • 3. Re: NullPointerException: TreeCache.put
              hari sujathan Newbie

              Finally it worked. It was a problem in treecache.xml. Also am able to see the cache contents through applet using "build run.demo".
              Here is treecache.xml that worked(had to do sort of hacking of the code to get things done):

              <?xml version="1.0" encoding="UTF-8"?>
              <server>
              <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
              <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
               <depends>jboss:service=Naming</depends>
               <depends>jboss:service=TransactionManager</depends>
              <!-- <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>-->
              
               <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
               <attribute name="ClusterName">TreeCache-Cluster</attribute>
               <attribute name="CacheMode">REPL_SYNC</attribute>
               <attribute name="SyncReplTimeout">10000</attribute>
               <attribute name="LockAcquisitionTimeout">15000</attribute>
               <attribute name="FetchStateOnStartup">true</attribute>
               <attribute name="UseReplQueue">false</attribute>
               <attribute name="ReplQueueInterval">0</attribute>
               <attribute name="ReplQueueMaxElements">0</attribute>
               <attribute name="InitialStateRetrievalTimeout">5000</attribute>
               <attribute name="EvictionPolicyClass"></attribute>
              
              <!-- <attribute name="EvictionPolicyClass">
               org.jboss.cache.eviction.LRUPolicy
               </attribute>-->
              
               <attribute name="EvictionPolicyConfig">
               <config>
               <attribute name="wakeUpIntervalSeconds">5</attribute>
              <!-- Cache wide default -->
              </config>
              </attribute>
              
               <attribute name="ClusterConfig">
               <config>
               <UDP mcast_addr="224.10.10.10" mcast_port="45566"
               ip_ttl="64" ip_mcast="true"
               mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
               ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
               loopback="false" bind_addr="127.0.0.1"/>
               <PING timeout="2000" num_initial_members="3"
               up_thread="false" down_thread="false"/>
               <MERGE2 min_interval="10000" max_interval="20000"/>
               <FD_SOCK/>
               <VERIFY_SUSPECT timeout="1500"
               up_thread="false" down_thread="false"/>
               <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
               max_xmit_size="8192" up_thread="false" down_thread="false"/>
               <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
               down_thread="false"/>
               <pbcast.STABLE desired_avg_gossip="20000"
               up_thread="false" down_thread="false"/>
               <FRAG frag_size="8192"
               down_thread="false" up_thread="false"/>
               <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
               shun="true" print_local_addr="true"/>
               <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
               </config>
               </attribute>
              
              </mbean>
              </server>
              
              



              Regards, Cigards & Love
              Hari