I am having an issue with getting IDM 3 on Netware 6.5 to work with an
external java call.

I have the jar file in the correct location sys:systemlib. If I move it
or call another no-existent class I get a different error and the driver
does not even start.

This is driving me crazy and I would appreciate any help.

Thanks.


This is the trace snipet:

09:41:06 Active Directory PT:
<nds dtdversion="2.2">
<source>
<product version="3.0.10.20060630 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify class-name="User" event-id="Active Directory##11365428d63##0"
src-dn="CN=Garry
Ehsman,OU=Adm,OU=Users,OU=Corp,OU=Prod,DC=company, DC=ctx,DC=local">
<association>20eb134536fba74eaf092ce956a3c3ca</association>
<modify-attr attr-name="Telephone Number">
<remove-all-values/>
<add-value>
<value naming="false" type="string">12345677</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>
09:41:06 Active Directory PT: Applying policy: 'Use the LogWriterIDM.jar
to write daily logs out to file.
Send email notifications and remove association of deleted objects'.
09:41:06 Active Directory PT: Applying to modify #1.
09:41:06 Active Directory PT: Evaluating selection criteria for rule
'Notify'.
09:41:06 Active Directory PT: (if-class-name equal "User") = TRUE.
09:41:06 Active Directory PT: Rule selected.
09:41:06 Active Directory PT: Applying rule 'Notify'.
09:41:06 Active Directory PT: Action:
do-set-local-variable("log_text","'"+token-class-name()+"
"+token-src-dn()+" "+token-operation()+"ed in Active Directory'").
09:41:06 Active Directory PT: arg-string("'"+token-class-name()+"
"+token-src-dn()+" "+token-operation()+"ed in Active Directory'")
09:41:06 Active Directory PT: token-text("'")
09:41:06 Active Directory PT: token-class-name()
09:41:06 Active Directory PT: Token Value: "User".
09:41:06 Active Directory PT: token-text(" ")
09:41:06 Active Directory PT: token-src-dn()
09:41:06 Active Directory PT: Token Value: "CN=Garry
Ehsman,OU=Adm,OU=Users,OU=Corp,OU=Prod,DC=company, DC=ctx,DC=local".
09:41:06 Active Directory PT: token-text(" ")
09:41:06 Active Directory PT: token-operation()
09:41:06 Active Directory PT: Token Value: "modify".
09:41:06 Active Directory PT: token-text("ed in Active Directory'")
09:41:06 Active Directory PT: Arg Value: "'User CN=Garry
Ehsman,OU=Adm,OU=Users,OU=Corp,OU=Prod,DC=company, DC=ctx,DC=local modifyed
in Active Directory'".
09:41:06 Active Directory PT: Action:
do-set-local-variable("log_file",token-global-variable("TextLogLocation")).
09:41:06 Active Directory PT:
arg-string(token-global-variable("TextLogLocation"))
09:41:06 Active Directory PT: token-global-variable("TextLogLocation")
09:41:06 Active Directory PT: Token Value: "DATA:IDM_logsADevents".
09:41:06 Active Directory PT: Arg Value: "DATA:IDM_logsADevents".
09:41:06 Active Directory PT: Action:
do-set-local-variable("callLogWriter",arg-object(token-xpath("writetolog:new()"))).
09:41:06 Active Directory PT: arg-object(token-xpath("writetolog:new()"))
09:41:06 Active Directory PT: token-xpath("writetolog:new()")
09:41:06 Active Directory PT: Action:
do-set-local-variable("logwriten",token-xpath("writetolog:write($callLogWriter,$log_text,$ log_file)")).
09:41:06 Active Directory PT:
arg-string(token-xpath("writetolog:write($callLogWriter,$log_text,$ log_file)"))
09:41:06 Active Directory PT:
token-xpath("writetolog:write($callLogWriter,$log_text,$ log_file)")
09:41:06 Active Directory PT:
DirXML Log Event -------------------
Driver: NDS2ADDCPIDMNDS2AD_DriverSetActive Directory
Channel: Publisher
Status: Error
Message: Code(-9131) Error in
vnd.nds.stream://NDS2AD/DCP/IDM/NDS2AD_DriverSet/Active
Directory/Publisher/Groups and Users#XmlData:36 : Error evaluating XPATH
expression
'token-xpath("writetolog:write($callLogWriter,$log_text,$ log_file)")' :
com.novell.xml.xpath.XPathEvaluationException: No extension function found
for 'writetolog:write($callLogWriter,$log_text,$log_fi le)'.

This is the rule:

<?xml version="1.0" encoding="UTF-8"?><policy
xmlns:writetolog="http://www.novell.com/nxsl/java/LogWriterIDM">
<description>Use the LogWriterIDM.jar to write daily logs out to file.
Send email notifications and remove association of deleted
objects</description>
<rule>
<description>Notify</description>
<conditions>
<or>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-class-name mode="nocase" op="equal">Group</if-class-name>
</or>
</conditions>
<actions>
<do-set-local-variable name="log_text">
<arg-string>
<token-text xml:space="preserve">'</token-text>
<token-class-name/>
<token-text xml:space="preserve"> </token-text>
<token-src-dn/>
<token-text xml:space="preserve"> </token-text>
<token-operation/>
<token-text xml:space="preserve">ed in Active Directory'</token-text>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="log_file">
<arg-string>
<token-global-variable name="TextLogLocation"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="callLogWriter">
<arg-object>
<token-xpath expression="writetolog:new()"/>
</arg-object>
</do-set-local-variable>
<do-set-local-variable name="logwriten">
<arg-string>
<token-xpath
expression="writetolog:write($callLogWriter,$log_t ext,$log_file)"/>
</arg-string>
</do-set-local-variable>
<do-send-email id="Security@company.com.au" server="10.10.1.14"
type="text">
<arg-string name="to">
<token-text xml:space="preserve">IMSS_mgr@company.com.au</token-text>
</arg-string>
<arg-string name="subject">
<token-local-variable name="log_text"/>
</arg-string>
<arg-string name="message">
<token-src-dn/>
<token-text xml:space="preserve"> was </token-text>
<token-operation/>
<token-text xml:space="preserve">ed from Active Directory. This may
require the manual modification of the coresponding eDirectory object or
rolling back the change in Active Directory.

This message is system generated. Do not reply or send emails to this
address.</token-text>
</arg-string>
</do-send-email>
</actions>
</rule>
<rule>
<description>Change Delete to Remove Association</description>
<conditions>
<and>
<if-association op="available"/>
<if-operation op="equal">delete</if-operation>
</and>
</conditions>
<actions>
<do-remove-association direct="true">
<arg-association>
<token-association/>
</arg-association>
</do-remove-association>
</actions>
</rule>
</policy>


This is the java code:

/************************************************** *****************************
* Fujitsu: LogWriterIDM.java, v1.0 25/06/2007
*
* Author: Leslie Nagy
*
* Description: Takes text from arguments and writes to specified log
file.
* The log rolls forward each day to a new file. Designed to
* be called from IDM.
*
* Useage: java LogWriterIDM:write text_to_write log_file
* java LogWriterIDM:write text_to_write result_file
debug_log_file - to enable debug log
* java LogWriterIDM help - to show help information
* (current_date.log will be appended to result_file name
supplied.
* enclose text in quotes if space or special characters are
used.)
*
* Dependencies: none
*
************************************************** ****************************/

import java.io.*;
import java.util.*;

public class LogWriterIDM {
// Define class variables
private static boolean debug = false;
private static PrintWriter debugLog = null;
private static PrintWriter result = null;
private static String ResultFile = null;

public static void main(String[] arg) {
help();
}
public static String write(String[] args) {
// Test arguments
if ((args.length < 2) || (args[0].equalsIgnoreCase("help")) ||
(args[0].equalsIgnoreCase("/h"))){
help();
} else {
try {
// Define local variables
File inDir = null;
String OutFile = null, dateNow = null, timeNow = null;
String dateCurrent = null, DATE_FORMAT = null;

// Initialise class variables
ResultFile = args[1];

// Main code begins

// Get current date & time
DATE_FORMAT = "ddMMyyyy";
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
java.text.SimpleDateFormat sdf = new
java.text.SimpleDateFormat(DATE_FORMAT);
sdf.setTimeZone(TimeZone.getDefault());
dateCurrent = sdf.format(cal.getTime());
dateNow = dateCurrent;
DATE_FORMAT = "HH:mm";
sdf = new java.text.SimpleDateFormat(DATE_FORMAT);
sdf.setTimeZone(TimeZone.getDefault());
dateCurrent = sdf.format(cal.getTime());
timeNow = dateCurrent;

ResultFile = ResultFile + dateNow + ".log";

// Check for debug
if (args.length == 3){
debug = true;
OutFile = args[2];
debugLog = new PrintWriter(new BufferedWriter(new
FileWriter(OutFile)));
debugLog.println("Debug log file for
LogWriterIDM.java");
debugLog.println("");
debugLog.println(dateNow + " " + timeNow);
debugLog.println("");
debugLog.println("Log text: " + args[0]);
debugLog.println("Log file: " + args[1]);
debugLog.println("");
}
// Create or append to log file
result = new PrintWriter(new BufferedWriter(new
FileWriter(ResultFile, true)));
result.println(dateNow + "," + timeNow + "," + args[0]);

// Check for debug
if (debug){
debugLog.println("Process completed. Text written.");
debugLog.println("");
debugLog.close();
System.out.println("Log entry written to " +
ResultFile);
System.out.println("Debug file " + OutFile);
}
result.close();
// Main code ends
}
catch(Exception e) {
if (debug){
try {
debugLog.println("A Problem occured in WRITE
method.");
debugLog.println("Error: " + e);
debugLog.close();
}
catch(Exception e1) { //debugLog not open, disregard
}
}
System.out.println("");
System.out.println("");
System.out.println("A Problem occured in WRITE method.");
System.out.println("");
System.out.println("Error: " + e);
help();
try {
result.close();
}
catch(Exception e2) { //result not open, disregard
}
}
}
// Return a result for IDM
return ResultFile;
}
public static String help() {
System.out.println("");
System.out.println("LOGWRITERIDM.JAVA HELP");
System.out.println("v1.0 25/06/2007");
System.out.println("");
System.out.println("Description:");
System.out.println("");
System.out.println("Takes text from arguments and writes to
specified log file.");
System.out.println("The log rolls forward each day to a new file.
Designed to");
System.out.println("be called from IDM.");
System.out.println("");
System.out.println("");
System.out.println("Useage:");
System.out.println("");
System.out.println("java LogWriterIDM:writer text_to_write
log_file.");
System.out.println("java LogWriterIDM:writer text_to_write
log_file debug_log_file - to enable log.");
System.out.println("java LogWriterIDM:writer help - to show help
information.");
System.out.println("(current_date.log will be appended to
result_file name supplied.");
System.out.println("enclose text in quotes if space or special
characters are used.)");
System.out.println("");
return "Call to Help";
}
}