Re: infinite loop trying to deploy
Steve Loughran <[email protected]> Mon, 10 Jan 2011 14:48:26 +0000
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
On 23/12/10 15:20, Goldsack, Patrick wrote: > I agree that the code is a bit odd. The code makes the assumption that if the prim has been exported you are comparing exported objects (RMI obj refs) and not local objects. And clearly the code fails if the parameter (o) is a local object which has indeed been exported - I presume that at the time we thought that this would never be the case. > > This would be trivial to fix if the assumption is indeed incorrect, but what surprises me is that this core code is being exercised in every single deployment... and has been for years (I checked and at least 2 years ago this was the definition)! So either there is some untested and unexpected state in your configuration, or there is an interesting and unusual issue with your sf example that is not trapped and reported properly. > > Could you please send me your example (if you can) and I will take a look and we can go from there. > > Patrick > > -----Original Message----- > From: Ming Fang [mailto:[email protected]] > Sent: 23 December 2010 06:59 > To: smartfrog-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > Subject: [Smartfrog-users] infinite loop trying to deploy > > Hi, > > I'm getting an infinite loop when trying to deploy a sample file. > I'm following the instructions from the IDE_develop.pdf document using Intellij. > The command Iine looks like this. > > java -Dorg.smartfrog.logger.logStackTrace=true -Dorg.smartfrog.iniFile=smartfrog/bin/default.ini org.smartfrog.SFSystem -a Test1:DEPLOY:org/smartfrog/examples/tutorial/MyPrimTest.sf::: -e > > I get the output below > > 2010/12/23 01:47:13:617 EST [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active > 2010/12/23 01:47:13:623 EST [DEBUG][main] SFCORE_LOG - No security manager loaded by SmartFrog > 2010/12/23 01:47:13:627 EST [DEBUG][main] SFCORE_LOG - Network test localhost: hostname '192.168.1.152', ip '192.168.1.152', [Successful], 0ms > 2010/12/23 01:47:13:629 EST [DEBUG][main] SFCORE_LOG - Command Line args: [-a, Test1:DEPLOY:org/smartfrog/examples/tutorial/MyPrimTest.sf:::, -e] > 2010/12/23 01:47:13:635 EST [DEBUG][main] SFCORE_LOG - Parsing SFACT: [Test1:DEPLOY:org/smartfrog/examples/tutorial/MyPrimTest.sf:::] > 2010/12/23 01:47:13:638 EST [DEBUG][main] SFCORE_LOG - Parsing SFACT results: [ name:Test1, type:DEPLOY, url:org/smartfrog/examples/tutorial/MyPrimTest.sf, resultType:UNDEFINED] > 2010/12/23 01:47:14:100 EST [DEBUG][main] HOST "192.168.1.152":sfRunProcess - ProcessCompound 'null' started. > > But then it goes into an infinite loop. > After debugging for a while I think I found the reason. > > The problem is in org.smartfrog.sfcore.processcompound.PrimHostDeployerImpl.java line 135 > if (pc.equals(local)) { > > Even though pc and local both point to the exact same object, the equals() returns false. > The reason is in org.smartfrog.sfcore.prim.PrimImpl.java equals() looks like this > public boolean equals(Object o) { > if (sfExportRef == null) { > return super.equals(o); > } else { > return sfExportRef.equals(o); > } > } > > Therefore the same object will not equal to itself when sfExportRef != null. > I was looking at the toString() stuff and there's a bit of wierdness there too -if you aren't exported you get super.toString(); if you are exported you get the sfExportRef.toString(), which isn't so handy for diagnosing problems, as the exported reference's toString operation is usually some low level data. ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl