Skip to main content

Posts

Showing posts from 2010

GlassFish V3 admin console taking too much time to load.

If you have installed Glassfish V3 and trying to load admin console, but after signing in, is it taking too much time to get to the main page ? Do you have server.log entry like this: admin console: initSessionAttributes() Cannot refresh Catalog : Connection timed out then its time to tweak some files. Here its how: 1. Update the %GLASSFISH_HOME/glassfish/domains/domain1/domain.xml -Dcom.sun.enterprise.tools.admingui.NO_NETWORK=true This will block up the News item, the registration item, etc 2. Remove update tool jar (Backup and remove this JAR) %GLASSFISH_HOME/glassfish/modules/console-updatecenter-plugin.jar Delete this dir: %GLASSFISH_HOME/glassfish/domains/domain1/osgi-cache %GLASSFISH_HOME/glassfish/domains/domain1/generated Now start the server (bin/asadmin start-domain) and you will see the admin console won't be hang up and take you directly to main page.

Read file outside the JAR

Hi All, I’m back from loooong vacation. Actually haven’t done anything great to blog about, only update is, I switched the company… Here is recent Java trick I found and I think I should share it.. Problem: I’m wondering about how can I read the file which is in the same directory of my executable JAR ? [Edited: Read the comment to get easy and obvious answer :)] Solution: Its simple, just get the current directory and append the file you want to access whose path is relevant to the JAR. Like /mydir/Myjar.jar /mydir/my.properties In order to read the “my.properties”, I just used the following code. FileReader reader = new FileReader(new File(new File(“.”), “my.properties”)); Simple.