Issue 51724 - testtools needs export CLASSPATH ?
Summary: testtools needs export CLASSPATH ?
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: 680m115
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: DevTools
Assignee: hjs
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-08 12:33 UTC by caolanm
Modified: 2005-12-10 12:11 UTC (History)
6 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
testtools patch (818 bytes, patch)
2005-07-08 12:33 UTC, caolanm
no flags Details | Diff
output. (10.74 KB, text/plain)
2005-08-23 14:04 UTC, caolanm
no flags Details
linux sparc log (22.50 KB, text/plain)
2005-08-23 22:08 UTC, sparcmoz
no flags Details
needed for building testtools (817 bytes, patch)
2005-08-23 22:14 UTC, sparcmoz
no flags Details | Diff
for building testtools with stoc debug=t (807 bytes, patch)
2005-08-23 22:16 UTC, sparcmoz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2005-07-08 12:33:32 UTC
I seem to need this patch to build testtools. Admittedly this is with gcj and so
I can't verify that it's needed for sun-java.
Comment 1 caolanm 2005-07-08 12:33:56 UTC
Created attachment 27788 [details]
testtools patch
Comment 2 sparcmoz 2005-07-25 13:55:33 UTC
Thanks! This patch is also needed for GNU/Linux Sparc in m120 with
gcc-4.0/gcj-4.0 (but it is not needed for blackdown j2sdk1.4.1)

Comment 3 caolanm 2005-08-21 14:05:31 UTC
.
Comment 4 caolanm 2005-08-22 10:25:31 UTC
error message is...

regcomp -register  -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb -c \
       
file:///usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar
\
       
