For Programmers: Free Programming Magazines  


Home > Archive > Rexx > September 2005 > BsfLoadJava function not in BSF4Rexx for OS/2 ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author BsfLoadJava function not in BSF4Rexx for OS/2 ?
Bruce

2005-09-04, 9:56 pm

Hi Rony,
I have the latest BSF4Rexx (OS/2 BSF4Rexx.dll: 24-08-2005) and jars.
After carefully setting up the environment, the test programs failed
miserably.
I've tracked part of the problem down to the above dll not having
BsfLoadJava
included as a function (!). The Linux & windows dlls do have it.
bsf4rexx-apache-bsf.jar is in the classpath using InnoTek OS/2 Kit for
Java 1.4.2_05.

I've manually loaded BSF4Rexx.dll in OS/2 OBJREXX 6.00 18 May 1999
(eRexxtry.cmd) successfully and tried some of the functions:
BSF -> using bsf("version") -> closes the session !
BsfAttachToTID -> not tested
BsfDropFuncs -> works
BsfGetTID -> not tested
BsfInvokedBy -> 0
BsfLoadFuncs -> works
BsfQueryAllFunctions -> this list
BsfQueryRegisteredFunctions -> this list
BsfVersion -> 254.20050824 org/rexxla/bsf/engines/rexx

Also
Am I missing something fundamental?

Regards Bruce
rony

2005-09-19, 6:59 pm

Hi Bruce,

Well, now being back from a vacation, I can now post my answer in this newsgroupg that I had sent to
you via e-mail. One of your e-mail-addresses was not accepted, on the other one, no answer nor
action was incurred.

Regards,

---rony

------------------------- cut here --------------------------

Hi Bruce,

the first e-mail address didn't make it so I try it this way.

Regards,

---rony


-------- Original Message --------
Subject: Re: BsfLoadJava function not in BSF4Rexx for OS/2 ?
Date: Sat, 17 Sep 2005 17:33:16 +0200
From: Rony G. Flatscher <Rony.Flatscher@wu-wien.ac.at>
To: data2docSAFE@URLfastmail.com.au
References: <432BCAAB.5000400@westnet.com.au>


Hi Bruce,

at the moment I am way off home (on a vacation), so I have no access to
comp.lang.rexx either.

You should be able to run any program on OS2 from the command line by
invoking it via the script "rexxj.cmd" giving the Rexx script as an
argument, e.g. "rexxj testversion.rex". Also all (Object) Rexx scripts
can be invoked from Java as on all other platforms.

Ad "BSFLoadJava()": this is an external Rexx function that is able to
load the JVM by itself, then initializes it to be able to interact with
BSF4Rexx. You can have the same effect by using the "loader" script
"rexxj.cmd" as descrbed above. On OS2 there is one particular problem,
which I simply did not have the time to solve for time restriction
reasons: Warp 4 has Java 1.1.8 and later versions have Java 1.3.x and
now 1.4.x. BSF4Rexx using the IBM version of BSF supports even Java
1.1.8 today, so Warp 4 customers can take full advantage of BSF4Rexx as
well. It seems that in invoking the JVM via the DLL (that's what
BSFLoadJava() would do) there are different calling conventions between
Java 1.1 and 1.3 and higher on OS2, yielding traps at the end of the run
of such programs, which would not seem to be professional. So, to avoid
this, I removed BSFLoadJava(), but would be more than happy, if anyone
in the OS2 community would address this problem. (Up to a year ago I had
a quite elaborate setup of different versions of OS2 and Java going with
them on my desktop PC; but the harddisk broke, and I got a new machine
and have never been able to re-create the different OS2 environments to
test this.)

But let me stress this: no functionality is lost on OS2, but being able
to start the JVM from within Rexx, which is not really necessary as you
can use the "rexxj.cmd" loader script.

Please be so kind and communicate this also wherever answers from me
would be expected/pending (like on comp.lang.rexx).

Hope that helps,

---rony




Bruce wrote:
> Hi Rony,
> I have the latest BSF4Rexx (OS/2 BSF4Rexx.dll: 24-08-2005) and jars.
> After carefully setting up the environment, the test programs failed
> miserably.
> I've tracked part of the problem down to the above dll not having
> BsfLoadJava
> included as a function (!). The Linux & windows dlls do have it.
> bsf4rexx-apache-bsf.jar is in the classpath using InnoTek OS/2 Kit for
> Java 1.4.2_05.
>
> I've manually loaded BSF4Rexx.dll in OS/2 OBJREXX 6.00 18 May 1999
> (eRexxtry.cmd) successfully and tried some of the functions:
> BSF -> using bsf("version") -> closes the session !
> BsfAttachToTID -> not tested
> BsfDropFuncs -> works
> BsfGetTID -> not tested
> BsfInvokedBy -> 0
> BsfLoadFuncs -> works
> BsfQueryAllFunctions -> this list
> BsfQueryRegisteredFunctions -> this list
> BsfVersion -> 254.20050824 org/rexxla/bsf/engines/rexx
>
> Also
> Am I missing something fundamental?
>
> Regards Bruce

