Run a Java program from TI process using ExecuteJavaN

Post Reply
mmmreddy1
Posts: 3
Joined: Mon Apr 17, 2017 2:58 pm
OLAP Product: SQL SERVER 2012
Version: 10.2.2
Excel Version: 2007

Run a Java program from TI process using ExecuteJavaN

Post 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
Attachments
error in JAVA TI.png
error in JAVA TI.png (23.76 KiB) Viewed 5831 times
failurehappening
Posts: 78
Joined: Tue Nov 30, 2010 1:18 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Run a Java program from TI process using ExecuteJavaN

Post 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
RHR
mmmreddy1
Posts: 3
Joined: Mon Apr 17, 2017 2:58 pm
OLAP Product: SQL SERVER 2012
Version: 10.2.2
Excel Version: 2007

Re: Run a Java program from TI process using ExecuteJavaN

Post 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
User avatar
Michel Zijlema
Site Admin
Posts: 712
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: Run a Java program from TI process using ExecuteJavaN

Post 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
Post Reply