[jboss-user] [Beginners Corner] - Need a healp in configuring CacheLoders

ramalakshmi.nvs do-not-reply at jboss.com
Fri Jul 18 02:19:46 EDT 2008


Hi,

  How can i configure both JDBCCacheLoader and TcpDelegatingCacheLoader.


<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  Sample TreeCache Service Configuration                               -->
<!--                                                                       -->
<!-- ===================================================================== -->



    
	
    <!-- ==================================================================== -->
    <!-- Defines TreeCache configuration                                      -->
    <!-- ==================================================================== -->
 
 <depends optional-attribute-name="Cache" proxy-type="attribute">jboss.cache:service=HttpCache
  jboss:service=Naming
    jboss:service=TransactionManager

	${jboss.bind.address:15.76.223.144}
 7001
 
        <!--
        Configure the TransactionManager
    -->

        org.jboss.cache.GenericTransactionManagerLookup

        <!--
            Isolation level : SERIALIZABLE
                              REPEATABLE_READ (default)
                              READ_COMMITTED
                              READ_UNCOMMITTED
                              NONE
        -->
        READ_COMMITTED

        <!--
             Valid modes are LOCAL
                             REPL_ASYNC
                             REPL_SYNC
                             INVALIDATION_ASYNC
                             INVALIDATION_SYNC
        -->
        REPL_SYNC

        <!--
        Just used for async repl: use a replication queue
        -->
        false

        <!--
            Replication interval for replication queue (in ms)
        -->
        0

        <!--
            Max number of elements which trigger replication
        -->
        0

        <!-- Name of cluster. Needs to be the same for all clusters, in order
             to find each other
        -->
        cache_cluster

        <!-- JGroups protocol stack properties. Can also be a URL,
             e.g. file:/home/bela/default.xml
           
        -->

        
            
                <!-- UDP: if you have a multihomed machine,
                set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr="192.168.0.2"
                -->
                <!-- UDP: On Windows machines, because of the media sense feature
                 being broken with multicast (even after disabling media sense)
                 set the loopback attribute to true -->
                <UDP mcast_addr="228.4.5.6" mcast_port="48866"
                    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="15.76.223.144" />
                <PING timeout="2000" num_initial_members="3"
                    up_thread="false" down_thread="false"/>
                <MERGE2 min_interval="10000" max_interval="20000"/>
                <!--        <FD shun="true" up_thread="true" down_thread="true" />-->
                <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"/>
            
        


        <!--
         Whether or not to fetch state on joining a cluster
         NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
        -->
        true

        <!--
            The max amount of time (in milliseconds) we wait until the
            initial state (ie. the contents of the cache) are retrieved from
            existing members in a clustered environment
        -->
        15000

        <!--
            Number of milliseconds to wait until all responses for a
            synchronous call have been received.
        -->
        15000

        <!-- Max number of milliseconds to wait for a lock acquisition -->
        10000

<!-- TCPDelegatingCacheLoader --> 

  



       <!--
          Indicate whether to use region based marshalling or not. Set this to true if you are running under a scoped
          class loader, e.g., inside an application server. Default is "false".
       -->
	  	
            
                <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
                false
                <!-- comma delimited FQNs to preload -->
                /
                <!-- are the cache loaders shared in a cluster? -->
                true

                <!-- we can now have multiple cache loaders, which get chained -->

				 
			org.jboss.cache.loader.tcp.TcpDelegatingCacheLoader
			 
			 host=15.76.223.144
			 port=7001
			 			 
			
                <!-- the 'cacheloader' element may be repeated -->
					
                
                    org.jboss.cache.loader.JDBCCacheLoader
                    <!-- same as the old CacheLoaderConfig attribute -->
                    
					cache.jdbc.table.name=JCACHE
    				cache.jdbc.table.create=false
    				cache.jdbc.table.drop=false
    				cache.jdbc.fqn.column=fqn
    				cache.jdbc.fqn.type=varchar(500)
    				cache.jdbc.node.column=node
    				cache.jdbc.node.type=blob
    				cache.jdbc.parent.column=parent
    				cache.jdbc.driver=oracle.jdbc.OracleDriver
    				cache.jdbc.url=jdbc:oracle:thin:@sdp3pf1.india.hp.com:1521:TPFDB
    				cache.jdbc.user=lakshmi
    				cache.jdbc.password=lakshmi
    				cache.jdbc.datasource=tpfDBDS
                    
                    <!-- whether the cache loader writes are asynchronous -->
                    false
                    <!-- only one cache loader in the chain may set fetchPersistentState to true.
                        An exception is thrown if more than one cache loader sets this to true. -->
                    true
                    <!-- determines whether this cache loader ignores writes - defaults to false. -->
                    false
                    <!-- if set to true, purges the contents of this cache loader when the cache starts up.
                    Defaults to false.  -->
                    false
                
            
        

		 


   



 when I configure as above iam getting the following exception.


java.io.EOFException
        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream
.java:2232)
        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputS
tream.java:2698)
        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750
)
        at java.io.ObjectInputStream.(ObjectInputStream.java:268)
        at org.jboss.cache.loader.tcp.TcpDelegatingCacheLoader.init(TcpDelegatin
gCacheLoader.java:109)
        at org.jboss.cache.loader.tcp.TcpDelegatingCacheLoader.start(TcpDelegati
ngCacheLoader.java:86)
        at org.jboss.cache.loader.ChainingCacheLoader.start(ChainingCacheLoader.
java:377)
        at org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoade
rManager.java:353)
        at org.jboss.cache.TreeCache.startService(TreeCache.java:1535)
        at jsp_servlet.__jcache.createCache(__jcache.java:125)
        at jsp_servlet.__jcache._jspService(__jcache.java:480)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:223)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
        at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
StubImpl.java:391)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:309)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)

plz healp me out how to configure both the CacheLoders.

Thanks,
Ramalakshmi

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165243#4165243

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165243



More information about the jboss-user mailing list