Sunday, December 03, 2006

Java Classloader Mystery

If you are writing system software, then you have to worry or deal with classloaders. Here is a nice blog entry on Classloaders from someone at Sun.
Understanding Java class loading

Now, for the second part of the article,
Understanding Classloading Part 2

If you are having scoped deployments in JBoss, follow this good post from Bill Burke
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028665
Please do not ever use Class.forName() in any of your code, but instead use Thread.currentThread().getContextClassLoader().loadClass().

Reason? The reason is scoped classloaders. Class.forName() will use the calling class's classloader. So, if your code resides in a jbossesb.jar someplace, your code will use the ESB server's (JBoss) classloader, rather than the scoped one of your ESB deployment. For example, if your actions are deployed in a scoped .esb file, then it will not run.

Thursday, November 30, 2006

Single Sign On or Federared Identity with JBoss

Enterprises have a growing need for Single Sign On and Federated SSO as need for integration within the enterprise as well as within a circle of trust with partners/customers is on the rise. The days are gone when you would just program for a select set of users. Today, you have to be open for the global world (that includes spammers and hackers too).


JBoss Federated SSO Framework is a decent beginning in this regard to provide some level of integration at the tomcat/JBoss level. The first beta version of v1.0.0 was released a few days back and has been well received.
JBoss Federated SSO at Berlin

You can check out the decent demo, download the beta version, use the Cheat-Sheet provided to run the demos and if needed, integrate the framework into your own applications.

Check out the beta version if you are interested in doing SSO with JBoss SEAM based applications.

Well, before you go, there is another issue that I think is relevant to the tech world in the US.
Click Here to know what the issue is
This is just an issue that I support.

HAVE A FANTABULOUS DAY!

Reviews of my sessions at JBoss World Berlin:
JBoss Security - Anil Saldhana
JBoss Federated SSO Framework - Anil Saldhana and Sohil Shah
JBoss World Berlin - Day Two

Now if you want to play with the two seam based demos, look at this cheat sheet:
Cheat Sheet

Tuesday, October 31, 2006

Daylight Savings Time (DST) in 2007

Well, if you are not aware of this, better get a sense of this, as it is going to affect JVMs, Operating Systems etc.
http://java.sun.com/developer/technicalArticles/Intl/USDST/

Here is a nice wiki entry:
DST Issues

Friday, September 15, 2006

Everything LDAP

Very interesting open source Directory Server project from Sun.
OpenDS

Ldap Tips:
a) Close your DirContext objects as well as NamingEnumeration objects.
b) Connection Issues
c) Referrals: System property:java.naming.referral to "follow"

Saturday, September 09, 2006

Lexmark All-In-One Center nuisance

Bought a lexmark AIOC (7170 series) at Sam's Club for 100 bucks. Ok, it is a 2004 line of printers but seems to do the work.

There was a nuisance to use the AIOC s/w, it would hang at "Preparing Lexmark AIOC for first time use".

A fix was this to apply the following patch:
AAIOC 7100 Series Patch

Wednesday, August 23, 2006

CipherOutputStream Annoyance

It is great that there is CipherOutputStream/CipherInputStream combo in Java, that allow you to encrypt a stream. But the annoying thing is that COS needs a close() to flush the data that is waiting in buffers to be padded.

Why can't a COS.flush() do it?

Dumb implementation choice.

Wednesday, August 16, 2006

Sunday, August 06, 2006

InfoStride

I am very happy that the company started by one of my best friends, Bhabani Sahu is taking off very well. Look at the latest press release:
InfoStride Partners With Convenos to Extend I-Portal eLearning Solution

I wish him the best of luck and do visit:
InfoStride

Sunday, July 16, 2006

Java Security Resources

Here is an excellent FAQ on Cryptography:

Crypto FAQ

A good writeup on SSL, JSSE etc:
IBM JSSE Guide

Learn the concepts!

Saturday, July 15, 2006

Gandhi in the Linux Community

I am unsure whether every Indian has understood the significance of this great man, that walked the face of the earth and meant so much to India. This man is Mohandas Gandhi (Mahatma Gandhi)

The quote that revolutionized the Linux community is:
First they ignore you, then they laugh at you, then they fight you, then you win.
- Mohandas Gandhi

