[Go to site: main page, start]

0% found this document useful (0 votes)
29 views9 pages

Debugging jBC and Java in Eclipse

This document provides a step-by-step guide on how to debug jBC and the L3 API simultaneously using an Eclipse environment set up with two distinct projects. It outlines the process of creating hooks in components, implementing Java APIs, modifying T24, and configuring the jBoss server for debugging. Additionally, it explains how to set up debugging configurations in Eclipse for both Java and jBC applications.

Uploaded by

amazeinnovate
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views9 pages

Debugging jBC and Java in Eclipse

This document provides a step-by-step guide on how to debug jBC and the L3 API simultaneously using an Eclipse environment set up with two distinct projects. It outlines the process of creating hooks in components, implementing Java APIs, modifying T24, and configuring the jBoss server for debugging. Additionally, it explains how to set up debugging configurations in Eclipse for both Java and jBC applications.

Uploaded by

amazeinnovate
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

L3 API Debugging Java & jBC

V. 1.1

This document will explain how to debug jBC and the L3 API at the same time.
Note that both are not related and you could debug java only or jBC only.

Demo Environement for the document

In order to be as focused on the subjact as possible, we created a Eclipse environment with 2 distincts
project :

1) “generic” project called DebugDemojBC


2) “java” project called DebugDemoJava

In the DebugDemojBC we have the full component [Link].


The project has been toggleled in TAFJ Nature and we are referencing all the Precompile Jars of T24 as
some Inser files are reuired. Also, a Dunce Cap has been put on the directory as the development rules are
not respected in this component.

The java Project is initially empty.

Also, we have a fully running UTP Environment (jBoss & H2)

Here is a snapshot of the initial environment :


1) Create a Exist point (hook) in ST_CurrencyConfig components
Edit [Link] and add a method pointing to a java implementation like this :
public method doSomeJava : string (
INOUT aParam string
)
{
javaClass: [Link]
}

2) Implement the java API


Position your cursor on the “[Link]”, right-click → Component Framework → Implement
Method …
You will be prompted for a Project. Choose “DebugDemoJava”
This will automatically create the java source file and fill it with the correct definition like this :

Implement it like this :


public String doSomeJava(TString aParam){
return "Modified " + aParam;
}
3) Modify T24 to call the doSomeJava(…) method.
Open CURRENCY.b, locate the label [Link]: and add the hook like this :

[Link]:
******************

MAT F = "" ; MAT N = "" ; MAT T = "" ; ID.T = ""


MAT CHECKFILE = "" ; MAT CONCATFILE = ""
[Link] = "" ; [Link] = ""
*========================================================================
REM "DEFINE PARAMETERS - SEE 'I_RULES'-DESCRIPTION:
* FIELD DEFINITIONS FOR CURRENCY
*
ID.F = '[Link]'
ID.N = '003.3'
ID.T<1> = 'CCY'
[Link] = 'AL'
[Link] = '[Link]':FM:[Link]:FM:'L.A'
*

[Link] = [Link]("RANK")

Z = 0
Z+=1 ; F(Z) = [Link] ; N(Z) = '03'

4) Build and deploy in app server


Right-click ST_CurrencyConfig.component and do a “Build Component”
Everything should be all right. Copy the resulting jar (in
tafj_home/data/DebugDemojBC/jars/ST_CurrencyConfig.jar in your app server in place of the old one
Also, deploy your java API. For that, you can jar it using eclipse (export → jar) copy it somewhere in the
app server and edit the [Link], or, easier, simply edit the [Link] of T24 to add the path of the
classes of the java project which should be (<your workspace>/DebugDemoJava/bin)

Example :
5) Edit your jBoss startup script
All Right, now we will edit the launch configuration of jBoss to let the app server know that we want to
debug.

Locate your startup script ([Link]) of the app server and edit it.
Add some JAVA_OPTS as well as a -[Link] option like this :

...
ECHO URL is: %URL%
@ECHO # Starting H2 Server
START java -server -Xmx2048M -cp .\[Link];%TAFJ_HOME%\dbscripts\h2\
[Link] [Link] -tcp -tcpAllowOthers -baseDir %H2_HOME% >
%LOG_HOME%\[Link] 2>&1
@ECHO # Starting H2 Shell
START java -server -Xmx32M -cp [Link];%TAFJ_HOME%\dbscripts\h2\
[Link] [Link] -url %URL% -driver [Link] -user t24 -
password t24
@ECHO "---------------------------------"
CD %JBOSS_HOME%\bin
SET JAVA_OPTS=-Xms2G -Xmx6G -[Link]=UTF-8

SET JAVA_OPTS= -Xdebug -Xnoagent -


Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Xms4G -Xmx10G
%JAVA_OPTS%

CALL [Link] --server-config=[Link] -[Link]=10314 -


[Link]=9089 -[Link]=node1 -b [Link]
-[Link]=%MANUAL%/edge,%GENERATED%/edge
-Doverride.IRIS_MAP=%MANUAL%/edge/data/[Link],%GENERATED%/edge/
data/[Link] -[Link]=%GENERATED%/iris -
[Link]=600 -
[Link]=N
-Doverride.SLANG_FOLDERS=%MANUAL%/edge/data/slang/manual,%GENERATED%/edge/data/slang/
generated,$$PROJECTHOME$/WEB-INF/data/slang/default

The JAVA_OPTS tells jboss to be in debug for java


The [Link] tells jBoss to be in debug for jBC (see document [Link])
You can also refer to internet : [Link]

All done, you can start your jBoss.


6) Create Debuggers in Eclipse

Now get back to your eclipse environment, and create 2 debugger (one for java and one for jBC) :

For java :
Create a new Remote Java Application debug configuration like this :

And launch it (“DEBUG”)


For jBC, same approach create a new JBC Remote launch configuration like this :

And launch it (“DEBUG”)

Put some breakPoints in your jBC as well as java code :


Now Launch the browser and run CURRENCY S USD
First breakPoint (jBC) :

Press F8, Second BreakPoint (Java) :

Add a breakPoint on the flight in jBC then press F8 :


7) Debugging EX (no app server)
If you want to be able to debug both in java and jBC in eclipse (launching EX), the approach is the same.
One important thing is to let your jBC project know whare are your java classes (or jar). For that, add a path
to your precompile like this (this is a little bit the same as editing the [Link] for an app server (see
point 4)
Properties of your DebugDemojBC project → TAFJ → Path

Then, create a new launch configuration for a normal jBC Program like this :

Note the VM Option (which are the same as what you added in your app server launcher) and the Eclipse
Console ticked.

Press Debug.
Then, launch your DebugDemojava as described in point 6

You might also like