添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接


User community support forum for Apache OpenOffice, LibreOffice and all the OpenOffice.org derivatives

I am getting UnsatisfiedLinkError types of errors in relation to an internal PipeConnection JNI call while in the API method Bootstrap.bootstrap:

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Ljava/lang/String;)I
[Dynamic-linking native method java.lang.Throwable.getStackTraceDepth ... JNI]
[Dynamic-linking native method java.lang.Throwable.getStackTraceElement ... JNI]
	at com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Native Method)
	at com.sun.star.lib.connections.pipe.PipeConnection.<init>(PipeConnection.java:132)
	at com.sun.star.lib.connections.pipe.pipeConnector.connect(pipeConnector.java:140)
	at com.sun.star.comp.connections.Connector.connect(Connector.java:141)
	at com.sun.star.comp.urlresolver.UrlResolver$_UrlResolver.resolve(UrlResolver.java:128)
	at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:287)
	at kdx02_BootStrapOO00.main(kdx02_BootStrapOO00.java:35)
 I did try to first find a quick fix on line and then troubleshoot this (relatively frequent starting) error and even debug it by running the demo application as:

Code: Select all

 LD_DEBUG=all java -classpath $OOKP -verbose:class -verbose:jni kdx02_BootStrapOO00 > logfile.txt 2>&1
 The classpath is set as:

Code: Select all

 export OFFICE_HOME=/UNIONFS/usr/lib/openoffice/program
 export OOJARSDIR=/KNOPPIX/usr/share/java/openoffice
 export OOKP=$OOJARSDIR/juh.jar:$OOJARSDIR/jurt.jar:$OOJARSDIR/ridl.jar:$OOJARSDIR/unoil.jar:$OFFICE_HOME:.
 This is the important section of the toy code

Code: Select all

  try{
// __ Get the remote office component context
   XComponentContext xContext = Bootstrap.bootstrap();
// __ Get the remote office service manager
   XMultiComponentFactory xMCF = xContext.getServiceManager();
// __ Get the root frame (i.e. desktop) of openoffice framework.
   Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);
// __ Desktop has 3 interfaces. The XComponentLoader interface provides ability to load components.
   XComponentLoader xCLoader = ( XComponentLoader ) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
  }catch(com.sun.star.comp.helper.BootstrapException OOBSX){ OOBSX.printStackTrace(); }
     catch(com.sun.star.uno.Exception UNOX){ UNOX.printStackTrace(); }
 How can I fix this error?
Thanks
lbrtchx
This is the section of the libraries loaded by the running java process (LD_DEBUG java ...) near the exception thrown, but I can't see what may be causing the problem

Code: Select all

...
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Ljava/lang/String;)I
      5716:	symbol=Java_java_lang_Throwable_getStackTraceDepth;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0]
      5716:	binding file /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0] to /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0]: normal symbol `Java_java_lang_Throwable_getStackTraceDepth'
[Dynamic-linking native method java.lang.Throwable.getStackTraceDepth ... JNI]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=java [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/lib/libpthread.so.0 [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/bin/../lib/i386/jli/libjli.so [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/lib/libdl.so.2 [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/lib/libc.so.6 [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/lib/ld-linux.so.2 [0]
      5716:	symbol=JVM_GetStackTraceDepth;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/client/libjvm.so [0]
      5716:	binding file /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0] to /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/client/libjvm.so [0]: normal symbol `JVM_GetStackTraceDepth' [SUNWprivate_1.1]
      5716:	symbol=Java_java_lang_Throwable_getStackTraceElement;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0]
      5716:	binding file /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0] to /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0]: normal symbol `Java_java_lang_Throwable_getStackTraceElement'
[Dynamic-linking native method java.lang.Throwable.getStackTraceElement ... JNI]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=java [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/lib/libpthread.so.0 [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/bin/../lib/i386/jli/libjli.so [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/lib/libdl.so.2 [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/lib/libc.so.6 [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/lib/ld-linux.so.2 [0]
      5716:	symbol=JVM_GetStackTraceElement;  lookup in file=/UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/client/libjvm.so [0]
      5716:	binding file /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so [0] to /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/client/libjvm.so [0]: normal symbol `JVM_GetStackTraceElement' [SUNWprivate_1.1]
	at com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Native Method)
	at com.sun.star.lib.connections.pipe.PipeConnection.<init>(PipeConnection.java:132)
	at com.sun.star.lib.connections.pipe.pipeConnector.connect(pipeConnector.java:140)
	at com.sun.star.comp.connections.Connector.connect(Connector.java:141)
	at com.sun.star.comp.urlresolver.UrlResolver$_UrlResolver.resolve(UrlResolver.java:128)
	at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:287)
	at kdx02_BootStrapOO00.main(kdx02_BootStrapOO00.java:35)
 lbrtchx
