Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.lang.reflect.InvocationTargetException[JavaClassFunctionComponent]

419 views
Skip to first unread message

Manigandan Jegannathan

unread,
Jul 24, 2013, 8:06:09 AM7/24/13
to
Hello All,

I have a jar file which has two class files in it. One among the two java class invokes another one.

Its working and throws the output correctly from Eclipse as a java project.

When i use this as jar in TDI using JavaClassFC it throws below exception

[JavaClassFunctionComponent] CTGDIS810E handleException - cannot handle exception , functioncall
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor441.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at com.ibm.di.fc.JavaClassFC.perform(JavaClassFC.java:208)
at com.ibm.di.server.AssemblyLineComponent.executeOperation(AssemblyLineComponent.java:3175)
at com.ibm.di.server.FunctionComponent.callreply(FunctionComponent.java:303)
at com.ibm.di.server.AssemblyLine.msExecuteNextConnector(AssemblyLine.java:3696)
at com.ibm.di.server.AssemblyLine.executeMainStep(AssemblyLine.java:3308)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2944)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2927)
at com.ibm.di.server.AssemblyLine.executeAL(AssemblyLine.java:2896)
at com.ibm.di.server.AssemblyLine.run(AssemblyLine.java:1296)
Caused by: java.lang.NoClassDefFoundError: A****oolkit$MyT**tManager
at A**SqlToolkit.init(AxlSqlToolkit.java:49)
at A**SqlToolkit.execute(AxlSqlToolkit.java:176)
... 12 more.


I tried adding the jar file TDI_HOME/jars/3rdparty/others. but it didnt work.

Eddie Hartman

unread,
Jul 24, 2013, 9:47:06 AM7/24/13
to
Could you share how you are instantiating the class(es) and calling methods?

-Eddie

Manigandan Jegannathan

unread,
Jul 25, 2013, 3:57:01 AM7/25/13
to

Hello Eddie,

Now i have optimized my java project into single java class. This time i get different exception.

This is how i scripted javaclassFC, and the TDI_HOME/solution.props file has
com.ibm.di.loader.userjars=C:\jars


var usrEntry=system.newEntry();
var fc = system.getFunction("ibmdi.JavaClassFC");

fc.setParam("jarFile","C:\\jars\\C***anager.jar");
fc.setParam("javaClass","A****it");
fc.setParam("method","java.lang.String execute(java.lang.String p1, java.lang.String p2, java.lang.String p3, java.lang.String p4, java.lang.String p5)");
fc.initialize(null);


usrEntry.setAttribute("p1","s*************007'");
usrEntry.setAttribute("p2","8****3");
usrEntry.setAttribute("p3","17*****6");
usrEntry.setAttribute("p4","c***n");
usrEntry.setAttribute("p5","c*****in1");

task.logmsg("DEBUG",conn.value);
fc.perform(usrEntry);




Error i am getting,

[Script] CTGDIS809E handleException - cannot handle exception , script
java.lang.Exception: CTGDJJ003E Unable to locate the method 'java.lang.String execute(java.lang.String p1, java.lang.String p2, java.lang.String p3, java.lang.String p4, java.lang.String p5)' in class 'A***lkit'.
at java.lang.Throwable.<init>(Throwable.java:67)
at com.ibm.di.fc.JavaClassFC.initialize(JavaClassFC.java:100)
at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:298)
at com.ibm.jscript.types.FBSObject.call(FBSObject.java:153)
at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:151)
at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java)
at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:399)
at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:249)
at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:236)
at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:239)
at com.ibm.jscript.JSInterpreter.interpret(JSInterpreter.java:53)
at com.ibm.di.script.ScriptEngine.interpret(ScriptEngine.java:903)
at com.ibm.di.script.ScriptEngine.interpret(ScriptEngine.java:887)
at com.ibm.di.server.ScriptComponent.add1(ScriptComponent.java:244)
at com.ibm.di.server.ScriptComponent.add(ScriptComponent.java:210)
at com.ibm.di.server.AssemblyLine.msExecuteNextConnector(AssemblyLine.java:3677)

Manigandan Jegannathan

unread,
Aug 1, 2013, 3:31:19 AM8/1/13
to
Hello Eddie,

I figured it out. I was forced to change few java lines. java class FC throws exception with line number, so i went back modified the project. But now i have to figure it out why the below error is coming,

To be clear my eclipse project is doing certificate validation(using X509TrustManager), it works fine with eclipse. but TDI didn't....

Any help??

com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2961)
at com.ibm.di.server.AssemblyLine.executeAL(AssemblyLine.java:2930)
at com.ibm.di.server.AssemblyLine.run(AssemblyLine.java:1319)
Caused by: javax.xml.soap.SOAPException: hostname in certificate didn't match: <172.x.x.136> != <nwxx**cm>
at org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:184)
at AxlSqlToolkit.sendMessage(Ax####oolkit.java:133)
at AxlSqlToolkit.getDirectoryNumber(Ax#####oolkit.java:111)
... 13 more
Caused by: org.apache.axis2.AxisFault: hostname in certificate didn't match: <172.28.70.136> != <nwkXXXXm>
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(C

rena...@gmail.com

unread,
Jan 30, 2014, 9:41:04 AM1/30/14
to
hey man how did you fix the first error ?
Which way did you change yous java class ?

Manigandan Jegannathan

unread,
Feb 23, 2014, 12:24:50 AM2/23/14
to
On Thursday, 30 January 2014 20:11:04 UTC+5:30, rena...@gmail.com wrote:
> hey man how did you fix the first error ?
>
> Which way did you change yous java class ?

Hi rena,

You do not need to change your java class to make it run in TDI. Only thing you need to concern is how you use TDI Java FC and how you initiate it.

* verify whether TDI correctly invoking your jar
* if your jar program compiled and executed correctly then it must work in TDI. make sure you added the needed certificate if your program makes any ssl communication.

if it didn't help you, please share your TDI exception, we have TDI experts here they could help you. i found this forumn very helpfull.
0 new messages