Apache OpenOffice (AOO) Bugzilla – Issue 23900
bridgetest_inprocess_java exception occured: cannot instantiate service
Last modified: 2010-11-10 21:19:09 UTC
linux sparc cws_fix645_ooo111fix2 fails java test OK: jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_inprocess > dynamic invocation test succeeded! FAILED: jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_inprocess_java exception occured: cannot instantiate service! > error: cannot instantiate service! > dying... jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ OK: jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_server > accepting socket,host=localhost,port=2002...jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_server & [1] 10662 jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ > accepting socket,host=localhost,port=2002... jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_client connection established. > accepting socket,host=localhost,port=2002...> dynamic invocation test succeeded! STOP SERVER: 10663 pts/5 S 0:00 uno -ro uno_services.rdb -ro uno_types.rdb -s com.sun10695 pts/5 S 0:00 uno -ro uno_services.rdb -ro uno_types.rdb -s com.sun10853 pts/5 R 0:00 ps ax jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ killall uno ./bridgetest_server: line 1: 10663 Terminated uno -ro uno_services.rdb -ro uno_types.rdb -s com.sun.star.test.bridge.CppTestObject -u "uno:socket,host=localhost,port=2002;urp;test" [1]+ Exit 143 ./bridgetest_server FAILED: jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_javaserver waiting for connect... It just waits forever so i did this: System.err.println("waiting for connect..."); while( true ) { + System.err.println("before acceptor"); XConnection xConnection = xAcceptor.accept(conDcp); + System.err.println("after "); $ ./bridgetest_javaserver waiting for connect... before acceptor and that is where it stops.
hmm, maybe it is waiting for client? is this success or failed? jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_javaserver & [1] 12668 jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ waiting for connect... jim@sun:/usr/local/645/testtools/unxlngs.pro/lib$ ./bridgetest_client tried to query for an interface reference of an unknown type but got a runtime exception. This should work for native bridges but isn't implemented for Java remote bridge Note: All subsequent tests may fail now as the remote bridge is broken QueryForUnknownType> dynamic invocation test succeeded!
Has the Java part (com/sun/star/comp/...) been built (and registered) correctly? Do a regview on the uno_services.rdb in output directory to check whether the Java component is registered.
I guess these are the required files ? (also regview output is attached but do not know how to interpret that) jim@sun:/usr/local/645/testtools/unxlngs.pro/class/com/sun/star/comp/bridge$ ls TestComponent.class TestComponentMain.class TestComponentMain$InstanceProvider.class TestComponent$_PerformancTestObject.class TestComponent$_TestObject.class
Created attachment 12179 [details] regview output
Hi, I am seeing the same error on MacOSX. I will check under PPC Linux as well. Kevin On Dec 27, 2003, at 2:18 AM, Jim Watson wrote: >This fails on linx sparc, do other platforms see this? >issue 23900, cws_fix645_ooo111fix2 Hi Jim, I see the same thing under PPC Linux as well and its java support seems to be fine. So I would guess something is wrong witht he test script of code. But I am not 100% sure. Kevin Hi Jim, I tried the same thing in the 680 tree and got a different result: [kbhend@base1 lib]$ ./bridgetest_inprocess_java Warning: default mime table not found: /src4/j2sdk1.4.1/jre/lib/lib/content-types.properties tried to query for an interface reference of an unknown type but got a runtime exception. This should work for native bridges but isn't implemented for Java remote bridge Note: All subsequent tests may fail now as the remote bridge is broken QueryForUnknownType ### leaking object instance! ### test succeeded! So it does pass with warnings in cws_src680_ooo20031216 testtools
Output from gdb This GDB was configured as "sparc-linux"... (gdb) run Starting program: /home/jim/680/o2_src/solver/680/unxlngs.pro/bin/uno -ro uno_services.rdb -ro uno_types.rdb -s com.sun.star.test.bridge.BridgeTest -- com.sun.star.test.bridge.JavaTestObject [New Thread 16384 (LWP 16704)] [New Thread 32769 (LWP 17835)] [New Thread 16386 (LWP 17842)] [New Thread 32771 (LWP 17850)] [New Thread 49156 (LWP 17861)] [New Thread 65541 (LWP 18007)] [New Thread 81926 (LWP 18015)] [New Thread 98311 (LWP 18022)] [New Thread 114696 (LWP 18032)] Program received signal SIGUSR2, User defined signal 2. [Switching to Thread 16384 (LWP 16704)] 0x7000d66c in _dl_debug_state () from /lib/ld-linux.so.2 (gdb) where #0 0x7000d66c in _dl_debug_state () from /lib/ld-linux.so.2 #1 0x7000d08c in _dl_init () from /lib/ld-linux.so.2 #2 0x70664f54 in getutmpx () from /lib/libc.so.6 #3 0x7000ce24 in _dl_catch_error () from /lib/ld-linux.so.2 #4 0x70665370 in _dl_open () from /lib/libc.so.6 #5 0x702b913c in guard variable for cppu::WeakComponentImplHelper3<com::sun::star::util::XMacroExpander, com::sun::star::lang::XServiceInfo, com::sun::star::lang::XInitialization>::s_cd () from /lib/libdl.so.2 #6 0x7000ce24 in _dl_catch_error () from /lib/ld-linux.so.2 #7 0x702b9690 in dlerror () from /lib/libdl.so.2 #8 0x702b9178 in dlopen () from /lib/libdl.so.2 #9 0x70047ddc in osl_psz_loadModule () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libsal.so.3 #10 0x70047d8c in osl_loadModule () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libsal.so.3 #11 0x70215b88 in initDefaultEnvironment.15 () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppu.so.3 #12 0x70215e78 in uno_getEnvironment () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppu.so.3 #13 0x709a82e8 in stoc_javaloader::JavaComponentLoader::JavaComponentLoader(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/javaloader.uno.so #14 0x709a9708 in stoc_javaloader::JavaComponentLoader_CreateInstance(com::sun::star::un---Type <return> to continue, or q <return> to quit--- o::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/javaloader.uno.so #15 0x70273ec4 in cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #16 0x702740c4 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #17 0x70274ea4 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #18 0x702755d0 in cppu::ORegistryFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #19 0x702740c4 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #20 0x70274ea4 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #21 0x708723b0 in stoc_smgr::OServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/servicemgr.uno.so ---Type <return> to continue, or q <return> to quit--- #22 0x70872f4c in stoc_smgr::OServiceManager::createInstance(rtl::OUString const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/servicemgr.uno.so #23 0x70276344 in cppu::ORegistryFactoryHelper::createModuleFactory() () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #24 0x702752f8 in cppu::ORegistryFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #25 0x702740c4 in cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #26 0x70274ea4 in cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/libcppuhelpergcc3.so.3 #27 0x708723b0 in stoc_smgr::OServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () from /home/jim/680/o2_src/solver/680/unxlngs.pro/lib/servicemgr.uno.so #28 0x70980abc in bridge_test::TestBridgeImpl::run(com::sun::star::uno::Sequence<rtl::OUString> const&) (this=0x7092d3e0, rArgs=@0xefffe400) at /home/jim/680/o2_src/testtools/source/bridgetest/bridgetest.cxx:990 #29 0x0001d4ac in main () #30 0x7056cd8c in __libc_start_main () from /lib/libc.so.6 (gdb)
oops, the above gdb backtrace belongs to issue 23902. i will depend these three issues
has the jar file component been built? /usr/local/645/testtools/unxlngs.pro/class/testComponent.jar ? I don't see it in your regview output, seems that regcomp has failed.
hmm, that part of the makefile has been commented out: .IF "$(SOLAR_JAVA)" != "" regcomp -register -r uno_services.rdb \ -c javaloader.uno$(MY_DLLPOSTFIX) \ -c javavm.uno$(MY_DLLPOSTFIX) # currently no chance to construct absolute file url for testComponent.jar # regmerge regcomp.rdb / $(SOLARBINDIR)$/udkapi.rdb uno_services.rdb # regcomp -register -r uno_services.rdb -br regcomp.rdb \ # -classpath $(MY_CLASSPATH) \ # -c file:///c:/source/testtools/wntmsci9/class/testComponent.jar .ENDIF jim@sun:/usr/local/645/testtools$ cvs status source/bridgetest/makefile.mk =================================================================== File: makefile.mk Status: Up-to-date Working revision: 1.11.12.1 Repository revision: 1.11.12.1 /cvs/udk/testtools/source/bridgetest/makefile.mk,v Sticky Tag: cws_fix645_ooo111fix2 (branch: 1.11.12) Sticky Date: (none) Sticky Options: (none)
There are a couple of issues here. The 680 makefile in 680 knows how to make that absolute path. But the file testComponent.jar is not built yet when it attempts to register. So I build everything first, delete all except that jar file, then edit the makefile and viola. register component 'file:///usr/local/645/testtools/unxlngs.pro/class/testComponent.jar' in registry 'uno_services.rdb' succesful! the test still fails because of paco chorizo? Trace Message: exception occured uno->java: [com.sun.star.lang.IllegalArgumentException] " paco' chorizo\' "' java stack trace: com.sun.star.lang.IllegalArgumentException: " paco' chorizo\' "' at com.sun.star.comp.bridge.TestComponent$_TestObject.raiseException(TestComponent.java:684) ### unexpected exception content! failed I will tidy up rebuild without debug to get some nicer messages, and try and make a patch, but not sure yet how to change that build sequence
Test succeeds now, I made the patch to build bridges jni_uno with no optimisation as described at issue 23902 ./bridgetest_inprocess_java tried to query for an interface reference of an unknown type but got a runtime exception. This should work for native bridges but isn't implemented for Java remote bridge Note: All subsequent tests may fail now as the remote bridge is broken QueryForUnknownType> dynamic invocation test succeeded! Problem remains how to build testtools properly.
In summary, this is all working nicely using the makefile from 680 and patches at other issues see testtools at issue 23882 see jni_uno patch at issue 23902 To do: patch for makefile
Daniel, please take care of this and target appropriately.
@sparcmoz: The problem with the makefile.mk is, as stated, that we currently have no chance to produce a proper file url for the jar component. When I have time, I will fix the makefile introducing a bootstrap variable, as done in setup2/util/makefile.mk for registering. This issue currently does not hurt.
currently no time, no prio => later
@sparcmoz: Is this really still an issue? Can you please verify on latest master?
sorry i did not look at this lately becasue I have been stuck with segfault in testcppu. There is no testtools in cws_src680_ooo20040620 where porters hang out so i checked out from HEAD. This gives new build errors below so i cannot say if this issue is resolved. By the way this issue was about the strange results of running the test, not about building the tests. idlc -O../../../unxlngs.pro/misc/bridgetest_idl -I/home/jim/680/solver/680/unxlngs.pro/idl -cid -we ./bridgetest.idl idlc: compile './bridgetest.idl' ... /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(123) : Missing '{' or illegal syntax following struct inheritance spec: syntax error, unexpected '<', expecting '{' /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(123) : Statement can not be parsed: definitions /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(227) : Illegal syntax or missing identifier after operation type: syntax error, unexpected '<', expecting IDL_IDENTIFIER or IDL_GET or IDL_SET /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(227) : Statement can not be parsed: sequence declaration /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(228) : Illegal syntax or missing declarator in parameter declaration: syntax error, unexpected '<', expecting IDL_IDENTIFIER or IDL_GET or IDL_SET /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(228) : Statement can not be parsed: sequence declaration /home/jim/680/testtools/source/bridgetest/idl/bridgetest.idl(228) : specified symbol is not a type: Segmentation fault dmake: Error code 139, while making '../../../unxlngs.pro/bin/bridgetest.rdb' ---* TG_SLO.MK *--- ERROR: Error 65280 occurred while making /home/jim/680/testtools/source/bridgetest/idl
Have you recently tested this? It works for me on Linux and Windows.
I get this error building testtools with SRC680_m61 gcc-3.4.I will report again when m62 is built. regcomp -register -br ../../unxlngs.pro/misc/bridgetest/bootstrap.rdb -r ../../unxlngs.pro/lib/uno_services.rdb -c \ file:///home/jim/680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar \ -classpath .:../../unxlngs.pro/class:/usr/local/j2sdk1.4.1/jre/lib/rt.jar:.:/home/jim/680/solver/680/unxlngs.pro/bin/java_uno.jar:/home/jim/680/solver/680/unxlngs.pro/bin/jurt.jar:/home/jim/680/solver/680/unxlngs.pro/bin/ridl.jar using loader com.sun.star.loader.Java2 terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException' Abort dmake: Error code 134, 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/680/testtools/source/bridgetest jim@sun:~/680/testtools$
I recommend to wait until m62, because a lot of changes and fixes concerning Java have been integrated then. There will also be a regcomp shell script which makes sure the proper LD_LIBRARY_PATH is set. However could you tell us the values of JAVA_HOME, CLASSPATH, LD_LIBRARY_PATH of your build environment? What is the vendor of your Java?
I have attached the environment information. I am using the blackdown j2sdk1.4.1 version for sparc which is a port from Sun. Note this testtools stuff has worked OK in 645.
Created attachment 19410 [details] paths and things
Created attachment 19411 [details] environment shell
Could you also look into you solver/bin or lib directory and attach the javavendors.xml. Please find out what the exact vendor string of you JRE is. Best thing is you retrieve the system property java.vendor.
jim@sun:~$ java GetJVMInfo 1.4.1 Blackdown Java-Linux Team /usr/local/j2sdk1.4.1/jre jim@sun:~$ cat *java class GetJVMInfo { public static void main(String args[]) { System.out.println(System.getProperty("java.version")); System.out.println(System.getProperty("java.vendor")); System.out.println(System.getProperty("java.home")); } jim@sun:~/680/solver$ find -name javavendors.xml ./680/unxlngs.pro/bin/so/javavendors.xml ./680/unxlngs.pro/bin/javavendors.xml ./680/unxlngs.pro/lib/javavendors.xml I will attach the three files as the first is different fom the other two.
Created attachment 19446 [details] bin/so
Created attachment 19447 [details] bin
Created attachment 19448 [details] lib
I can see there is a need for some changes in jvmfwk. Also I think this issue 23900 should be owned by me now, there is a problem in my bridges code and latest edits show this message from building testools. If you agree, just make me the owner, and I will report progress later. and thanks for your help. regcomp -register -br ../../unxlngs.pro/misc/bridgetest/bootstrap.rdb -r ../../unxlngs.pro/lib/uno_services.rdb -c \ file:///home/jim/680/testtools/source/bridgetest/../../unxlngs.pro/class/testComponent.jar \ -classpath .:../../unxlngs.pro/class:/usr/local/j2sdk1.4.1/jre/lib/rt.jar:.:/home/jim/680/solver/680/unxlngs.pro/bin/java_uno.jar:/home/jim/680/solver/680/unxlngs.pro/bin/jurt.jar:/home/jim/680/solver/680/unxlngs.pro/bin/ridl.jar using loader com.sun.star.loader.Java2 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x7E6A1264 Function=(null)+0x7E6A1264 Library=/home/jim/680/solver/680/unxlngs.pro/lib/libgcc3_uno.so NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possibl
as agreed back to you
The javavendors.xml in /bin/so is used for StarOffice. If this is not a Java related problem, what exactly do you mean with "I can see there is a need for some changes in jvmfwk." ? If there is an issue please let me know.
jl: there is not an issue about java, i was just meaning to explain that your questions made me realise i need to discover what jvmfwk is doing and make sure my specific platform/java requirements are properly included.
cleanup bridges tasks in ussuezilla *** This issue has been marked as a duplicate of 37423 ***
close
Created attachment 73651