Hi ,
We are trying to load the java class into Oracle which does the translation using the Bing API. Here, while using the LoadJava utility, we are specifying the java class which contains the translation code and the Jars which is used by this class.
There was no error while running this command and the Java Class type is in VALID status, but while we are running the function we are getting the below error,
Error : ORA-29531: no method translator in class BingTranslator
Can anyone help to resolve this issue. I have posted the code used below,
Java Code:
import com.memetix.mst.language.Language;
import com.memetix.mst.translate.Translate;
public class BingTranslator {
public String translator(String clientID, String clientValue,String value) throws Exception{
Translate.setClientId(clientID);
Translate.setClientSecret(clientValue);
String outValue = Translate.execute(value, Language.AUTO_DETECT, Language.ENGLISH);
return outValue;
}
}
Load Java:
loadjava -u username/password -v -resolve microsoft-translator-java-api-0.6.2.jar microsoft-translator-java-api-0.6.2-jar-with-dependencies.jar BingTranslator.java
Function:
CREATE OR REPLACE FUNCTION FN_translate (clientID VARCHAR2,clientValue VARCHAR2,value VARCHAR2)
RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'BingTranslator.translator(java.lang.String, java.lang.String, java.lang.String) return java.lang.String';