NoClassDefFoundError – java.awt.Color

Hey everyone,

I recently ran in to an issue where calling functions from java.awt.Color caused a "NoClassDefFoundError" in the JSP page. I restarted resin and kept refreshing this JSP page. I saw a different error message that looked like this:

java.lang.UnsatisfiedLinkError: /usr/java/j2sdk1.4.2_02/jre/lib/i386/ cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(
        at java.lang.ClassLoader.loadLibrary(
        at java.lang.Runtime.loadLibrary0(
        at java.lang.System.loadLibrary(
        at Method)
        at java.awt.Toolkit.loadLibraries(
        at java.awt.Toolkit.<clinit>(
        at java.awt.Color.<clinit>(
        at _map._test2__jsp._jspService(/map/test2.jsp:5)
        at com.caucho.jsp.JavaPage.service(
        at com.caucho.jsp.Page.subservice(
        at com.caucho.server.http.FilterChainPage.doFilter(
        at com.caucho.server.http.Invocation.service(
        at com.caucho.server.http.RunnerRequest.handleRequest(
        at com.caucho.server.http.RunnerRequest.handleConnection(

This error was much different from the previous error but shows that when AWT was trying to initialize it could not locate "". Through some more research I found that was part of the "xorg-x11-depreciated-libs" package in CentOS 4.5. I issued a "yum -y install xorg-x11-depreciated-libs" and a "ldconfig" to be safe and restarted resin. My java.awt.Color functions seemed to work perfectly after this.

Hopefully this helps someone!

Leave a Reply

Your email address will not be published / Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.