[JBoss-user] [JBossCache] - A problem with Java 1.5 enum replication
I have two unrelated questions, the enum question much more pressing. We have a class with some enum fields. And a clustered AOP cache. Across WAN, not sure if it matters. When the value of the enum field changes (through simple assignment), the change is reflected in the local cache, but not replicated to the other node in the cluster. Other fields are replicated without problems. We tried both synchronous and asynchronous replication. Is there anything I need to know about enums? The class where this field lives, is Serializable. The enum itself is not explicitly desclared Serializable, but Enum interface in Java 1.5 is. Second question: I get this message when the server starts up: WARN [TreeCache] No transaction manager lookup class has been defined. Transactions can not be used. I define the lookup class in the cache config file as shown below: | | !-- Configure the TransactionManager -- | attribute name=TransactionManagerLookupClassorg.jboss.cache.JBossTransactionManagerLookup/attribute | My transactions actually do seem to work, but the log still worries me. What am I doing wrong? I get my transaciton like this: . | Properties prop = new Properties(); | prop.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.cache.transaction.DummyContextFactory); | UserTransaction tx=(UserTransaction)new InitialContext(prop).lookup(UserTransaction); | Thanks for your help! Renata. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3902450#3902450 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3902450 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: A problem with Java 1.5 enum replication
Thank you Ben! 1) Before I go to JIRA, let me make sure we understand each other. I forgot to clearly mention in my previous e-mail that we don't instrument our classes currently. They are just Serializable. So in this case does the fact that you are not intercepting the enum field itself still matter? Also, the change is reflected correctly in the local cache, it's just the replication to the other node in the cluster that doesn't happen. 2) Actually I want to use JBossTransactionManagerLookup, but I didn't find any examples in the docs how should I create my transaction in this case. By the way, do I really need to use JBossTransactionManagerLookup? What would you recommend? Again, many thanks for all your help. Renata. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3902472#3902472 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3902472 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: JBoss 4.0.3 message: No transaction manager lookup class
I have the same problem. Not sure why it happens and how I can fix it? I do need transactions! I define the lookup class in the cache config file as shown below: Thanks for your help! Renata. | !-- Configure the TransactionManager -- | attribute name=TransactionManagerLookupClassorg.jboss.cache.JBossTransactionManagerLookup/attribute View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3902087#3902087 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3902087 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: A simple example of self-referencing objects problem
Ben, thanks so much! I couldn't find tag (or branch) 1.2.4Alpha in JBossCache, so I'm going to download the latest. Any word on when 1.2.4 is going to be released? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3891473#3891473 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3891473 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: A simple example of self-referencing objects problem
I downloaded the latest code, and it solved the problem I had, but I ran into a new problem. I added a single field to MySimpleObject class: private StatusEnum status = StatusEnum.OPEN; where StatusEnum is: public enum StatusEnum { OPEN, CLOSE } When I attempt to change this field's value like this: status = StatusEnum.CLOSE; (after MySimpleObject is cached), I get this exception: java.lang.RuntimeException: TreeCacheAopDelegate.putObject(). There is existing pojo under fqn /MyObject/1/status Operation not allowed. at org.jboss.cache.aop.TreeCacheAopDelegate.retrieveCurrentValue(TreeCacheAopDelegate.java:103) at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:152) at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:371) at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:222) at org.jboss.cache.aop.CacheInterceptor.invoke(CacheInterceptor.java:97) at org.jboss.aop.joinpoint.FieldWriteInvocation.invokeNext(FieldWriteInvocation.java:51) at cachetest.MySimpleObject.status_w_$aop(MySimpleObject.java) at cachetest.MySimpleObject.setCrossReferences(MySimpleObject.java:24) at cachetest.SelfReferencingObjectsCacheTest.main(SelfReferencingObjectsCacheTest.java:21) There seems to be a restriction preventing me from changing a cached field. Is it a temporary restriction (there is a TODO comment in the code). If it's permanent, is there any work around? Thanks a lot for all your help! Just in case, this is the new MySimpleObject.java: - package cachetest; import java.util.ArrayList; import java.util.List; public class MySimpleObject { private String id = null; private StatusEnum status = StatusEnum.OPEN; private List decendants = new ArrayList(); // reference to objects of the same class public String getId() { return id; } public void setId(String anID) { id = anID; } public MySimpleObjectsetCrossReferences() { MySimpleObject retVal = new MySimpleObject(); retVal.setId(getId() + _copy); decendants.add(retVal); status = StatusEnum.CLOSE; return retVal; } } View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3891539#3891539 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3891539 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - A simple example of self-referencing objects problem
I have a very simple example that illustrates the problem I described in my previous question (Posted: Fri Aug 19, 2005 21:08 PMPost subject: Problem with caching an object with a complex object graph). Here is the cached class: package cachetest; import java.util.ArrayList; import java.util.List; public class MySimpleObject { private String id = null; private List decendants = new ArrayList(); // reference to objects of the same class public String getId() { return id; } public void setId(String anID) { id = anID; } public MySimpleObjectsetCrossReferences() { MySimpleObject retVal = new MySimpleObject(); retVal.setId(getId() + _copy); decendants.add(retVal); return retVal; } } And the test: package cachetest; import org.jboss.cache.PropertyConfigurator; import org.jboss.cache.aop.TreeCacheAop; import org.jboss.cache.Fqn; public class SelfReferencingObjectsCacheTest { public static void main(String[] args) throws Exception { TreeCacheAop cache = new TreeCacheAop(); PropertyConfigurator config = new PropertyConfigurator(); config.configure(cache, tree-cache.xml); cache.startService(); try { MySimpleObject o = new MySimpleObject(); o.setId(1); cache.putObject(Fqn.fromString(/MyObject/1), o); MySimpleObject newObject = o.setCrossReferences(); cache.putObject(Fqn.fromString(/MyObject/ + newObject.getId()), newObject); } catch (Exception e) { e.printStackTrace(); } } } I aspectize MySimpleObject class using Aopc (it generates a get and set class per each property, so seems to be working properly). And the stack trace: java.lang.RuntimeException: InternalDelegate.incrementRefCount(): REF_COUNT for reference counting is null at: /__JBossInternal__/MyObject/1/decendants/0 at org.jboss.cache.aop.InternalDelegate.incrementRefCount(InternalDelegate.java:73) at org.jboss.cache.aop.TreeCacheAopDelegate.addRefFqn(TreeCacheAopDelegate.java:592) at org.jboss.cache.aop.TreeCacheAopDelegate.getObjectGraphInternalFqn(TreeCacheAopDelegate.java:571) at org.jboss.cache.aop.TreeCacheAopDelegate.handleObjectGraph(TreeCacheAopDelegate.java:513) at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:171) at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:376) at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:255) at cachetest.SelfReferencingObjectsCacheTest.main(SelfReferencingObjectsCacheTest.java:22) org.jboss.util.NestedRuntimeException: TreeCacheAop.putObject(): ; - nested throwable: (java.lang.RuntimeException: InternalDelegate.incrementRefCount(): REF_COUNT for reference counting is null at: /__JBossInternal__/MyObject/1/decendants/0) at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:270) at cachetest.SelfReferencingObjectsCacheTest.main(SelfReferencingObjectsCacheTest.java:22) Caused by: java.lang.RuntimeException: InternalDelegate.incrementRefCount(): REF_COUNT for reference counting is null at: /__JBossInternal__/MyObject/1/decendants/0 at org.jboss.cache.aop.InternalDelegate.incrementRefCount(InternalDelegate.java:73) at org.jboss.cache.aop.TreeCacheAopDelegate.addRefFqn(TreeCacheAopDelegate.java:592) at org.jboss.cache.aop.TreeCacheAopDelegate.getObjectGraphInternalFqn(TreeCacheAopDelegate.java:571) at org.jboss.cache.aop.TreeCacheAopDelegate.handleObjectGraph(TreeCacheAopDelegate.java:513) at org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:171) at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:376) at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:255) ... 1 more If I don't aspectize the class, but declare is Serializable, this example works, I don't get an exception. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3891311#3891311 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3891311 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf
[JBoss-user] [JBossCache] - Problem with caching an object with a complex object graph
This might be a rather involved question, so I'll appreciate any help or idea. I'm caching objects with several fields that are ArrayLists of objects of the same class (or classes derived from it). I took care to aspectize (aopc) everything that lies around, or so I believe. Not to mention all of my own classes that are used by the cached objects, I even included these classes in my jboss-aop.xml (out of desperation, I'm sure it doesn't do anything): java.util.Date java.util.Currency java.lang.String java.util.ArrayList java.math.BigDecimal When the objects are first cached, everything seems to be fine, may be because at this point there are no cross-references (most of the ArrayLists fields I mentioned above are empty). Then I create more objects, filling in some of the ArrayLists, and when I try to cache the new objects, now with references, I get this exception: java.lang.NullPointerException at org.jboss.cache.aop.TreeCacheAop.setRefFqn(TreeCacheAop.java:891) at org.jboss.cache.aop.TreeCacheAop.handleObjectGraph(TreeCacheAop.java:530) at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:261) at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:136) at com.bglobal.commons.cache.impl.jboss.AopTreeAdapter.put(AopTreeAdapter.java:287) etc... It looks like some object is not found in the Cache where it's expected to be. Like I said, I'll appreciate any help, even though I realize this is probably a support case. We don't have jBoss support yet, but we will soon, unfortunately this problem can't really wait :-(. Would it make sense to try and make everything Serialized as opposed to aspectizing, just to see if the latter is causing the problem? P.S. I'm using version 1.2.3 View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3890892#3890892 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3890892 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - BerkeleyDB grows when I keep putting the same key/object in
Hi, I apologize if this question doesn't belong on this forum. If so, could you please point me in the right direction? Here it is anyway: When I add exactly the same key/object pair to the TreeCacheAop, the backstore BDB file keeps growing. There is only one node in the cache, the cache doesn't seem to change, but the DB file does, and rather quickly. Is it normal? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3889626#3889626 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3889626 --- SF.Net email is Sponsored by the Better Software Conference EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile Plan-Driven Development * Managing Projects Teams * Testing QA Security * Process Improvement Measurement * http://www.sqe.com/bsce5sf ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: How does eviction work for Aop tree
I hope someone is reading it... or am I writing to myself? Anyway, I think this is the problem code (from TreeCacheAop.java): public void evict(Fqn fqn) throws CacheException { // We will remove all children nodes as well since we assume all children nodes are part // of this object node. if(isAopNode(fqn)) { if(log.isDebugEnabled()) { log.debug(evict(): evicting whole aop node +fqn); } // _remove(null, fqn, create_undo_ops, false); // TODO Why do we not want to remove the interceptor??? I think we should. // Because if we remove it, the caller has no idea that it has been taken off. // She will still think that caching is in effect. But this returns null value from cache. // What's is a good policy? boolean removeCacheInterceptor = false; _removeObject(fqn, removeCacheInterceptor); } else { super.evict(fqn); } } Is it possible to remove the interceptor only for this one call (_removeObject) and then put it back? Seems like that would be the right thing to do. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3875060#3875060 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3875060 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: How does
Oh, thank you, thank you,thank you! You guys are awesome, responding so quickly to so many people (not to mention your great products and impressive documentation)! I only wondered whether anyone was reading because I had no idea how you managed it. I opened an issue, but I don't have the authority to assign it. http://jira.jboss.com/jira/browse/JBCACHE-135 Thanks again! View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3875082#3875082 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3875082 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: How does
Thank you Bela! I tried running the testEvictionWithCacheLoader2 from the CacheLoaderTestBase class, and it indeed works. Then I modified it like this (because this is the functionality I'm looking for): cache.putObject(/first/second/third, val1); // stored in cache loader cache.evict(Fqn.fromString(/first/second/third)); // removes node, because there are no children assertFalse(cache.exists(/first/second/third)); assertTrue(cache.exists(/first/second)); assertTrue(cache.exists(/first)); String val=(String)cache.getObject(/first/second/third); // should be loaded from cache loader assertEquals(val1, val); assertTrue(cache.exists(/first/second/third)); assertTrue(cache.exists(/first/second)); assertTrue(cache.exists(/first)); getObject returns null, so bolded assertEquals fails. Am I not understanding how the Aop tree works with objects? I tried adding cache.load(/first/second/third) just before cache.getObject(), and it didn't help. Also, when I downloaded 1.2.2 zip file, the jboss-jmx.jar wass missing org.jboss.mx.util.JBossNotificationBroadcasterSupport class, so I had to get this jar from CVS. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874871#3874871 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874871 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - Re: How does
P.S. It appears that for the TreeCacheAop evict() causes complete removal of the node from the backstore. The regular TreeCache doesn't do it. Is this the expected behavior? I though eviction only affects the memory cache, but not the backstore. Is there any configuration that would prevent it from happening? P.P.S. If I use exactly the same Aop cache and configuration, but instead of using putObject(fqn, pojp) API, use put(fqn, key, pojo), the backstore node doesn't get removed during evict() call. Thank you for your help and for getting back to me so quickly after my first post. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874954#3874954 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874954 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBossCache] - How does
A complete TreeCache newby here, so sorry if the questions are less than deep and meaningful. Also sorry for the long post... I'm experimenting with the TreeCacheAop, using replSync-service.xml from JBossCache-1.2.1.zip file. After I evict a node, I expect it to be removed from the memory cache, but not from the permanent backstore. When I call get, I expect it to look first in the memory cache, and if the node is not there, load it from the backstore. However, when I evict a node, and then try to get it, I get null. The node seems to be in the backstore (I see files), it's loaded successfully when I stop and restart the service. Does it mean that if a node is not accessed for a long time and is evicted, I won't be able to get it, unless I explicitely load it from the backstore? When I remove a node, I expect it to be removed from the memory and the backstore (otherwise, how is it different from evict?). However, it looks like the node remains in the backstore. Is there any way to remove data from the backstore? Thanks for your help! View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874732#3874732 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874732 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user