What you're doing is fine, and is probably working correctly. Modify
MyStartClass so that when it catches a JessException, it displays not
only the top-level exception, but any nested exception as well, as
shown in this clip from jess.Main:
catch (JessException re)
{
if (re.getNextException() != null)
{
m_rete.getErrStream().write(re.toString());
m_rete.getErrStream().write("\nNested exception is:\n");
m_rete.getErrStream().println(re.getNextException().getMessage());
re.getNextException().printStackTrace(m_rete.getErrStream());
}
else
re.printStackTrace(m_rete.getErrStream());
}
The nested exception may tell you why the IOException is occurring. It
can be anything that causes the batched file to not parse correctly,
including syntax errors, missing definitions, etc -- not just that the
file was not found.
I think [EMAIL PROTECTED] wrote:
> What is the recommended way to include the .clp files in the CLASSPATH? Here is
> my problem:
>
> An example similar to my actual directory structure
> C:
> ------ jdk1.1.8
> ------ bin
> ------ lib
> ...
> ----- jdk1.2.2
> |
> ----- bin
>
> ----- Jess60a1
> ----- classes122
> ----- jess
> *.class
>
> (Compiled from C:\Jess60a1 dir with "-d classes122", using
> jdk1.2.2 javac
> Ex: cd C:\Jess60a1
> C:\jdk1.2.2\bin\javac -d classes122 jess\*.java jess\awt\*.java
> jess\factory\*.java)
>
> ----- awt
> *.class
> ----- factory
> *.class
> ----- classes118
> ----- jess
> ----- awt
> *.class
> ----- factory
> *.class
> ----- myProject
> ----- jessrules
> ----- myStartClass
> ----- myStart.clp
> ...
>
> JDK122_HOME=C:\jdk1.2.2
> JDK118_HOME=C:\jdk1.1.8
> JESS_122=C:\Jess60a1\classes122
> JESS_118=C:\Jess60a1\classes118
>
> Attempt 1:
> CP=c:\myProject;%JESS_122%
> %JDK122_HOME%\bin\java -classpath %CP% jessrules.MyStartClass
>
> // MyStartClass.java line 88
> rete.executeCommand("(batch jessrules/myStart.clp)");
>
> Attempt 2:
> CP=c:\myProject;%JESS_118%;%JDK118_HOME%\lib\classes.zip
> %JDK118_HOME%\bin\java -classpath %CP% jessrules.MyStartClass
>
> // MyStartClass.java line 88
> rete.executeCommand("(batch jessrules/myStart.clp)");
>
>
> Error that I get:
> Jess reported an error in routine batch while executing (batch
> jessrules/myStart.clp).
> Message: I/O Exception.
> Program text: ( batch jessrules/myStart.clp ) at line 0.
> at jess.Batch.call(Compiled Code)
> at jess.FunctionHolder.call(FunctionHolder.java:37)
> at jess.Funcall.execute(Funcall.java:245)
> at jess.Jesp.parseAndExecuteFuncall(Jesp.java:1491)
> at jess.Jesp.parseSexp(Jesp.java:182)
> at jess.Jesp.parse(Compiled Code)
> at jess.Rete.executeCommand(Rete.java:1696)
> at jessrules.JessRuleManager.<init>(MyStartClass.java:88)
>
> Please help.
>
> THANKS!!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list (use your own address!) List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------