lunes, 30 de enero de 2012

"Could not initialize class: sun.awt.X11GraphicsEnvironment" using JT400 AS/400 driver

If you get a "Could not initialize class: sun.awt.X11GraphicsEnvironment" exception when trying to create a JDBC pool to an AS/400 machine using JTOpen (JT400, com.ibm.as400.access.AS400JDBCDriver), is very probably you have wrong data related to your connection (bad user, bad password, etc.). This driver have a very odd behaviour which tries to show a graphical window when some errors occur (producing the error in headless environments). Try establishing the connection first with an universal JDBC client like DBVisualizer or write a Java class to make the connection manually to confirm your connection settings.