method8 schrieb:

I'm using the iText library to generate pdfs from a database on the
fly. Whenever I use some of it's features that require simple things
like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown:

java.lang.UnsatisfiedLinkError:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so:

libmlib_image.so: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        [...]
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)

After some research and verifying that libawt.so physically exists

But what about libmlib_image.so? That's the one it's complaining about.
Here's what I can see on a non-X Linux system:

$ ldd /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/libawt.so
        linux-gate.so.1 =>  (0xb7f67000)
        libmlib_image.so => not found
        libjvm.so => not found
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7eb1000)
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7ead000)
        libjava.so => not found
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7d52000)
        /lib/ld-linux.so.2 (0xb7f68000)

Still, compiling and running a color example works fine for me. (From
the command line, that is.) It works because of the built-in value for
the system property "java.library.path".

m...@seestern:~ > /usr/lib/jvm/java-1.5.0-sun/jre/bin/java LibraryPath
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/client
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/../lib/i386

Download an example that *I think* requires AWT.

http://itextdocs.lowagie.com/examples/com/lowagie/examples/directcontent/colors/SpotColors.java

m...@seestern:~ > javac -target 5 -bootclasspath \
  /usr/lib/jvm/java-1.5.0-sun/jre/lib/rt.jar \
  com/lowagie/examples/directcontent/colors/SpotColors.java

m...@seestern:~ > /usr/lib/jvm/java-1.5.0-sun/jre/bin/java \
  com/lowagie/examples/directcontent/colors/SpotColors
Pantone example : Spot Color

The result looks fine!

I read somewhere that whenever java is installed no a linux box
without x (in my case it's a remote vps) java omits certain graphics
related libraries like AWT (naturally).

There is no X11 server on that machine; the Sun Java is installed via
the package manager; everything seems fine.

I also read that you can run java headless to avoid the dependencies
to X. Now is there a way to run tomcat (or add variables to tomcat's
startup.sh) to avoid having these dependencies?

Aren't the dependencies simply required? I think the JVM wants to load
libmlib_image.so because it is needed.

--
Michael Ludwig

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to