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: [email protected]
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.

Is this a bug or is it by design?

Thanks,
--ming

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users

Reply via email to