Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] Calling a java class from a stored procedure.
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Calling a java class from a stored procedure.
 Login/Join
 
Silver Member
posted
Hi,

I am trying to call a java class from a stored procedure and am getting the below listed error.

InvocationTargetException: ibi.ntj2c.ntjprerr: CALLPGM execution
error CPJAVA: Error in processing EXECUTE command for class MyClass

Looking into the documentation I see that the above error may be due to classpath issues. I have
set my class to include the jar files for the ntj2c.jar, ibtrace.jar, and the jar file that holds
the MyClass class. This was verified by going into the console and seeing the classpath entries
listed in the Java Services Configuration area. At this point it looks like I have things set
up correctly.

Here is the code within the stored procedure...

CALLJAVA mypackage.MyClass " ", " ", " "
-EXIT


Somewhere there is a disconnect and I am not sure where that is.

Also, in the examples in the documentation, the cjsamp class is implementing the callpgm class.
Is this required for all java classes call by a stored procesdure with the DM tool?

Any information anyone can provide will be appreciated.

Thank you in advance.

Tom

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.7
Linux
csv/.txt, pdf, Excel
 
Posts: 31 | Registered: June 01, 2009Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Tom,

The following document may be of help:
Running CALLJAVA produces FOC1522 InvocationTargetException

If this does not work for you, then you may want to open a case with Information Builders' Customer Support Services for assistance, as this issue can be more involved and will need further research. The phone number is 1-800-736-6130, or access online at InfoResponse.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1950 | Location: New York | Registered: November 16, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
Hi Kerry,

I had actually started with the documentation you provided a link for before posting to this
forum. With my not getting any success from following that information and trying a few
other things, I ended up opening up a ticket with IBI last week.

Thanks for your follow up just the same.

Tom


WebFOCUS 7.6.7
Linux
csv/.txt, pdf, Excel
 
Posts: 31 | Registered: June 01, 2009Reply With QuoteReport This Post
Member
posted Hide Post
You can call the java class :
wf installed on windows :
DOS JAVA PACKAGE.MYCLASS "PARAM1","PARAM2"
wf installed on unix:
UNIX JAVA PACKAGE.MYCLASS "PARAM1","PARAM2"

Regards,
MtGuy


WF 7.6.2 , iWay 5.5 , Sun Unix , Windows XP , .NET , Oracle , SQL Server and more
 
Posts: 24 | Registered: December 05, 2007Reply With QuoteReport This Post
Silver Member
posted Hide Post
Hi mtguy,

I did give that a try with no success. There is somthing missing that I cannot put my finger on.

As listed in my initial entry, the package name and class name are included in the call statement and with this in mind, the syntax looks correct.

Plus the classpath is all set and I can run the class from DOS using the 'java -jar ...' command.

One note though and not sure if this matters. The jar file is located in a directory completely outside of the DM directory structure. I am thinking that this should not matter but will mention it just the same.

Thanks for your input just the same.

Tom


WebFOCUS 7.6.7
Linux
csv/.txt, pdf, Excel
 
Posts: 31 | Registered: June 01, 2009Reply With QuoteReport This Post
Member
posted Hide Post
Hi,
Put the CLASSPATH set statement in a bat file ,
run this bat file before DOS java -jr .


Regards,
MtGUY


WF 7.6.2 , iWay 5.5 , Sun Unix , Windows XP , .NET , Oracle , SQL Server and more
 
Posts: 24 | Registered: December 05, 2007Reply With QuoteReport This Post
Silver Member
posted Hide Post
Hi mtguy,

I did that and it worked. Thank you for your help on this.

Have a great day!

Regards,

Tom

This issue is closed.


WebFOCUS 7.6.7
Linux
csv/.txt, pdf, Excel
 
Posts: 31 | Registered: June 01, 2009Reply With QuoteReport This Post
Member
posted Hide Post
I know is working because I had some issue long time ago .

Enjoy ,
MtGuy


WF 7.6.2 , iWay 5.5 , Sun Unix , Windows XP , .NET , Oracle , SQL Server and more
 
Posts: 24 | Registered: December 05, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] Calling a java class from a stored procedure.

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.