Forum
Keyword
× Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...

CALLJ

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 created the topic: CALLJ

is there a precise path I need to place my java classes for it to be read inT24, and how do I use CALLJ?
#19026

Please Log in or Create an account to join the conversation.

  • Posts: 2836
  • Karma: 509
  • Thank you received: 637

jpb replied the topic: CALLJ

For how to use CALLJ --> jbc.temenos.com/pages/callj.html
The path must be defined in your CLASSPATH, other setting are mentioned in the above article as well.

Some people feel the rain - others just get wet (Bob Marley)
#19031

Please Log in or Create an account to join the conversation.

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 replied the topic: CALLJ

Where do I specify my JVM using linux? when i run an infobasic subroutine using CALLJ, I get an error that the JVM is missing. how do I resolve this? as well as were do I specify my java class?
#19033

Please Log in or Create an account to join the conversation.

  • Posts: 94
  • Karma: 2
  • Thank you received: 6

MasterL replied the topic: CALLJ

Short answer:

a) Make sure jdk is set in your machine. You can test by doing a simple java -version test.
~ -->java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

You can choose the systemwide jdk setting or override it in the .profile.

b) For the classpath, add the path to your java jar file in the .profile.

Long Answer:

We are going to use this sample Java code. I'm using Eclipse IDE
package com.mycallj.example;

public class CallJTest {

	public static String ReturnName(String name) {
		// TODO Auto-generated method stub
		String response = "My name is " + name;
		return response;
	}

}

- Export the package as a jar file from your ide.

- Move (or FTP) the generated jar file to a folder in T24. I'm going to use the folder called jars in bnk.run, where I created my own folder called calljtest

The full path containing the jar file is now
/t24/bnk/bnk.run/jars/calljtest

Edit the .profile to include the new jar file in your classpath using
~ -->JED .profile

You will find a bunch of other classpath settings. Append yours like this:
export CLASSPATH=$CLASSPATH:$HOME/jars/calljtest/CallJTest.jar

Your classpath should now look something like this (I've picked the last few. List will vary with T24 environment)
0098 export CLASSPATH=$CLASSPATH:$HOME/tagnotification/webservices-tools-1.1.jar
0099 export CLASSPATH=$CLASSPATH:$HOME/tagnotification/tag-notifications-3.1-DEV.jar
0100 export CLASSPATH=$CLASSPATH:$HOME/jars/calljtest/CallJTest.jar
0101 export JBCJVMOPT1=-server

Now for the T24/Jbase part.
PROGRAM TEST.CALLJ                                                                            
                                                                                                  
    $INSERT T24.BP I_COMMON                                                                       
    $INSERT T24.BP I_EQUATE                                                                       
                                                                                                  
    className = "com.mycallj.example.CallJTest"     ;* Give the full classname, i.e. including the package name
    methodName = "$ReturnName"                                                                    
    PRINT "Enter Name ": ; INPUT param                                                            
                                                                                                  
    CALLJ className,methodName, param SETTING ret ON ERROR                                        
        err = SYSTEM(0)                                                                           
        CRT err     ;* There is a better way to handle the errors - use GOSUB errorHandler        
        RETURN                                                                                    
    END                                                                                           
    PRINT ret                                                                                                                                
END                                                                                              

Remember to prepend the methodname variable with '$' for static methods.

Compile the routine, log out and log back in. Test your routine.
jsh ~ -->TEST.CALLJ
Enter Name ?King Kong
My name is King Kong

All the best
#19036

Please Log in or Create an account to join the conversation.

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 replied the topic: CALLJ

Thanks MasterL, I have included my CLASSPATH in .profile, I have also checked to see which java version is running which is
jsh dev ~ -->java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode) .
But, when I try to execute the basic routine I get an error saying "Cannot find the JVM.dll !". How do I specify it in the .profile?
#19046

Please Log in or Create an account to join the conversation.

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 replied the topic: CALLJ

I have sorted out the JVM problem, but even though I specify the CLASSPATH pointing to the directory where the jar file is sitting it still cannot seem to locate my class. Is there anything I need to do rather than specify the CLASSPATH in .profile?
#19075

Please Log in or Create an account to join the conversation.

  • Posts: 94
  • Karma: 2
  • Thank you received: 6

MasterL replied the topic: CALLJ

What error are you getting?
#19280

Please Log in or Create an account to join the conversation.

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 replied the topic: CALLJ

Class deosnt exist
#19282

Please Log in or Create an account to join the conversation.

  • SLUBINDA1
  • SLUBINDA1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0

SLUBINDA1 replied the topic: CALLJ

How do I use CALLJ to execute a jar file rather than a single java class that has been compiled in jsh? I am able to CALLJ single java classes but not jar files.
#20011

Please Log in or Create an account to join the conversation.

  • Posts: 42
  • Thank you received: 1

arslan replied the topic: CALLJ

if you are using TAFC, you you may need to configure more than couple files. One is .profile. define where the jar files are located. Then you will able to run jars on the prompt (only main class methods). then you will be able to use CALLJ however, you need to check if you didnt define below;

#export JREDIR=$JAVA_HOME/jre
#export JRELIB=$JREDIR/lib

#export PATH=$PATH:$JREDIR/bin:$JRELIB
#export JBCJREDIR=$JREDIR
#export JBCJRELIB=$JREDIR/bin:$JRELIB
#export JBCJVMLIB=$JRELIB/amd64/server/libjvm.so

(above lines are commented out in case you might use them with copy/paste)

especially, "JBCJVMLIB=$JRELIB/amd64/server/libjvm.so" is very important since it creates JVM other then you will see either classNotFound error or JVM error

once you are done you will be able to call classes within jar but
- if you are using SSL connection you need to configure your .worker file.
- if you are using browser then stop the jbase_Agent and change the script and add the same setting you have done for the .profile

now you will be able to call any classes with T24.

those are working for TAFC but now trying to figure out TAFJ, it is a bit more tricky.
#21790

Please Log in or Create an account to join the conversation.

Time to create page: 0.156 seconds