that it may be related to the PipeConnection class in jurt.jar

Code: Select all

 com.sun.star.lib.connections.pipe.PipeConnection from file:/KNOPPIX/usr/share/java/openoffice/jurt.jar

Code: Select all

knoppix@Microknoppix:/media/sda2/prjx/OOo/ODF/kdx$ java -verbose:class -classpath $OOKP kdx02_BootStrapOO00
[Loaded java.lang.Object from shared objects file]
. . .
[Loaded com.sun.star.comp.helper.Bootstrap$1 from file:/KNOPPIX/usr/share/java/openoffice/juh.jar]
[Loaded com.sun.star.bridge.UnoUrlResolver from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded com.sun.star.uno.DeploymentException from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded java.util.AbstractList$Itr from shared objects file]
[Loaded com.sun.star.lib.uno.typeinfo.TypeInfo from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded com.sun.star.lib.uno.typeinfo.MethodTypeInfo from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded java.util.HashMap$Values from shared objects file]
[Loaded java.util.HashMap$HashIterator from shared objects file]
[Loaded java.util.HashMap$ValueIterator from shared objects file]
[Loaded com.sun.star.comp.connections.Implementation from file:/KNOPPIX/usr/share/java/openoffice/jurt.jar]
[Loaded com.sun.star.lib.uno.typeinfo.MemberTypeInfo from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded com.sun.star.lib.connections.pipe.pipeConnector from file:/KNOPPIX/usr/share/java/openoffice/jurt.jar]
[Loaded com.sun.star.connection.XConnectionBroadcaster from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded com.sun.star.lib.connections.pipe.PipeConnection from file:/KNOPPIX/usr/share/java/openoffice/jurt.jar]
[Loaded com.sun.star.io.IOException from file:/KNOPPIX/usr/share/java/openoffice/ridl.jar]
[Loaded java.lang.UnsatisfiedLinkError from shared objects file]
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Ljava/lang/String;)I
 at com.sun.star.lib.connections.pipe.PipeConnection.createJNI(Native Method)
 at com.sun.star.lib.connections.pipe.PipeConnection.<init>(PipeConnection.java:132)
 at com.sun.star.lib.connections.pipe.pipeConnector.connect(pipeConnector.java:140)
 at com.sun.star.comp.connections.Connector.connect(Connector.java:141)
 at com.sun.star.comp.urlresolver.UrlResolver$_UrlResolver.resolve(UrlResolver.java:128)
 at com.sun.star.comp.helper.Bootstrap.bootstrap(Bootstrap.java:287)
 at kdx02_BootStrapOO00.main(kdx02_BootStrapOO00.java:37)
[Loaded sun.misc.Signal$1 from /UNIONFS/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/rt.jar]
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]
 but I wouldn't know if this is a bug in the UNO libraries as suggested in the link above or something I could fix in another way
Again, how could I fix these types of errors?
lbrtchx
OK, here is the deal. After trying to troubleshoot this problem (which seems to be pretty common) for some time openoffice.org developer Stephan Bergmann pointed me to a the following links:
http://www.openoffice.org/servlets/Read ... sgNo=27765
http://www.openoffice.org/servlets/Read ... sgNo=27774
which let me figure out a (pretty easy) solution to that problem in my case. Rehashing Stephan's comments
~ ~ ~ ~ ~ ~ ~ start of rehash
The static:

Code: Select all

