<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Starting hsqldb database manager from the jmx console with jboss 6.0
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/s3lvatico">Simone Monotti</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/632454#632454">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p style="margin-bottom: 1em; font-size: 12px;">While using a database server login module for authentication in jboss 6, I found it very useful managing principals and roles with the hsqldb database manager gui. This can be invoked via the JMX console. There are no problems at all when the application server resides on the same machine from which I'm using the JMX console.</p><p style="margin-bottom: 1em; font-size: 12px;">Now I'm in the situation in which the application server runs on a different machine, say a linux box to which I connect via ssh, <em style="font-size: 12px; font-style: italic;">tail -f</em> the logs for debugging and stuff, and I develop on a machine with a plain Vista installation.</p><p style="margin-bottom: 1em; font-size: 12px;">Of course the JMX console is still accessible, but this time I can't manage to have the hsqldb database manager window showing up.</p><p style="margin-bottom: 1em; font-size: 12px;">I installed the classic XMing X server without any special configuration (I'm not very well versed in X servers, so I'm practically using the default settings), and all that I found was the need to set and export the DISPLAY environment variable on the remote machine so that it points to the development machine, as in:</p><pre class="default prettyprint" style="margin-bottom: 10px; font-size: 12px; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; padding: 5px;"><code style="font-size: 12px; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"><span class="pln" style="font-size: 12px; color: #000000;"> </span><span class="kwd" style="font-size: 12px; color: #00008b;">set</span><span class="pln" style="font-size: 12px; color: #000000;"> DISPLAY</span><span class="pun" style="font-size: 12px; color: #000000;">=</span><span class="lit" style="font-size: 12px; color: #800000;">192.168</span><span class="pun" style="font-size: 12px; color: #000000;">.</span><span class="lit" style="font-size: 12px; color: #800000;">0.5</span><span class="pun" style="font-size: 12px; color: #000000;">:</span><span class="lit" style="font-size: 12px; color: #800000;">0</span><span class="pln" style="font-size: 12px; color: #000000;"><br/> </span><span class="kwd" style="font-size: 12px; color: #00008b;">export</span><span class="pln" style="font-size: 12px; color: #000000;"> DISPLAY<br/></span></code></pre><p style="margin-bottom: 1em; font-size: 12px;">I also configured my ssh client (the simple putty) for X11 forwarding to the same ip address the remote DISPLAY variable points to.</p><p style="margin-bottom: 1em; font-size: 12px;">Now when I try invoking the database manager from the JMX console, I get this exception trace:</p><p style="margin-bottom: 1em; font-size: 12px;">{code:java}</p><p style="margin-bottom: 1em; font-size: 12px;">        ERROR [org.jboss.jdbc.HypersonicDatabase] (Thread-33) Failed to start database manager: java.lang.reflect.InvocationTargetException</p><p>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_17]</p><p>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_17]</p><p>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_17]</p><p>        at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_17]</p><p>        at org.jboss.jdbc.HypersonicDatabase$1.run(HypersonicDatabase.java:530) [:6.0.0.Final]</p><p>    Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment</p><p>        at java.lang.Class.forName0(Native Method) [:1.6.0_17]</p><p>        at java.lang.Class.forName(Class.java:186) [:1.6.0_17]</p><p>        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) [:1.6.0_17]</p><p>        at java.awt.Window.init(Window.java:385) [:1.6.0_17]</p><p>        at java.awt.Window.<init>(Window.java:438) [:1.6.0_17]</p><p>        at java.awt.Frame.<init>(Frame.java:419) [:1.6.0_17]</p><p>        at javax.swing.JFrame.<init>(JFrame.java:218) [:1.6.0_17]</p><p>        at org.hsqldb.util.DatabaseManagerSwing.main(Unknown Source) [:6.0.0.Final]</p><p>        ... 5 more</p><p> {code}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'd need some help <span> :-/ </span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/632454#632454">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>