Newbie Question re: `sfClass' Error Message

Eric Eide <eeide-sDh8Nw2yj/[email protected]>
Newsgroups gmane.comp.java.smartfrog.user
Message-ID <[email protected]>
I'm afraid that this is a "newbie" question, but I'll ask it anyway!  If
nothing else, at least this message contains a small bug report for SmartFrog
3.08.004 near the end.

I'm experimenting with SmartFrog 3.08.004 for controlling non-Java programs,
and I've written a simple configuration description "doit.sf" to play with the
scripting components.  This is mostly the same as the example near the end of
<http://www.hpl.hp.com/research/smartfrog/releasedocs/sfShellScript.html>.

	#include "org/smartfrog/services/shellscript/components.sf"
	sfConfig extends Compound {
	    aShell extends BashShell;

	    dns extends Script {
	        shell LAZY aShell;
	        deployScript ["echo deployed"];
	        terminateScript ["echo terminated"];
	    }
	}

When I run this on my system (FreeBSD 4.11-STABLE) with the command:

	sfStart localhost TEST1 /tmp/doit.sf

I see the following error message in the sfDaemon display:

	2006/02/08 11:30:33:470 MST [ERROR][RunProcess] HOST
	...rootProcess:TEST1:aShell - failed to complete execution
	<java.io.IOException: java.io.IOException: /bin/bash: not found>
        
It turns out that `bash' is installed as `/usr/local/bin/bash' on my system.
OK --- so I modify my configuration description to be this:

	#include "org/smartfrog/services/shellscript/components.sf"
	sfConfig extends Compound {
            fbsdBashExec extends ShellExec {
                cmd ["/usr/local/bin/bash"];
                echoErrorCmd "$?";
            }

            aShell extends Shell {
                exec extends DATA fbsdBashExec;
            }

            dns extends Script {
                shell LAZY aShell;
                deployScript ["echo deployed"];
                terminateScript ["echo terminated"];
            }
        }

When I try to start this, however, I get a long error message about `sfClass'
not being resolved.  The error output is as follows:

---BEGIN OUTPUT
2006/02/08 11:37:45:534 MST [WARN ][main] SFCORE_LOG - SmartFrog security is NOT active
SmartFrog 3.08.004
(C) Copyright 1998-2005 Hewlett-Packard Development Company, LP
2006/02/08 11:37:46:414 MST [ERROR][RMI TCP Connection(2)-155.98.60.39] SFCORE_LOG - SmartFrogDeploymentException: unnamed component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass, cause: SmartFrogResolutionException:: Reference not found,    Unresolved Reference: HERE sfClass <SmartFrogDeploymentException: unnamed component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass
    cause: SmartFrogResolutionException:: Reference not found
       Unresolved Reference: HERE sfClass>

2006/02/08 11:37:46:419 MST [ERROR][RMI TCP Connection(2)-155.98.60.39] SFCORE_LOG - SmartFrogDeploymentException: 'fbsdBashExec' component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass, cause: SmartFrogResolutionException:: Reference not found,    Unresolved Reference: HERE sfClass <SmartFrogDeploymentException: 'fbsdBashExec' component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass
    cause: SmartFrogResolutionException:: Reference not found
       Unresolved Reference: HERE sfClass>
        
 - FAILED when trying DEPLOY of 'TEST1',  [/tmp/doit.sf],  host:localhost
    Result:
      * Exception: 'SmartFrogDeploymentException: HERE TEST1 failed to deploy 'fbsdBashExec' component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass
         cause: SmartFrogResolutionException:: Reference not found
            Unresolved Reference: HERE sfClass'
      * Command line SFACT: '"TEST1":DEPLOY:"/tmp/doit.sf"::localhost:'
      * To String: ' name:TEST1,  type:DEPLOY,  url:/tmp/doit.sf,  host:localhost,  resultType:FAILED,  resultExceptionMessage:HERE TEST1 failed to deploy 'fbsdBashExec' component. SmartFrogResolutionException:: Reference not found, Unresolved Reference: HERE sfClass'

---END OUTPUT

I wish I could figure out what this error message means, but it's inscrutable
to me.  As far as I can tell, the daemon's classpath is set correctly; the
diagnostic output shows:

	-------------------------------------------
	 ClassPath
	-------------------------------------------
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/smartfrog-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sfServices-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sfExamples-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sf-tasks.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sf-loggingservices.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/log4j-1.2.8.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/SFGuiTools.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/SFGuiBrowser.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/smartfrog-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sfServices-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sfExamples-3.08.004.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sf-tasks.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/sf-loggingservices.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/log4j-1.2.8.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/SFGuiTools.jar
	/z/eeide/tmp/sf/SmartFrog.3.08.004/dist/lib/SFGuiBrowser.jar

I'm only trying to instantiate existing types of components, not create new
ones, and so I wouldn't expect to need to compile any component implementations
of my own.

Finally, the small bug report!

While trying to diagnose the problem described above, I noticed the following
typo in the SmartFrog sources, in ".../shellscript/components.sf":

	ShellExec extends Exec {
-->	  execShema extends ShellExecSchema;
	  echoCmd "echo";
	}

Thinking that this might somehow be related to my problem, I tried coding
around this by instantiating components based on `Exec' (not `ShellExec').  The
error message did not change.

Thank you for reading this far, and for entertaining what I fear is a newbie
question.  Any help or pointers to relevant documentation would be most
appreciated!

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide-sDh8Nw2yj/[email protected]>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.