Today a coworker taught me how to figure out what database instance I am using when using the isql command line tool connecting to Sybase. This involves two query statements:

select dbid from master..sysprocesses where spid = @@spid

The above statement will display the dbid of the database instance you are using. Next using this dbid to find out the name:

select name from master..sysdatabases where dbid = [dbid]

Thanks to Bob for this cool trick! :)

I found a need to debug JBoss with Eclipse. A search on google led me to ths page. I had to tweak a bit to get my local instance to work.

For example, I had to change the quote character from ” to “.

JAVA_OPTS="-Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS"

After that, JBOSS was able to load the new parameters correctly.

The post also have slightly different UI screen than what I see on my version of Eclipse. I did the following:

  1. Go to Run –> Debug Configurations … in the menu
  2. Rick click on Remote Java Application and choose New
  3. Choose the project of your choice. Change the address to 8787 to match the parameter specified for JBoss earlier. Change host name if necessary.
  4. Click Apply and then Debug

I was able to connect to the server and start debug the application. :)

Remote access to Jboss

Posted: August 10, 2011 in howto, Technology
Tags: ,

I didn’t realize that Jboss has a security “feature” to not allow remote connection by default until I read this post. Following the tip on that page helped me to access Jboss remotely. :)

History and tab panel in GWT

Posted: August 4, 2011 in Technology, howto
Tags: , , ,

I came across this tutorial and found it useful! :)

I came across the following tool today. Looks like exactly what I needed to work around the short sleep setting for the machine and prevent Windows from sleeping. ;)

While trying to setup JMS code, I encountered a few small issues and resolved them. Here are my notes:

Where in the world is ChapterExRepository? Here it is.

According to the following thread, one way to include log4j xml config file is to include the path to the file in the classpath.

search through text files

Posted: July 7, 2011 in Technology, howto
Tags: ,

Sometimes, firing up an IDE’s to do source code search might be more wait than I am willing to go through. So, here is an one-line command that I used to search through a directory full of source code:

for i in `find . -name "*.java"`; do egrep -H -n "search_string" $i; done

You may wish to replace file pattern and search pattern text to fit your needs.

SSO enable a web app

Posted: June 29, 2011 in Technology
Tags: , , ,

Yesterday, I finally SSO enabled a second web application using CAS (specifically CAS Java client) The process was relatively similar to the steps documented in the client page.

I found a need to retrieve a configuration value in web.xml and found the following post useful.

After I was so spoiled by GWT/Eclipse’s streamlined way of deploying a GWT application to the embedded server or Google App Engine, I was annoyed by how little support it has for other application servers. Fortunately, I was able to semi-automatically generate a WAR file for manual deployment on a remote server by following this tutorial :)

Back when I was working with Netbeans, deployment to a remote server was as simple as a single mouse click. On Eclipse, deployment to a remote server appears to be discouraged.