Sunday, June 18, 2006

Java Escape Analysis in JDK6

Here is a decent writing on Java Synchronization Optimization, including Escape Analysis.
Java Synchronization Optimizations

Another IBM DeveloperWorks article:
Java theory and practice: Urban performance legends, revisited

Tuesday, May 30, 2006

XACML

I am playing with the Sun's open source XACML implementation available at:
http://sunxacml.sourceforge.net

Some of the immediate issues I have seen are:
Date Time Parsing issue

Tuesday, May 09, 2006

JBoss World in Las Vegas

I will be presenting two sessions at the JBoss World in Las Vegas. See you there.
http://www.jbossworld.com/index.htm

Monday, April 17, 2006

mod_jk versus mod_proxy

Before we proceed, please have a look at mod_cluster.

Now to mod_jk versus mod_proxy comparison:

A good blog post by Mladen Turk "Comparing mod_proxy and mod_jk".

Interesting reply from Bill Barker, one of the developers on mod_jk.
mod_jk versus mod_proxy under load ?

The moral of the links above is that due to persistent connections, mod_jk has better performance than mod_proxy. But the flip side is that mod_jk has extra configuration to set up, in comparison to mod_proxy.

From official documentation from Tomcat at: Tomcat Connectors, you can get the following snippet:

- "mod_jk" is great and should be used for production. It is getting fixes as needed (which is now rare).
- "mod_proxy". A cheap way to proxy without the hassles of configuring JK. This solution lacks sticky session load balancing. If you don't need some of the features of jk, jk2 - this is a very simple alternative.
- "mod_proxy_ajp". With apache 2.2, mod_proxy was rewritten to support load balancing as well as a new transport called mod_proxy_ajp. This module is distributed with the Apache http server, not the Tomcat server.


Interesting note from a sys admin (from his Feb 15, 2006 post):

Goodbye mod_jk hello mod_proxy


Another good article on the usage of Apache as a Forward or a reverse proxy using mod_proxy:
Forward and Reverse Proxies

Here is a blog on load balancing with mod_proxy:
LoadBalancingWithModProxy


....

Monday, April 10, 2006

Checking out Tomcat Source Code for TC 5.5.16

I am not sure if the only way to get the source code for the various modules needed to build Tomcat, on a branch is the following:

build module:
svn co http://svn.apache.org/repos/asf/tomcat/build/tags/tc5.5.x/TOMCAT_5_5_16/ build

container module:
svn co http://svn.apache.org/repos/asf/tomcat/container/tags/tc5.5.x/TOMCAT_5_5_16/
container

connectors module:
svn co http://svn.apache.org/repos/asf/tomcat/connectors/tags/tc5.5.x/TOMCAT_5_5_16/
connectors

jasper module:
svn co http://svn.apache.org/repos/asf/tomcat/jasper/tags/tc5.5.x/TOMCAT_5_5_16/
jasper

servletapi module:
svn co http://svn.apache.org/repos/asf/tomcat/servletapi/servlet2.4-jsp2.0-tc5.x
servletapi


I then have a build.properties file in the build directory, with the base path modified as:
base.path=C:/cygwin/home/asaldhana/tomcat55

Step 1:
Go to the build directory and do "ant download". This will download the components that are dependencies.

Tuesday, March 21, 2006

Albert Einstein's Performance Review of 1905

1905 is considered a monumental year in the life of Albert Einstein and his contribution to the field of science.

Here is a link to his performance review from his superior:
Einstein's Performance Review

Also here is another link that points to reviews of some seminal articles:
Reject

Saturday, March 11, 2006

Java Technical Tips and Other Resources

I see that the Technical Tips from Sun that appear as periodic newsletters are nuggets of gems.
Tecnical Tips

When you have some time, browse through these tech tips and reap the benefits of being informed.

There is a verbose technical article on Classloading issues in Java RMI and JINI Systems at: Research Paper

The new RMI in Java5: New RMI

Tomcat and OpenLDAP:Tomcat and OpenLDAP



Java Access Control Mechanisms



A case for WeakReferences

A good article on Weak References is:
Understanding Weak References

Tuesday, March 07, 2006

