Problem during acceesing the function created on the top of the JAR file installed on the database

Tools
Enthusiast

Problem during acceesing the function created on the top of the JAR file installed on the database

Hi Tom,

We are in process of creating a Java user defined Function and in order to achieve that  we have deployed the JAR File in the database and

 creating a function/procedure on the top of it  using the below two approaches :

Approach 1) Using the Teradata JUDF wizard Plug -ins in the eclipse  as per below steps:

     a) Installed the teradata plug-ins in eclipse as per the below instructions:


     b)  Created the Teradata Project and imported the Java libraries ,java source code as per the steps in Teradata JUDF Wizard.

          Setting up the Input and Output parameters of the function, as per the instructions :


     c) Deployed the JAR file and Generated SQL for the Function in the database 

JAR File gets deployed and function gets created in database but while executing the function resulting in to error:

[3604] Cannot place a NULL into NOT NULL field 

Note :Things to consider that the Java source is existing in production and working fine with no issues and returns results while running through 

the ECLIPSE ( Run --> Run Configurations (mentioning the Arguments)and by clicking on the Run , output gets displayed with no issues.


Approach 2)  Deploying using the Teradata External stored procedures -

placed the jar file at this path and invloking the bteq session:

C:\Program Files (x86)\Java\jdk1.8.0_73\bin>bteq

Teradata BTEQ 15.10.01.00 for WIN32. PID: 4736

Copyright 1984-2015, Teradata Corporation. ALL RIGHTS RESERVED.

Enter your logon or BTEQ command:

 

CALL SQLJ.INSTALL_JAR(‘CJ!jar1.jar’, ‘jar1’, 0);

JAR files gets successfully deployed but problem comes during creating a External procedure on the top of it 

DATABASE syslib;

CREATE PROCEDURE myjxsp1

( INOUT R INTEGER )

LANGUAGE JAVA NO SQL

PARAMETER STYLE JAVA

EXTERNAL NAME 'jar1:test.Main.class.myjxsp1';    --> test is the name of the package in the Java manifest file  and main is the class .

*** Failure 7980 A JAVA method in the specified Jar which matches that in t

he EXTERNAL NAME clause was not found/etc/opt/teradata/tdconfig/jarlib/tdbs_1

001/jarlib_1001_510889_1.jar.

                Statement# 1, Info =0

*** Total elapsed time was 2 seconds.

Looks like its referring to the different path . can you suggest on how to resolve this?

Regards,

nishant

Tags (4)
1 REPLY
Teradata Employee

Re: Problem during acceesing the function created on the top of the JAR file installed on the database

It's hard to diagnose your problem without seeing all the pieces, including the Java source code for the Java stored procedure.

My initial reaction is that this line looks incorrect: EXTERNAL NAME 'jar1:test.Main.class.myjxsp1';

I would not expect to see .class in that literal, because the syntax is 'JarName:PackageName.ClassName.MethodName' (and note that PackageName can contain dots itself).

You might want to try removing the .class to like this: EXTERNAL NAME 'jar1:test.Main.myjxsp1';