<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 3 Mar 2009, at 22:47, Galder Zamarreno wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br><br>Manik Surtani wrote:<br><blockquote type="cite">On 3 Mar 2009, at 22:14, Brian Stansberry wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">I kind of got lost in the details there, but I don't think that affects my opinion. ;)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">IMHO trying to do complex stuff in toString() is asking for trouble. Either DataContainerImpl.toString() or CacheInvocationDelegate.toString() should stop calling into arbitrarily complex code and just output basic info.<br></blockquote></blockquote><blockquote type="cite">Yup. &nbsp;Also, this is a known issue and is fixed in 3.0.3.GA:<br></blockquote><blockquote type="cite"><a href="https://jira.jboss.org/jira/browse/JBCACHE-1478">https://jira.jboss.org/jira/browse/JBCACHE-1478</a><br></blockquote><br>I'm already using 3.0.3.GA...<br></div></blockquote><div><br></div><div>Hmm, that's no good... ok, could you reopen the JIRA and assign it to me?</div><br><blockquote type="cite"><div><br><blockquote type="cite"><blockquote type="cite">Galder Zamarreno wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Bear with me on this one, it's a bit long :)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I've been running some tests creating Cache instances via MC and I've noticed that when TRACE logging is enabled on org.jboss.kernel, my Cache beans are not deployed whereas when org.jboss.kernel is set to DEBUG or higher, Cache beans deploy fine.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">The error I'm getting is the following:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2009-03-03 21:40:51,505 ERROR [AbstractKernelController] (main) Error installing to Instantiated: name=CacheClusterA1 state=Described<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">java.lang.UnsupportedOperationException: Not supported in UnversionedNode<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.cache.AbstractNode.getChildrenDirect(AbstractNode.java:277)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.cache.mvcc.NodeReference.getChildrenDirect(NodeReference.java:272) &nbsp;&nbsp;&nbsp;&nbsp;at org.jboss.cache.invocation.NodeInvocationDelegate.getChildrenDirect(NodeInvocationDelegate.java:163) &nbsp;&nbsp;&nbsp;&nbsp;at org.jboss.cache.DataContainerImpl.numNodes(DataContainerImpl.java:461)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.cache.DataContainerImpl.getNumberOfNodes(DataContainerImpl.java:438) &nbsp;&nbsp;&nbsp;&nbsp;at org.jboss.cache.DataContainerImpl.toString(DataContainerImpl.java:394)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.cache.DataContainerImpl.toString(DataContainerImpl.java:372)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.cache.invocation.CacheInvocationDelegate.toString(CacheInvocationDelegate.java:144) &nbsp;&nbsp;&nbsp;&nbsp;at java.lang.String.valueOf(String.java:2615)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.util.JBossStringBuilder.append(JBossStringBuilder.java:114)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;at org.jboss.dependency.plugins.AbstractControllerContext.toString(AbstractControllerContext.java:362) Looks like in TRACE mode, MC is trying to print the Cache when this is not fully started.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">To try to understand this, let's look at what DataContainerImpl logs when org.jboss.kernel is set to DEBUG:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneldebug.log:2894:2009-03-03 21:40:24,249 2198 &nbsp;TRACE [org.jboss.cache.DataContainerImpl] (main:) Starting data container. Using MVCC? false<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneldebug.log:2895:2009-03-03 21:40:24,274 2223 &nbsp;TRACE [org.jboss.cache.DataContainerImpl] (main:) Setting root node to an instance of class org.jboss.cache.mvcc.NodeReference<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneldebug.log:3038:2009-03-03 21:40:24,336 2285 &nbsp;TRACE [org.jboss.cache.DataContainerImpl] (main:) Starting data container. Using MVCC? true<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneldebug.log:3039:2009-03-03 21:40:24,338 2287 &nbsp;DEBUG [org.jboss.cache.DataContainerImpl] (main:) Setting rootInternal to NodeReference{delegate=UnversionedNode[ /]}<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">After MVCC has been set to true, DataContainerImpl.getNumberOfNodes() is able to get the number of nodes successfully:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;if (!usingMvcc) return numNodes(root) - 1;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;return numNodesMvcc(rootInternal) - 1;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">However, if in between the two "Starting data container" messages, someone (i.e. MC), tries to get the number of nodes (via toString), then Cache tries to get number of nodes of a MVCC node as a non MVCC node failing with the exception above. This is exactly what happens when you enable TRACE on MC kernel.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">numNodesMvcc() calls getChildren(). numNodes calls getChildrenDirect().<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">With this TRACE enabled, log only show the first two lines:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneltrace.log:6731:2009-03-03 21:40:51,468 2817 &nbsp;TRACE [org.jboss.cache.DataContainerImpl] (main:) Starting data container. Using MVCC? false<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">log4j-jboss-kerneltrace.log:6732:2009-03-03 21:40:51,475 2824 &nbsp;TRACE [org.jboss.cache.DataContainerImpl] (main:) Setting root node to an instance of class org.jboss.cache.mvcc.NodeReference<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">So, how do we solve this?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm not sure I understand why DataContainerImpl.createRootNode() is called twice. The very first call, which seems to come from DataContainerImpl.injectDependencies() method (annotated with @Inject) looks suspicious. Why does it look suspicious? Because calls like this expect a config to be set. And when they're called initially from @Inject, the config object is not still set (when the call comes as part of the start operation, config is indeed set)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">usingMvcc = config != null &amp;&amp; config.getNodeLockingScheme() == NodeLockingScheme.MVCC;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">And this returning false, when in fact the config is set to MVCC is what results of number of nodes being calculated incorrectly.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Not sure on how to fix this though.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Thoughts?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">------------------------------------------------------------------------<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">jbosscache-dev mailing list<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="mailto:jbosscache-dev@lists.jboss.org">jbosscache-dev@lists.jboss.org</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/jbosscache-dev">https://lists.jboss.org/mailman/listinfo/jbosscache-dev</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-- <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Brian Stansberry<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Lead, AS Clustering<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">JBoss, a division of Red Hat<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:brian.stansberry@redhat.com">brian.stansberry@redhat.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">jbosscache-dev mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:jbosscache-dev@lists.jboss.org">jbosscache-dev@lists.jboss.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/jbosscache-dev">https://lists.jboss.org/mailman/listinfo/jbosscache-dev</a><br></blockquote></blockquote><blockquote type="cite">-- <br></blockquote><blockquote type="cite">Manik Surtani<br></blockquote><blockquote type="cite">Lead, JBoss Cache<br></blockquote><blockquote type="cite"><a href="http://www.jbosscache.org">http://www.jbosscache.org</a><br></blockquote><blockquote type="cite"><a href="mailto:manik@jboss.org">manik@jboss.org</a><br></blockquote><blockquote type="cite">------------------------------------------------------------------------<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">jbosscache-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:jbosscache-dev@lists.jboss.org">jbosscache-dev@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/jbosscache-dev">https://lists.jboss.org/mailman/listinfo/jbosscache-dev</a><br></blockquote><br>-- <br>Galder Zamarreņo<br>Sr. Software Maintenance Engineer<br>JBoss, a division of Red Hat<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div>Lead, JBoss Cache</div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a><br><a href="mailto:manik@jboss.org" target="_blank">manik@jboss.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>