RE: Newbie Question re: `sfClass' Error Message
"Goldsack, Patrick" <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Eric,
I will cover this is stages:
1) The sfClass error indicates that something which SmartFrog is
interpreting as a component is missing the sfClass attribute - the
attribute that defines exactly WHAT the component is. A resolution
exception indicates that an attribute couldn't be found where it was
expected. Unfortubately during these early phases of deployment, the
naming is not yet initialised so the component in which the attribute
was missing cannot be stated, so this doesn't help diagnosing the error.
2) Looking at you description, it is likely that one of the members of
the top-level compound that doesn't have the attribute that SmartFrog
expects. If you ewant to find out, you can use the sfParse command-line
command to parse the .sf file. Using the -v option you can see all the
language processing, and the resultant description. From this you can
see if the attributes are what you expect. This will generate a lot of
output, though the final description will probably be quite small. You
can learn a lot about SF by playing with that tool. The sfGui tool
provides a similar capability.
3) If you want to define structured data not to be treated as a
component to be deployed, then you prefix the definition with the
keyword DATA (historically, and equivalently, LAZY). SmartFrog will then
ignore the data, assuming it is only configuration data and not a
description of a component to be deployed. Anything prefixed with DATA
need not have the sfClass attribute.
4) In the scripting component set, an Exec or a ShellExec structure is
intended to be data, not a component. So it does not have an sfClass
attribute. However in your description you have embedded the definition
of the new exec structure within the compound as though it were a
component. This is, I think, the source of the error message.
5) So how to fix it (notice, for the illustration, I changed the
definition of fbsdBashExec) :
A) mark the definition of fbsdBashExec as DATA
actually this is not the approach I would take
#include "org/smartfrog/services/shellscript/components.sf"
sfConfig extends Compound {
fbsdBashExec extends DATA BashExec {
cmd ["/usr/local/bin/bash"];
}
aShell extends Shell {
exec extends DATA fbsdBashExec;
}
dns extends Script {
shell LAZY aShell;
deployScript ["echo deployed"];
terminateScript ["echo terminated"];
}
}
B) move the deifnition of fbsdBashExec to the root of the file -
remembering that it is only the sfConfig attribute that is deployed.
This would take it out of the compound and hence it would not get
deployed. On the whole this would be my prefered option.
#include "org/smartfrog/services/shellscript/components.sf"
fbsdBashExec extends BashExec {
cmd ["/usr/local/bin/bash"];
}
sfConfig extends Compound {
aShell extends Shell {
exec extends DATA fbsdBashExec;
}
dns extends Script {
shell LAZY aShell;
deployScript ["echo deployed"];
terminateScript ["echo terminated"];
}
}
C) inline the definition into that of aShell, or possibly inlining just
the command.
#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"];
}
}
Anyway, I hope this helps. BTW, We just released into the CVS a set of
DNS management components. They are not yet in a packaged release,
though.
Patrick
-----Original Message-----
From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] 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