BruceR

2005-09-20, 7:03 pm

Hi Rony,
I apologise for not replying promptly. I thought that I would not
disturb you further because you were on vacation. The email address that
was not accepted is supposed to reduce spam by needing to be fixed by a
human before the email is sent. This method might not be such a good idea.

On to the problem:

environment:
set classpath=.\jars\bsf4rexx-apache-bsf.jar;.\jars\bsf4rexx-ibm-bsf.jar;.
set beginlibpath=.\bsf4rexx\bin;D:\JAVA142_05\bin\client

Using rexxj.cmd and:
HelloWorld.rex
HelloWorld.cmd (extension only changed)
HelloWorld.cmd (extension changed and BsfLoadJava commented out)
this is the error log with minor differences:
------------------------------------------------------------------------------------
Unexpected Signal : EXCEPTION_FLT_UNDERFLOW (0xc0000093) occurred at
PC=0x201F2799
Function=[Unknown.]
Library=

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.


Current Java thread:
at java.awt.Font.<clinit>(Font.java:150)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
org.apache.bsf.util.type.TypeConvertorRegistry.class$(TypeConvertorRegistry.java:89)
at
org.apache.bsf.util.type.TypeConvertorRegistry.<init>(TypeConvertorRegistry.java:203)
at org.rexxla.bsf.engines.rexx.RexxAndJava.<init>(RexxAndJava.java:140)
at org.rexxla.bsf.engines.rexx.RexxEngine.initialize(RexxEngine.java:73)
at org.apache.bsf.BSFManager$8.run(BSFManager.java:672)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.bsf.BSFManager.loadScriptingEngine(BSFManager.java:670)
at org.apache.bsf.BSFManager.exec(BSFManager.java:465)
at org.apache.bsf.Main.main(Main.java:152)

Dynamic libraries:
0x2A4F0000 - 0x2A602000
0x2A4E3000 - 0x2A4E3000
0x20370000 - 0x2037D000
0x20340000 - 0x20359000
0x20320000 - 0x2032E000
0x20300000 - 0x20307000
0x201B0000 - 0x202E9000
0x20050000 - 0x20090000
0x2004A000 - 0x2004A000
0x20049000 - 0x20049000
0x20048000 - 0x20048000
0x20047000 - 0x20047000
0x20046000 - 0x20046000
0x20045000 - 0x20045000
0x20044000 - 0x20044000
0x20043000 - 0x20043000
0x20042000 - 0x20042000
0x20041000 - 0x20041000
0x20040000 - 0x20040000
0x2003F000 - 0x2003F000
0x2003E000 - 0x2003E000
0x2003D000 - 0x2003D000
0x2003C000 - 0x2003C000
0x2003B000 - 0x2003B000
0x2003A000 - 0x2003A000
0x20039000 - 0x20039000
0x20038000 - 0x20038000
0x20037000 - 0x20037000
0x20036000 - 0x20036000
0x20035000 - 0x20035000
0x20034000 - 0x20034000
0x20033000 - 0x20033000
0x20032000 - 0x20032000
0x20031000 - 0x20031000
0x16BA1480 - 0x16BA1480
0x16B62900 - 0x16B62900
0x16B60C90 - 0x16B60C90
0x16B717E0 - 0x16B717E0
0x16BA2410 - 0x16BA2410
0x16B72AE0 - 0x16B72AE0
0x16B68880 - 0x16B68880
0x16BA2040 - 0x16BA2040
0x16B9CD60 - 0x16B9CD60
0x16B5CEF0 - 0x16B5CEF0
0x16B60190 - 0x16B60190
0x16B28890 - 0x16B28890
0x16B9B4F0 - 0x16B9B4F0
0x16B6A2F0 - 0x16B6A2F0
0x20030000 - 0x20030000
0x16B68410 - 0x16B68410
0x16B9E500 - 0x16B9E500
0x16B604F0 - 0x16B604F0
0x16B9F710 - 0x16B9F710
0x16B96F70 - 0x16B96F70
0x16B9D160 - 0x16B9D160
0x16B9D630 - 0x16B9D630
0x16B63C90 - 0x16B63C90
0x16B97670 - 0x16B97670
0x16BA1140 - 0x16BA1140
0x16B69F90 - 0x16B69F90
0x16B9D9D0 - 0x16B9D9D0
0x16BA0020 - 0x16BA0020
0x16AF7690 - 0x16AF7690
0x16AE8A30 - 0x16AE8A30
0x16AE66C0 - 0x16AE66C0
0x16AE3B80 - 0x16AE3B80
0x16ACA7D0 - 0x16ACA7D0
0x16AA2AD0 - 0x16AA2AD0
0x00780000 - 0x00780000