NativeLibraryLoader.loadLibrary(PipeConnection.class.getClassLoader(), jpipe");

Code: Select all

jurt.jar!com.sun.star.lib.connections.pipe.PipeConnection.class
effectively depends on finding a jpipe dynamic library (libjpipe.so on Linux) through the Class-Path in the jurt.jar

Code: Select all

$ cat ./META-INF/MANIFEST.MF
Manifest-Version: 1.0
Class-Path: ridl.jar unoloader.jar ../../lib/ ../bin/
Solar-Version: 310m19(Build:9420)
Sealed: true
Name: com/sun/star/lib/util/
Sealed: false
Name: com/sun/star/uno/
Sealed: false
 This works in standard OOo installations, where the jpipe dynamic library is found relative to jurt.jar within the URE installation either in ../../lib (Unix) or ../bin (Windows) and fails if you either use a jurt.jar copied elsewhere, or the given OOo installation does not preserve the above requirement.
~ ~ ~ ~ ~ ~ ~ end of rehash
So finding where "libjpipe.so" is in your particular system (as you can see mine is a knoppix live CD):

Code: Select all

$ sudo find  / -type f -name "libjpipe.so" -exec ls -l {} +
-rw-r--r-- 1 root root 7236 Nov  2  2009 /KNOPPIX/usr/lib/ure/lib/libjpipe.so
-rw-r--r-- 1 root root 7236 Nov  2  2009 /UNIONFS/usr/lib/ure/lib/libjpipe.so
 and feeding that location to the JVM via -Djava.library.path

Code: Select all

export LD_LIBRARY_PATH=/KNOPPIX/usr/lib/ure/lib
$ java -classpath $OOKP  -Djava.library.path=$LD_LIBRARY_PATH kdx02_BootStrapOO00
Mon Sep 20 19:26:20 GMT 2010
 Solved that problem!
I would like to emphasize (and this is mostly for OOo developers) that error messages should be a little more extensive and in depth when going Native and assumptions should be asserted in a stronger/safer way. A " ... so-und-so native library could not ne found at (wherever was expected) ... " would go a long way towards helping people troubleshoot those kinds of errors
Thanks to the OOo community/Stephan
lbrtchx
  • ↳   Getting Started Guide for 4.x
  • ↳   Getting Started Guide for 3.x
  • ↳   Install, Setup and Troubleshooting
  • ↳   Admin Guide
  • ↳   MS Windows
  • ↳   Linux
  • ↳   Mac OSX
  • ↳   LibreOffice
  • ↳   Tablets
  • ↳   Tutorials
  • ↳   Writer
  • ↳   Calc
  • ↳   Base
  • Applications
  • ↳   Writer
  • ↳   Writer Guide for 4.x
  • ↳   Writer Guide for 3.x
  • ↳   Writer Tutorials
  • ↳   Templates
  • ↳   Advanced Uses
  • ↳   Calc
  • ↳   Calc Guide for 4.x
  • ↳   Calc Guide for 3.x
  • ↳   Calc Functions
  • ↳   Calc Tutorials
  • ↳   Impress
  • ↳   Impress Guide for 4.x
  • ↳   Impress Guide for 3.x
  • ↳   Draw
  • ↳   Draw Guide for 4.x
  • ↳   Draw Guide for 3.x
  • ↳   Math
  • ↳   Math Guide for 4.x
  • ↳   Math Guide for 3.x
  • ↳   Math Guide for 3.x
  • ↳   Base
  • ↳   Base Guide for 4.x
  • ↳   Wiki
  • ↳   Base Tutorials
  • ↳   Tables & Queries
  • ↳   Forms
  • ↳   External Data Sources
  • ↳   Reporting
  • ↳   Database Examples
  • Customizing and Extending
  • ↳   Macros and UNO API
  • ↳   Basic Guide
  • ↳   Code Snippets
  • ↳   Extension Repository
  • ↳   Macro Repository
  • ↳   External Programs
  • ↳   Extensions
  • ↳   Extensions page
  • Community
  • ↳   General Discussion
  • ↳   Site Feedback
  • ↳   Forum Governance
  • ↳   User Experience (UX)
  • ↳   Announcements
  • Business
  • ↳   Institutions & Educational
  • ↳   Paid support
  • ↳   Consultants Directory
  •