Friday, February 03, 2006

Getting Things Done

Last night, I attended the CJUG-West Symposium and was fortunate to hear Andy Hunt of the Pragmatic Programmer fame. His was a very thoughtprovoking presentation on "Refactoring your WetWare". Hopefully, all his teachings will see the form of a book by the end of the year. He stressed on the need for R-mode thinking in Software Development.

Andy, after the talk did mention about the concept of "Getting Things Done". There is a book by the same name and if you do not have time to scout for it, there is a related website/blog on this:
The Anxiety of Getting Things Done

Also, I would like to point out Andy's blog.
Andy's Hunt's Blog
Dave Thomas's blog

Some additional pointers from his talk:

  1. The Dreyfus Model

  2. "Drawing on the Right Side of the Brain", book by Betty Edwards

  3. Cultivating the R-Mode, Lazanov

  4. Hackers and Painters, by Paul Graham



Some salient points from the talk:
* Cultivate R-Mode Processing.
- White board. Sheets of papers and not computer keyboard.
- Think in isolation for few mins/hours with zero distraction.
- A notebook to jot down ideas and maybe a Fisher Space Pen.

* Accelerate Learning.
- Try doing it first.
- Take small pieces. Get it to work.
- Scan a book for its TOC. Read it once. Make notes/ask questions. Reread it again and then finally discuss it with colleagues.

* Manage the Torrent. (Manage the S/N Ratio)
- Make notes.
- Use a personal wiki.

Also, Andy pointed out that you can get free pocket organizers from Pocket Mod

Interesting statistic:
"Interrupted by email or IM, your IQ drops 10 points. You smoke a joint, IQ drops 4 points".

Also, "Context Switching is a killer to productivity".

References:
GTD Wikipedia

Thursday, January 12, 2006

Useful Unix/Dos Commands
1. Remove all files and directories with starting character from a-z
rm -rf `find . -name "[a-z]*"`

Subversion Info
Subversion Cheat Sheet
To checkout branch v0.5 of Apache Scout:
$ svn co https://svn.apache.org/repos/asf/webservices/scout/branches/v0.5

Monday, January 02, 2006

Hail Open Source

I had an old CD that was not playing on my cd player. Placing the cd in windows explorer, I found that the file types were .aiff (Apple's old format). Scouting for a converter that would convert from .aiff to .wav, I only found sharewares.

Scouting further, I found this project Audacity, an open source project that deals with music file converters. Nothing to pay - got the job done.

I use the open source GNU Dia to create diagrams like UML.

Then there is JBoss, Eclipse, Tomcat....

Hail Open Source!

Sunday, January 01, 2006

Java Performance Primer

For high performance computing using Java, threads are critical. Infact, they are absolute necessity.

Read up on Double Checked Locking Pattern at the following locations:
Wikipedia entry

Read up on Concurrency Patterns at:
Concurrency Patterns

Pointers to stack traces:
An Introduction to Stack Traces
Analyzing Stack Traces
Tracing Thread Activity Using Stack Dumps
Debugging Thread Related Hangs in the JVM
HPROF Agent

Tuning the JVM:
Tuning the JVM
TurboCharge Java HotSpot VM

Profiling Architecture

JVM Hotspot Options (look for stacksize settings):
JVM Hotspot Options

MacOSX JVM Options


TO checkout the options,
To see a listing of the interpreter's "non-standard" commandline arguments type the following statement at a commandline prompt:

java -X

The results of the "java -X" statement are therefore as follows:

-Xmixedmixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:
set search path for bootstrap classes and resources
-Xbootclasspath/a:
append to end of bootstrap class path
-Xbootclasspath/p:
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc: log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms set initial Java heap size
-Xmx set maximum Java heap size
-Xss set java thread stack size
-Xprof output cpu profiling data
-Xrunhprof[:help]|[:


Andy Oliver's GC Tuning EMail

Difference between Green and Native Threads
Java and Solaris Threading

Objects and Thread Seminar

Specifying the stack size per thread:
Non-standard way is to provide it as a command line option.
The other way is via the constructor introduced in JDK5.0
Thread Ctr

Annoyance with Socket Timeouts:
Socket Time Outs in Java