Standalone applications and JBoss Cache
suppyam Aug 22, 2006 4:09 PMHere is my scenario:
1. I have a standalone java application that uses weblogic-connection pooling and the JBoss Cache for my data.
2. I therefore start my weblogic server (and therefore my connection pool is deployed). Please note that my application is not deployed - it is a standalone after all!
3. My jbosscache-config.xml is in my classpath
4. My application is started up.
5. I can see that the application and JBoss Cache are able to connect to the connection pool (that JNDI lookup works fine), and retrieve the data necessary.
The exception I get is that I am unable to bind 'appcache' - which is my TreeCache JNDI name... Help please!
If I convert this into a servlet, and deploy it WITHIN weblogic, everything works fine.
I have put all the necessary jar files in weblogic classpath (modified startweblogic.cmd to include these jars). The xml is definitely found since I put in statements around that - and its working fine. Why is it that I cannot bind it?
Here are my xml parameters:
<mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache"> <depends>jboss:service=Naming</depends> <depends>jboss:service=TransactionManager</depends> <attribute name="NodeLockingScheme">OPTIMISTIC</attribute> <attribute name="TransactionManagerLookupClass">com.hp.util.WebLogicTransactionManagerLookup</attribute> <attribute name="IsolationLevel">REPEATABLE_READ</attribute> <attribute name="CacheMode">REPL_SYNC</attribute> <attribute name="UseReplQueue">false</attribute> <attribute name="ReplQueueInterval">0</attribute> <attribute name="ReplQueueMaxElements">0</attribute> <attribute name="ClusterName">TreeCache-Cluster</attribute> <attribute name="ClusterConfig"> <config> <TCP start_port="10001" bind_addr="localhost" loopback="true"/> <TCPPING initial_hosts="localhost[9999]" port_range="1" timeout="3000" num_initial_members="2" up_thread="true" down_thread="true" /> <FD shun="true" up_thread="true" down_thread="true" timeout="2500" max_tries="5" /> <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/> <pbcast.NAKACK gc_lag="100" retransmit_timeout="3000" up_thread="true" down_thread="true"/> <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/> <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true" up_thread="true" down_thread="true"/> <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/> </config> </attribute> <attribute name="FetchStateOnStartup">true</attribute> <attribute name="InitialStateRetrievalTimeout">5000</attribute> <attribute name="SyncReplTimeout">10000</attribute> <attribute name="LockAcquisitionTimeout">15000</attribute> <attribute name="EvictionPolicyClass"></attribute>
The exception that I get is:
- TreeCache local address is 127.0.0.1:10001 - transferred state is null (may be first member in cluster) - viewAccepted(): [127.0.0.1:10001|0] [127.0.0.1:10001] - State could not be retrieved (we are the first member in group) [2006-08-21 19:17:54,560] [main] DEBUG [cache.CacheManager] Application cache service running [2006-08-21 19:17:54,560] [main] DEBUG [cache.CacheManager] TreeCache object [18865135] - input_cookie is bela - created socket to 127.0.0.1:10001 [2006-08-21 19:18:29,904] [main] ERROR [cache.CacheManager] Problems Saving Cache In JNDI javax.naming.ConfigurationException [Root exception is java.rmi.MarshalException: failed to marshal rebind(Ljava.lang.String;Ljava.lang.Object;Ljava.util.Hashtable;); nested exception is: java.io.NotSerializableException: org.jboss.cache.TreeCache] at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:45) at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:77) at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:418) at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:143) at javax.naming.InitialContext.rebind(InitialContext.java:363) at com.hp.util.ServiceLocator.putInContext(ServiceLocator.java:141)