-env:URE_INTERNAL_JAVA_DIR=file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/bin
using loader com.sun.star.loader.Java2
register component
'file:///usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar'
in registry '../../unxlngi6.pro/lib/uno_services.rdb' failed!
error (RuntimeException): javaloader error - no mapping from java to C++
dmake:  Error code 1, while making '../../unxlngi6.pro/lib/uno_services.rdb'
dmake:  '../../unxlngi6.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'
Comment 5 hjs 2005-08-22 10:49:53 UTC
could you rebuild "jvmfwk" with debug and reproduce this error? could more
information about why this breaks.
Comment 6 caolanm 2005-08-22 11:15:06 UTC
/usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest
mkdir ../../unxlngi6.pro/lib/
mkdir: cannot create directory `../../unxlngi6.pro/lib/': File exists
cd ../../unxlngi6.pro/lib && regcomp -register -br uno_types.rdb -r
uno_services.rdb\
        -c acceptor.uno.so \
        -c bridgefac.uno.so \
        -c connector.uno.so \
        -c remotebridge.uno.so \
        -c uuresolver.uno.so \
        -c bridgetest.uno.so \
        -c cppobj.uno.so \
        -c uriproc.uno.so
[Java framework] Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/jvmfwk3rc
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_JREHOME with
JAVA_HOME = /usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/javavendors.xml.
[Java framework] sunjavaplugin: Testing class SunVersion succeeded.[Java
framework] sunjavaplugin: Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/sunjavapluginrc
[Java framework] Executing: file:///usr/bin/gij.
[Java framework] Java executed successfully.
[Java framework]  Java wrote to stderr:"  ".
[Java framework] sunjavaplugin.so: Detected another JRE: file:///usr
 at: file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
register component 'acceptor.uno.so' in registry 'uno_services.rdb' succesful!
register component 'bridgefac.uno.so' in registry 'uno_services.rdb' succesful!
register component 'connector.uno.so' in registry 'uno_services.rdb' succesful!
register component 'remotebridge.uno.so' in registry 'uno_services.rdb' succesful!
register component 'uuresolver.uno.so' in registry 'uno_services.rdb' succesful!
register component 'bridgetest.uno.so' in registry 'uno_services.rdb' succesful!
register component 'cppobj.uno.so' in registry 'uno_services.rdb' succesful!
register component 'uriproc.uno.so' in registry 'uno_services.rdb' succesful!
regcomp -register -br ../../unxlngi6.pro/lib/uno_types.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb \
        -c javaloader.uno.so -c javavm.uno.so
[Java framework] Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/jvmfwk3rc
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_JREHOME with
JAVA_HOME = /usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/javavendors.xml.
[Java framework] sunjavaplugin: Testing class SunVersion succeeded.[Java
framework] sunjavaplugin: Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/sunjavapluginrc
[Java framework] Executing: file:///usr/bin/gij.
[Java framework] Java executed successfully.
[Java framework]  Java wrote to stderr:"  ".
[Java framework] sunjavaplugin.so: Detected another JRE: file:///usr
 at: file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
register component 'javaloader.uno.so' in registry
'../../unxlngi6.pro/lib/uno_services.rdb' succesful!
register component 'javavm.uno.so' in registry
'../../unxlngi6.pro/lib/uno_services.rdb' succesful!
regcomp -register  -br ../../unxlngi6.pro/misc/bridgetest/bootstrap.rdb -r
../../unxlngi6.pro/lib/uno_services.rdb -c \
       
file:///usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar
\
       
-env:URE_INTERNAL_JAVA_DIR=file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/bin
[Java framework] Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/jvmfwk3rc
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_JREHOME with
JAVA_HOME = /usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/javavendors.xml.
[Java framework] sunjavaplugin: Testing class SunVersion succeeded.[Java
framework] sunjavaplugin: Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/sunjavapluginrc
[Java framework] Executing: file:///usr/bin/gij.
[Java framework] Java executed successfully.
[Java framework]  Java wrote to stderr:"  ".
[Java framework] sunjavaplugin.so: Detected another JRE: file:///usr
 at: file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
using loader com.sun.star.loader.Java2
[Java framework] Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/jvmfwk3rc
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_JREHOME with
JAVA_HOME = /usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/javavendors.xml.
[Java framework] sunjavaplugin: Testing class SunVersion succeeded.[Java
framework] sunjavaplugin: Using configuration file
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/sunjavapluginrc
[Java framework] Executing: file:///usr/bin/gij.
[Java framework] Java executed successfully.
[Java framework]  Java wrote to stderr:"  ".
[Java framework] sunjavaplugin.so: Detected another JRE: file:///usr
 at: file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/lib/javavendors.xml.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_CLASSPATH and class
path is:
 .
[Java framework] Using Java runtime library: file:///usr/lib/libgcj.so.6.
VM option: -Djava.class.path=:/usr/lib/javaplugin.jar:/usr/lib/plugin.jar
VM option: -Dorg.openoffice.native=
[Java framework] sunjavaplugin.so has created a VM.
register component
'file:///usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest/../../unxlngi6.pro/class/testComponent.jar'
in registry '../../unxlngi6.pro/lib/uno_services.rdb' failed!
error (RuntimeException): javaloader error - no mapping from java to C++
dmake:  Error code 1, while making '../../unxlngi6.pro/lib/uno_services.rdb'
dmake:  '../../unxlngi6.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making
/usr/src/redhat/BUILD/SRC680_m125/testtools/source/bridgetest
Comment 7 sparcmoz 2005-08-22 12:56:20 UTC
Similar on GNU/Linux sparc with debian/unstable gcc-4.0/gcj-4.0
<snip>
register component 'uriproc.uno.so' in registry 'uno_services.rdb' succesful!
regcomp -register -br ../../unxlngs.pro/lib/uno_types.rdb -r
../../unxlngs.pro/lib/uno_services.rdb \
        -c javaloader.uno.so -c javavm.uno.so
[Java framework] The JRE specified by the bootstrap variable
UNO_JAVA_JFW_JREHOME  or  UNO_JAVA_JFW_ENV_JREHOME  could not be recognized.
Check the values and make sure that you use a plug-in library that can recognize
that JRE.javaldx failed!
register component 'javaloader.uno.so' in registry
'../../unxlngs.pro/lib/uno_services.rdb' succesful!
register component 'javavm.uno.so' in registry
'../../unxlngs.pro/lib/uno_services.rdb' succesful!
regcomp -register  -br ../../unxlngs.pro/misc/bridgetest/bootstrap.rdb -r
../../unxlngs.pro/lib/uno_services.rdb -c \
       
file:///home/jim/ooo680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar
\
       
-env:URE_INTERNAL_JAVA_DIR=file:///home/jim/ooo680/solver/680/unxlngs.pro/bin
[Java framework] The JRE specified by the bootstrap variable
UNO_JAVA_JFW_JREHOME  or  UNO_JAVA_JFW_ENV_JREHOME  could not be recognized.
Check the values and make sure that you use a plug-in library that can recognize
that JRE.javaldx failed!
using loader com.sun.star.loader.Java2
[Java framework] The JRE specified by the bootstrap variable
UNO_JAVA_JFW_JREHOME  or  UNO_JAVA_JFW_ENV_JREHOME  could not be recognized.
Check the values and make sure that you use a plug-in library that can recognize
that JRE.register component
'file:///home/jim/ooo680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar'
in registry '../../unxlngs.pro/lib/uno_services.rdb' failed!
error (RuntimeException): [JavaVirtualMachine]:An unexpected error occurred
while starting Java!
dmake:  Error code 1, while making '../../unxlngs.pro/lib/uno_services.rdb'
dmake:  '../../unxlngs.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

Comment 8 sparcmoz 2005-08-22 13:30:16 UTC
Thread:      1 :component path=javavm.uno.so

[Java framework] Using configuration file
file:///home/jim/ooo680/solver/680/unxlngs.pro/lib/jvmfwk3rc
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_JREHOME with
JAVA_HOME = /usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///home/jim/ooo680/solver/680/unxlngs.pro/lib/javavendors.xml.
[Java framework] sunjavaplugin: Testing class SunVersion succeeded.[Java
framework] sunjavaplugin: Using configuration file
file:///home/jim/ooo680/solver/680/unxlngs.pro/lib/sunjavapluginrc
[Java framework] Executing: file:///usr/bin/gij-wrapper-4.0.
[Java framework] Java executed successfully.
[Java framework]  Java wrote to stderr:"  ".
[Java framework] sunjavaplugin.so: Detected another JRE: file:///usr
 at: file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] sunjavaplugin.so: JRE found again (detected before): file:///usr.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///home/jim/ooo680/solver/680/unxlngs.pro/lib/javavendors.xml.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_CLASSPATH and class
path is:
 .
[Java framework] Using Java runtime library:
file:///usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/libgcj.so.6.
VM option:
-Djava.class.path=:/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/javaplugin.jar:/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/plugin.jar
VM option: -Dorg.openoffice.native=
[Java framework] sunjavaplugin.so has created a VM.
Thread:      1 :component path=uriproc.uno.so

register component
'file:///home/jim/ooo680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar'
in registry '../../unxlngs.pro/lib/uno_services.rdb' failed!
error (RuntimeException): javaloader error - no mapping from java to C++
dmake:  Error code 1, while making '../../unxlngs.pro/lib/uno_services.rdb'
dmake:  '../../unxlngs.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making
/home/jim/ooo680/testtools/source/bridgetest
jim@sun:~/ooo680/testtools$ ls
/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/libgcj.so.6
/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/libgcj.so.6
jim@sun:~/ooo680/testtools$ ls
/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/javaplugin.jar
ls: /usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/javaplugin.jar: No such file
or directory
jim@sun:~/ooo680/testtools$ ls
/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/plugin.jar
ls: /usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/plugin.jar: No such file or
directory
jim@sun:~/ooo680/testtools$ find /usr/lib -name plugin.jar
jim@sun:~/ooo680/testtools$             
Comment 9 hjs 2005-08-22 16:29:45 UTC
adding cc
Comment 10 joachim.lingner 2005-08-22 16:56:56 UTC
JL->sparcmoz: Your first errorlog indicates that either the environment variable
is not set or the JRE is not recognized. I think cmc did already some necessary
adjustments for gcj-4.0 in the jvmfwk project. Maybe this needs to be done  for
Linux Sparc  as well. 

Your second error log indicates the same problem as the one from cmc. You can
workaround it by making sure that java_uno.jar, jurt.jar, ridl.jar and maybe
juh.jar are on the class path.
Comment 11 joachim.lingner 2005-08-23 10:47:55 UTC
JL->SB: Could you give us some hints how the jar files (ridl.jar, java_uno.jar)
are located?
Comment 12 sparcmoz 2005-08-23 12:56:27 UTC
I fixed my jvmfwk and tried 2 different workarounds which provede the required
files in the CLASSPATH (the patch above, and export CLASSPATH).

But still an error remains so I made a new issue 53661 for this as I assume it
is not the same as the classpath issue?

error (RuntimeException): [jni_uno bridge error] UNO calling Java method
initialize: java.lang.NullPointerException
Comment 13 Stephan Bergmann 2005-08-23 13:16:51 UTC
sb->cmc:  To more easily track down the problem, could you please build
bridges/source/jni_uno with debug and re-build testtools.
Comment 14 caolanm 2005-08-23 14:04:35 UTC
Created attachment 28983 [details]
output.
Comment 15 sparcmoz 2005-08-23 15:07:13 UTC
stoc also built with debug=t

[Java framework] Using bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS =
file:///home/jim/ooo680/solver/680/unxlngs.pro/lib/javavendors.xml.
[Java framework] Using bootstrap parameter UNO_JAVA_JFW_ENV_CLASSPATH and class
path is:
.:../../unxlngs.pro/class::/home/jim/ooo680/solver/680/unxlngs.pro/bin/java_uno.jar:/home/jim/ooo680/solver/680/unxlngs.pro/bin/jurt.jar:/home/jim/ooo680/solver/680/unxlngs.pro/bin/ridl.jar.
[Java framework] Using Java runtime library:
file:///usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/libgcj.so.6.
VM option:
-Djava.class.path=:.:../../unxlngs.pro/class::/home/jim/ooo680/solver/680/unxlngs.pro/bin/java_uno.jar:/home/jim/ooo680/solver/680/unxlngs.pro/bin/jurt.jar:/home/jim/ooo680/solver/680/unxlngs.pro/bin/ridl.jar:/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/javaplugin.jar:/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre/lib/plugin.jar
VM option: -Dorg.openoffice.native=

VM option: -ea
libgcj: unknown option: -ea

[Java framework] sunjavaplugin.soCan not create Java Virtual Machine
register component
'file:///home/jim/ooo680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar'
in registry '../../unxlngs.pro/lib/uno_services.rdb' failed!
error (CannotRegisterImplementationException): Could not create Java
implementation loader
Comment 16 joachim.lingner 2005-08-23 15:37:34 UTC
JL->sparcmoz: libgcj seems not to know -ea switch. It is set in
stoc/source/javavm/javavm.cxx (search for -ea):

#if OSL_DEBUG_LEVEL > 0
        if(!getenv( "DISABLE_SAL_DBGBOX" ) )
            jvm.pushProp(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-ea")));
#endif

You can uncomment this code, to get your test case running. I will remove these
lines as soon as possible.
Comment 17 sparcmoz 2005-08-23 16:02:24 UTC
sparcmoz->JL: thanks. I fixed that and there are no debug messages from stoc.
Comment 18 joachim.lingner 2005-08-23 16:08:10 UTC
jl->sparcmoz: Does that mean you VM can now be created? That is, this message:
[Java framework] sunjavaplugin.soCan not create Java Virtual Machine

does not appear anymore?
Comment 19 sparcmoz 2005-08-23 22:06:40 UTC
sparcmoz->jl: that is correct, VM created 

Now the messsage is again like I attached at issue 53661

Note this is similar to the latest log from cmc above, but there are some
differences too. I will attach the log.

VM option: -Dorg.openoffice.native=
[Java framework] sunjavaplugin.so has created a VM.
Thread:      1 :component path=uriproc.uno.so

Thread:      1 :uno->java call:
com.sun.star.uno.XInterface::queryInterface:@0,0:com.sun.star.loader.XImplementationLoader
on oid 1921802992;java[];722dff98:105e3da93e4:-8000000000000000
Thread:      1 :uno->java call: com.sun.star.lang.XInitialization::initialize on
oid 1921802992;java[];722dff98:105e3da93e4:-8000000000000000
Error: File /home/jim/ooo680/bridges/source/jni_uno/jni_base.h, Line 158:
unexpected java exception occured!

Also note the above error is reproduceable. But there are are separate random
segmentation faults and illegal instructions which require the build to be
repeated a few times until it gets to this point. For example, the build attempt
immediately before running the attached log I got this:

register component 'remotebridge.uno.so' in registry 'uno_services.rdb' succesful!
Thread:      1 :component path=uuresolver.uno.so

Illegal instruction
dmake:  Error code 132, while making '../../unxlngs.pro/lib/uno_services.rdb'
dmake:  '../../unxlngs.pro/lib/uno_services.rdb' removed.
'---* tg_merge.mk *---'

ERROR: Error 65280 occurred while making
/home/jim/ooo680/testtools/source/bridgetest. I assume this is not relevant
because cmc is not on sparc.
Comment 20 sparcmoz 2005-08-23 22:08:26 UTC
Created attachment 28996 [details]
linux sparc log
Comment 21 sparcmoz 2005-08-23 22:13:10 UTC
To run this with stoc debug=t I patched stoc as attached. I patched testtools
with the patch already provided by cmc above. There are no patches to jvmfwk. No
CLASSPATH in environment. I am attaching stoc and testools patches only to
support the build log.


Comment 22 sparcmoz 2005-08-23 22:14:25 UTC
Created attachment 28997 [details]
needed for building testtools
Comment 23 sparcmoz 2005-08-23 22:16:15 UTC
Created attachment 28998 [details]
for building testtools with stoc debug=t
Comment 24 Stephan Bergmann 2005-08-24 09:29:58 UTC
sb->cmc:  From your build.log, it seems there is a problem in the JNI--UNO
bridge.  What should happen is as follows:  uno_ext_getMapping (jni_bridge.cxx)
calls Bridge::Bridge (jni_bridge.cxx), which obtains a
jmvaccess::UnoVirtualMachine, which is a pair of a JVM pointer and a
com.sun.star.lib.unoloader.UnoClassLoader (ridljar) which is a classloader that
knows all the UNO Java classes (i.e., ridl.jar, jurt.jar, etc.).  Whenever the
JNI--UNO bridge needs to find a UNO Java class via JNI, it does so either (a)
via ClassLoader.findClass at the given UnoClassLoader, or (b) directly via JNI's
FindClass from native code that in turn got called back from a UNO Java class
(and in which case the classloader used by JNI will thus be UnoClassLoader; this
detail of FindClass changed in JRE 1.2, previous versions always used the base
system classloader, and maybe gcj has a bug here).  However, at some place,
finding the UNO Java class com.sun.star.uno.Type fails.
It could be that we get caught in case (b) here, but I doubt it.  In either
case, from the stacktrace it is hard to tell exactly where the problem occurs. 
Could you please step through the try--catch block in uno_ext_getMapping
(jni_bridge.cxx) and see exactly where the BridgeRuntimeError is thrown.
Comment 25 caolanm 2005-08-24 11:10:58 UTC
raw data is...

(gdb) break jni_bridge.cxx:482
(gdb) run...
(gdb) catch throw
(gdb) catch catch
(gdb) cont

#0  0x001fcb85 in __cxa_throw ()
   from
/usr/src/redhat/BUILD/SRC680_m125/solver/680/unxlngi6.pro/bin/../lib/libstdc++.so.6
#1  0x004b7717 in jni_uno::JNI_context::java_exc_occured (this=0xbfc0fb28)
    at /usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_bridge.cxx:384
#2  0x004a1f5c in jni_uno::JNI_context::ensure_no_exception (this=0xbfc0fb28)
    at /usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_base.h:148
#3  0x0049cf20 in JNI_info (this=0x256888, jni_env=0x94838f8,
    class_loader=0x77620, classLoader_loadClass=0x7bc839c)
    at
/usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_info.cxx:739#4 
0x0049e69c in jni_uno::JNI_info::get_jni_info (uno_vm=@0xbfc0fc28)
    at
/usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_info.cxx:986#5 
0x004b67f5 in Bridge (this=0x250c50, java_env=0x250e20, uno_env=0x250ab8,
    registered_java2uno=true)
    at /usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_bridge.cxx:290
#6  0x004b6b49 in uno_ext_getMapping (ppMapping=0xbfc0fd40, pFrom=0x250e20,
    pTo=0x250ab8)
    at /usr/src/redhat/BUILD/SRC680_m125/bridges/source/jni_uno/jni_bridge.cxx:525

i.e.     

m_field_Any__type = jni->GetFieldID(
        (jclass) jo_Any.get(), "_type", "Lcom/sun/star/uno/Type;" );
Comment 26 Stephan Bergmann 2005-08-24 16:31:38 UTC
This looks like a bug in gcj: JNI's GetFieldID(clazz, name, sig) should resolve
any classes mentioned in the given sig ("Lcom/sun/star/uno/Type;") with the
classloader of the given clazz (which is com.sun.star.uno.Any from ridl.jar,
which must thus have been loaded with a classloader that knows ridl.jar, and so
that classloader would also find com.sun.star.uno.Type, which is also in ridl.jar).

What is curious is that a few lines further up in jni_info.cxx, the
similar-looking call

  jni->GetMethodID(
    (jclass) jo_Type.get(),
    "<init>", "(Ljava/lang/String;Lcom/sun/star/uno/TypeClass;)V");

obviously had no problems locating com.sun.star.uno.TypeClass...
Comment 27 Stephan Bergmann 2005-08-24 16:34:44 UTC
At the end of the first of the two paragraphs in my previous comment, add:
But from the log files presented here earlier, it looks like GetFieldID
erroneously resolves those class names with the system classloader instead.
Comment 28 caolanm 2005-08-24 19:50:47 UTC
I wonder if http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21020 is relevent
Comment 29 caolanm 2005-08-25 08:13:58 UTC
yeah...
From: 	Tom Tromey <tromey@redhat.com>

Caolan> http://www.openoffice.org/issues/show_bug.cgi?id=51724
Caolan> where there's some gcj stuff about using a custom classloader where
Caolan> objects seem fine, but fields not.

This is the same as:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21020

I don't know why Andrew's patch didn't go on the 4.0 branch.
I'm going to put it there now.

Tom
Comment 30 sparcmoz 2005-08-29 10:45:09 UTC
testtools builds OK with the above patch, using the latest debian gcj-4.0
Comment 31 sparcmoz 2005-09-05 08:20:33 UTC
testtools builds OK with this gcc from upstream sources:
gcc (GCC) 4.0.2 20050904 (prerelease)

but not this one,(as might be expected)
gcc (GCC) 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)
Comment 32 caolanm 2005-09-14 08:51:38 UTC
yeah, problem apparently fixed in gcc now, let's forget about this then
Comment 33 caolanm 2005-09-14 08:52:06 UTC
close
Comment 34 sparcmoz 2005-09-15 14:28:19 UTC
cmc: I think there were 2 issues mixed up in here. 
The very first patch is still needed, at least with my gcc/gcj in m129
Comment 35 caolanm 2005-11-29 12:10:48 UTC
cmc->sparcmoz: "the very first patch" i.e. the export CLASSPATH patch ? This
*should* be ok with gcc 4.0.2 now. I'd like to close this issue
Comment 36 sparcmoz 2005-11-29 20:14:27 UTC
sparcmoz->cmc: Without the patch id 27788 with m142 I still get the error:

register component
'file:///home/jim/build680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar'
in registry '../../unxlngs.pro/lib/uno_services.rdb' failed!
error (RuntimeException): javaloader error - no mapping from java to C++

jim@sun:~/build680/testtools$ $CXX --version
g++ (GCC) 4.0.3 20051026 (prerelea

I build gcc from gcc.gnu.org sources and installed into /usr/local, therefore I
do not use any of my distribution (debian/unstable) gcc/gcj commands. Perhaps
there is interaction with something in my patches which are attached at issue
50599. I dont mind if this issue is closed and I will keep the patch in issue
50599 while it is needed.
Comment 37 sparcmoz 2005-12-10 12:10:38 UTC
Now I see that the .EXPORT : CLASSPATH is needed either here or in
solenv/inc/ant.mk. So when I restored it in ant.mk then it is no longer needed
here. 
Comment 38 sparcmoz 2005-12-10 12:11:47 UTC
cmc: closed again, and thanks