Page 1 of 1

Run a Java program from TI process using ExecuteJavaN

Posted: Mon May 01, 2017 8:38 am
by mmmreddy1
HI, I have been trying to run a java program through TI process using ExecuteJavaN/ExecuteJavaS.

I have followed all the points from IBM Knowledge center in configuring Java Extensions and rules to use ExcuteJavaN/ExecuteJavaS. My bad luck java program runs fine to my need in eclipse while i call ExecuteJavaN from TI. I am getting an error stating Java Exception:Java.lang.ClassNotFoundException: my.scripts.MyTestTI.

My Epilog command given:
ExecuteJavaN('my.scripts.MyTestTI');

Can someone please help me solving this problem.

Thanks & Regards
Mohan

Re: Run a Java program from TI process using ExecuteJavaN

Posted: Mon May 01, 2017 11:01 pm
by failurehappening
Hi Mohan

It's going to be difficult for anyone to debug why your java app is returning that error if you don't put any of the java code in the post. Can I suggest having a read through http://www.tm1forum.com/viewtopic.php?f=3&t=1037 and then post the actual code in your class that you're calling.

It needs to be the actual code as the problem is probably something to do with your naming or class definition

Re: Run a Java program from TI process using ExecuteJavaN

Posted: Wed May 03, 2017 5:21 am
by mmmreddy1
Hi failurehappening,
Thanks for the reply. My code wasn't difficult it's just an simple test code from the IBM.Here is the code below please check it
package my.scripts;

import com.ibm.cognos.tm1.javati.TM1UserThread;
import com.ibm.cognos.tm1.javati.ti.TIFunctions;

public class MyTestTI {
public static double MyTestTI(String[] args) {
TIFunctions ti = TM1UserThread.getTIFunctions();
if (args.length < 1) {
throw new IllegalArgumentException();
}
String dim = args[0];
if (ti.DimensionExists(dim)) {
ti.DimensionDeleteAllElements(dim);
} else {
ti.DimensionCreate(dim);
}
return 0;
}
}
Thanks

Re: Run a Java program from TI process using ExecuteJavaN

Posted: Wed May 03, 2017 1:38 pm
by Michel Zijlema
Hi Mohan,

Have a look at the javaextensions.policy file in TM1-install-dir\configuration directory and make sure the grant permissions are set correctly.
See details here.

Michel