RE: Newbie Question re: `sfClass' Error Message
"Guijarro, Julio" <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Eric,
The problem that you have is described in the report of your "sfStart"
command.
> - 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'
Here you can read that the problem is that TEST1 did not deploy
"fbsdBashExec" component.
The reason is that fbsdBashExec does not have a sfClass attribute
because it is not a component, it is data structure.
This data structure is used by Shell to extract all the information that
defines and configures the "program" to run.
The previous log statements don't help because the error happens in a
context where the information to identify the component that fails is
not available yet. But the final error statement is correct. You see the
log statements because by default logging is redirected to standard
output. Too much information can sometimes be very misleading and
confusing.
The right description would be:
#include "org/smartfrog/services/shellscript/components.sf"
fbsdBashExec extends ShellExec {
cmd ["/usr/local/bin/bash"];
echoErrorCmd "$?";
}
sfConfig extends Compound {
aShell extends Shell {
exec extends DATA fbsdBashExec;
}
dns extends Script {
shell LAZY aShell;
deployScript ["echo deployed"];
terminateScript ["echo terminated"];
}
}
Note that fbsdBashExec is defined as a template that will be used by
aShell.
In your example you put the template inside the sfConfig and sfConfig is
similar to "main" in Java, it defines the top component of your
description. When you deploy your example, Compound tries to deploy any
description that is not LAZY and therefore tries to deploy fbsdBashExec
and fails.
If you want to see the difference you can also try to deploy:
#include "org/smartfrog/services/shellscript/components.sf
sfConfig extends Compound {
fbsdBashExec extends DATA ShellExec {
//fbsdBashExec extends LAZY 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"];
}
}
In this case TEST1 will have two components aShell and dns like the
previous example. The difference with the previous example is that the
last one will also contain an attribute called fbsdBashExec type
"ComponentDescription"
You can use the management console to analyze this.
One last alternative is to overwrite the value of the exec cmd attribute
directly in your new description:
#include "org/smartfrog/services/shellscript/components.sf"
sfConfig extends Compound {
aShell extends Shell {
exec extends DATA BashExec {
cmd ["/usr/local/bin/bash"];
}
dns extends Script {
shell LAZY aShell;
deployScript ["echo deployed"];
terminateScript ["echo terminated"];
}
}
I can see in you example that you use "dns". Are you trying to
manipulate DNS? If that is the case, we just released yesterday a set of
DNS components that could help you. Right now they are only available
from CVS and documentation is a bit sparse.
Regards,
Julio
> -----Original Message-----
> From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-
> [email protected]] On Behalf Of Eric Eide
> Sent: 08 February 2006 18:54
> To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Cc: Eric Eide
> Subject: [Smartfrog-support] Newbie Question re: `sfClass' Error
Message
>
> 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
> _______________________________________________
> Smartfrog-support mailing list
> Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/smartfrog-support
-------------------------------------------------------
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&kid3432&bid#0486&dat1642