Heap at VM Abort:
Heap
def new generation total 576K, used 508K [0x22430000, 0x224d0000,
0x22910000)
eden space 512K, 99% used [0x22430000, 0x224af1d8, 0x224b0000)
from space 64K, 0% used [0x224b0000, 0x224b0000, 0x224c0000)
to space 64K, 0% used [0x224c0000, 0x224c0000, 0x224d0000)
tenured generation total 1408K, used 0K [0x22910000, 0x22a70000,
0x26430000)
the space 1408K, 0% used [0x22910000, 0x22910000, 0x22910200,
0x22a70000)
compacting perm gen total 4096K, used 1472K [0x26430000, 0x26830000,
0x2a430000)
the space 4096K, 35% used [0x26430000, 0x265a0290, 0x265a0400,
0x26830000)

Local Time = Wed Sep 21 02:35:24 2005
Elapsed Time = 2
#
# HotSpot Virtual Machine Error : EXCEPTION_FLT_UNDERFLOW
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)

Using set IBMBSF=1, the stderr gives:

environment variable IBMBSF is defined, hence using: com.ibm.bsf.Main ...
unable to load language: rexx: java.lang.ClassCastException
at com.ibm.bsf.BSFManager.loadScriptingEngine(BSFManager.java:316)
at com.ibm.bsf.BSFManager.exec(BSFManager.java:478)
at com.ibm.bsf.Main.main(Main.java:116)

------------------------------------------------------------------------------------
rony wrote:
> Hi Bruce,
>
> Well, now being back from a vacation, I can now post my answer in this
> newsgroupg that I had sent to you via e-mail. One of your
> e-mail-addresses was not accepted, on the other one, no answer nor
> action was incurred.
>
> Regards,
>
> ---rony
>


Regards, BruceR
data2docSAFEatURLfastmail.com.au (Please modify to reply)
rony

2005-09-20, 7:03 pm

Hi Bruce,

> I apologise for not replying promptly. I thought that I would not
> disturb you further because you were on vacation. The email address that
> was not accepted is supposed to reduce spam by needing to be fixed by a
> human before the email is sent. This method might not be such a good idea.
>
> On to the problem:
>
> environment:
> set classpath=.\jars\bsf4rexx-apache-bsf.jar;.\jars\bsf4rexx-ibm-bsf.jar;.
> set beginlibpath=.\bsf4rexx\bin;D:\JAVA142_05\bin\client


Hmm, you should use either "bsf4rexx-apache-bsf.jar" (Java 1.2 or higher) or "bsf4rexx-ibm-bsf.jar"
(Java 1.1.8).

Then make sure, that Java works, e.g. enter in a command line:

java -version

which should give you the exact Java version.

Then try to run (note, case of the filename containing the Rexx program *does* matter!):

rexxj testVersion.rex

This (if it works) would give you exact version information on the Rexx-interpreter, the
BSF4Rexx.dll and the version of the Java Rexx engine together with the external BSF-related Rexx
functions that are registered.

If this does not work with one of the two pre-assembled BSF-packages, then please try it with the
other BSF-package.

Please come back and report your findings in any case.

Regards,

---rony

rony

2005-09-20, 7:03 pm

Hi Bruce,

FWIW one last note: just tried to run "testVersion.rex" using "rexxji.cmd", where "rexxji" would use
the IBM-BSF-package with eCS 1.2 using Java 1.1.8. Here's the output:

---------------------- cut here ------------------------
[E:\rony\dev\bsf\src\test]java -version
JAVA.EXE version "1.1.8"

