Hi all, I want to use a custom Java class, but when I call it, the
driver can not find it

Message: Code(-9131) Error in
vnd.nds.stream://TREE/desrsi/services/Driverset/IDM+Desarrollo+Notes+Creacion5/Subscriber/Jclass#XmlData:15
:Error evaluating XPATH expression
'token-xpath("cjava:Normalizar($jnombre)")' :
com.novell.xml.xpath.XPathEvaluationException: function
'cjava:Normalizar' not found.


This is the policy.

Code:
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<policy xmlns:cjava="http://www.novell.com/nxsl/java/rsi.normalizar.Normalizador">
<rule>
<description>JAVA CLASS</description>
<conditions>
<and/>
</conditions>
<actions>
<do-set-local-variable name="jvalor" scope="policy">
<arg-string>
<token-xpath expression="cjava:Normalizar($jnombre)"/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">### </token-text>
<token-local-variable name="jvalor"/>
<token-text xml:space="preserve"> ###</token-text>
</arg-string>
</do-trace-message>
</actions>
</rule>
--------------------



This is the Java class
(/opt/novell/eDirectory/lib/dirxml/classes/normalizar.jar)



Code:
--------------------
package com.rsi.normalizar;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.Normalizer;
import java.util.regex.Pattern;



public class Normalizador {
static String s;

public static String Normalizar(String cadena){
cadena=cadena.toLowerCase();
char[] caracteres = cadena.toCharArray();
caracteres[0]=Character.toUpperCase(caracteres[0]);
for (int i=0;i<cadena.length() -2 ;i++){
if(caracteres[i]==' '||caracteres[i]=='.'||caracteres[i]==',')
caracteres[i+1]=Character.toUpperCase(caracteres[i+1]);
}
String cad=new String(caracteres);
return cad;
}
}
--------------------

What's wrong?
Thanks in advance


--
kiekurt
------------------------------------------------------------------------
kiekurt's Profile: https://forums.netiq.com/member.php?userid=1394
View this thread: https://forums.netiq.com/showthread.php?t=49372