[E:\rony\dev\bsf\src\test]..\bin\rexxji testVersion.rex
Rexx interpreter: REXXSAA 4.00 3 Feb 1999
Rexx source: OS/2 SUBROUTINE BSF4Rexx
BSF4Rexx (DLL/so): 254.20050824 org/rexxla/bsf/engines/rexx
Java Rexx engine: 254.20050730 org.rexxla.bsf.engines.rexx (com.ibm.bsf)

Java version: [1.1.8]
Java op-sys infos: [OS/2 (version 20.45, x86)]

Java home dir: [C:\JAVA11\BIN\..]
Java library path: [.NIL]
Java class path: [C:\JAVA11\LIB\SecMa.jar;C:\java11\Swing\swingall.jar;C:\java
11\lib\classes.zip;.\.;C:\OS2\JAVAAPPS\LVMGUI.ZIP;C:\TCPIP\java;C:\PGSQL\JAVA\po
stgresql.jar;;E:\rony\dev\bsf\src;C:\JAVA11\DLL\..\classes;C:\JAVA11\DLL\..\lib\
classes.zip;C:\JAVA11\DLL\..\lib\classes.jar;C:\JAVA11\DLL\..\lib\rt.jar;C:\JAVA
11\DLL\..\lib\i18n.jar;C:\JAVA11\DLL\..\lib\math.jar;C:\JAVA11\DLL\..\lib\rmi-ii
op.jar;C:\JAVA11\DLL\..\lib\jndi.jar;C:\JAVA11\DLL\..\lib\cosnamin.jar;C:\JAVA11
\DLL\..\lib\rmiregis.jar;C:\JAVA11\DLL\..\lib\provutil.jar]

This Rexx script was invoked: via Java

The following BSF-functions are registered with Rexx:
BSF
BsfAttachToTID
BsfGetTID
BsfInvokedBy
BsfQueryAllFunctions
BsfQueryRegisteredFunctions
BsfVersion
---------------------- cut here ------------------------

Maybe that helps you a little bit?

Regards,

---rony


rony wrote:
> Hi Bruce,
>
>
>
> Hmm, you should use either "bsf4rexx-apache-bsf.jar" (Java 1.2 or
> higher) or "bsf4rexx-ibm-bsf.jar" (Java 1.1.8).
>
> Then make sure, that Java works, e.g. enter in a command line:
>
> java -version
>
> which should give you the exact Java version.
>
> Then try to run (note, case of the filename containing the Rexx program
> *does* matter!):
>
> rexxj testVersion.rex
>
> This (if it works) would give you exact version information on the
> Rexx-interpreter, the BSF4Rexx.dll and the version of the Java Rexx
> engine together with the external BSF-related Rexx functions that are
> registered.
>
> If this does not work with one of the two pre-assembled BSF-packages,
> then please try it with the other BSF-package.
>
> Please come back and report your findings in any case.
>
> Regards,
>
> ---rony
>

BruceR

2005-09-22, 7:57 am

rony wrote:

> Hi Bruce,
>
> ...
> Hmm, you should use either "bsf4rexx-apache-bsf.jar" (Java 1.2 or
> higher) or "bsf4rexx-ibm-bsf.jar" (Java 1.1.8).


I tried both, separately

> Then make sure, that Java works, e.g. enter in a command line:
>
> java -version
>
> which should give you the exact Java version.


These are on eComStation 1.1 with fp4:

[rc=0 C:\]java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

[rc=0 C:\]regina -version
REXX-Regina_3.3(MT) 5.00 25 Apr 2004
(*.rex is associated with this)

[rc=0 C:\]rexx -version
REXX-Regina_3.3 5.00 25 Apr 2004

eRexxtry:

parse version ver;say ver
OBJREXX 6.00 18 May 1999

say rxFuncAdd("BsfLoadFuncs", "BSF4Rexx", "BsfLoadFuncs")
0
say BsfLoadFuncs()
0

say bsfVersion()
254.20050824 org/rexxla/bsf/engines/rexx

> Then try to run (note, case of the filename containing the Rexx program
> *does* matter!):
>
> rexxj testVersion.rex


also rexxj testVersion.cmd

These give the error previously reported

> If this does not work with one of the two pre-assembled BSF-packages,
> then please try it with the other BSF-package.


?. Do you mean an earlier version?

> Please come back and report your findings in any case.


I've recently changed to ObjRexx (OS/2), and JDK 1.4.2_05 from the
runtime. I suspect a Java path problem but I'm snowed under now and
won't be able to test this properly for a while. In the meantime, I'll
ask on an OS/2 list for other people's tests.

Regards,
Bruce Rossi
data2docSAFE at URLfastmail.com.au
(please modify Reply-To: to reply)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com