• Enter Slide 1 Title Here

    This is slide 1 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 2 Title Here

    This is slide 2 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 3 Title Here

    This is slide 3 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

Monday, December 18, 2006

Setting Java classpath option with spaces and quotes under Windows®

Java provides two methods for setting paths of the classes.
1. Set the command line option classpath
2. Set the CLASSPATH environment variable

The second option is easy, but has a draw back as a common CLASSPATH is shared within all the projects and classes, which makes it harder to test different projects with different classes.

So the first option is the prefered way. It is used as;
java -classpath first.jar;second.jar TestClient


When the paths to the jar files have spaces, the command line classpath option causes errors. Under Windows installation like 2000/NT/XP, all the users get a folder with the user name under a folder named "Documents and Settings" (which has a space). And if the jar files are under the user folder, path would look like "C:/Documents and Settings/someUser/.." which would cause the above error.

How to over come this issue
1. Put quotes and group the whole class path
java -classpath "C:/Documents and Settings/user/project/lib/axis.jar; C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient

2. Put quotes on individual paths
java -classpath "C:/Documents and Settings/user/project/lib/axis.jar"; "C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient

Sunday, December 17, 2006

Do not complain on what you haven't got

As human beings we always tend to complain on what we haven't got. Many people forget to appreciate the things that they have received; even they forget that they have so much to appreciate on their living status than looking at the negative sides.



For example think how you feel when your (expensive) meals are little less tasty than how it used to be. You get so annoyed, right?

Have a look at the images as they tell a lot on the above topic.





See how much you are fortunate to have this type of a life (even having a chance to have access to computers to do internet surfing while some people do not have a chance to get a drop of water.

(I have no idea on who is the owner of these images, but thanks for the nice images).

Wednesday, December 13, 2006

Change of "My day time world"


Yes, I said "My day time world". The company I'm working always becomes my day time world, but there are sometimes I happend to make it "My full day world" when project deadlines are getting closer.

Hey all, now I'm in a new company as I left the previous one after 2 1/2 years of experience there. It's about 1 1/2 months now in my new world. I could not do any blogging after I joined here, not because my new company do restrict it, since I had to do some home work and put extra time and effort to get to the speed on the new projects and all that.

Now I'm planning to spend some time here as well. So don't forget to come back often.

Sunday, October 8, 2006

[JBoss] Logging JBoss CMP SQL

JBossIn many occassions developers tend to get errors when calling the CMP finders. The best method to fix such issues is to view the generated SQL queries, as it's easy to understand the error in terms of general SQL rather than looking at the EJB-QLs.

With the help of log4j, CMP generated SQLs can be logged into a file as follows.

1. Goto the conf folder inside your server instance.
2. Open the log4j.xml file and add the following two entries to it.

<appender name="CMP" class="org.jboss.logging.appender.RollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="/log/cmpSQL.log"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="800KB"/>
<param name="MaxBackupIndex" value="1"/>
<layout class="org.apache.log4j.xml.XMLLayout"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
</layout>
</appender>

<category name="org.jboss.ejb.plugins.cmp">
<priority value="DEBUG" />
<appender-ref ref="CMP"/>
</category>

With the above given entries, a file named cmpSQL.log will be created inside the log folder. SQLs send to the server will be logged into this file. If required, name and place of the log file can be changed by changing the value in File param.
<param name="File" value="/log/cmpSQL.log"/>


Monday, September 11, 2006

[JBoss 4] How to change port 8080 in JBoss?

With default configurations, JBoss listens on port 8080 for web connections. But this can be changed easily as this port is defined in an configuration xml file.

This is how port 8080 is changed on JBoss 4.

1. Goto the deploy folder of the server instance you use.
2. Goto the jbossweb-tomcat55.sar inside that deploy folder.
3. Find the file named server.xml inside that folder. (tomcat service file).


Look for the HTTP Connector section inside the server.xml where 8080 configuration is available. Change the port value to what ever the required port number.

This change wiill be available when JBoss is restarted.

Related Articles

Wednesday, September 6, 2006

What is ACID?

In database world, ACID is an acronym. It stands for; Atomicity, Consistency, Isolation and Durability. Databases should have these four features for them to become a reliable databases. All of these four features relate with transactions.

  • Atomicity:
    A transaction has to be completely commited or roll-backed, a portion of the transaction should not be committed to the database due to any issue even on a hardware failure.
  • Consistancy:
    After any transaction the data in the database should be correct and vailid according to the requirements. Database should not be having any illegal data after a transaction.
  • Isolation:
    When two or more transactions exists, one's behaviour should not give invalid data for the other transaction. That is, when one transaction is in progress, the data alterations made by that transaction should not be visible to any other transactions.
  • Durability:
    After the commit operation is aknowledged by the database, the data inside that transaction should not be lost. The updating of those data into the database has to be guaranteed.

Related Posts:
What is CRUD?

Monday, August 28, 2006

Happy birthday to me

Birthday Cake
My 26th birthday

You know...
Leo Tolstoy one of greatest Russian authors was also born in the same day as myself, but in 1928. If he was here, he would have celebrate his 178th birthday.

I'm not a author like him, but a good logical thinker (as I feel).

Sunday, August 27, 2006

"I tried" Vs "I did"

Court
< in a court >

Judge : You have tried to kill him, and trying to kill is same as killing. So you have done a crime. I demand you to pay money of Rs: 1,000,000/=.

(Verdict thinks for a while.... Put his hand into his bag. Count cash and take Rs: 1,000,000/= to his hand and try to give it to the officer who waits to collect money. Then puts that money back into his bag).

Judge : Why? Don't you pay money? You have to pay it !

Verdict: (Softly) I tried to give him the money which is same as giving money.

Judge: (puzzled !!!!)


Even though this story is a bit debatable, there's something to learn.

I think TRYING IS CONSIDERABLE, BUT NOT IMPORTANT AS MUCH AS DOING SOMETHING.

So better to avoid saying "Yes I tried, but ...".
Say "Yes, I did it".

What do you feel?

Tuesday, August 22, 2006

Today's To Do List


This is a To Do list that matches many people who stay infront of a computer for the whole day. "Playing Solitaire" can be changed with what ever the game you play so that it can exactly match you. At the end of the day if you think a bit, you'll recognize that you haven't done anything valuable but just wasted the day.

If you are one of those, it's time to change the list and add something important to the list.

But this do not apply to all of you.

Wednesday, August 2, 2006

Four liquid stages of life

This is how life goes from birth to death of many people in this world.

Tuesday, August 1, 2006

My first ever article published

I'm really happy to announce that my first ever article (a tutorial) got published yesterday, which was related to JUnit one of the greatest unit testing tools for Java.

You can have a look the tutorial at JUnit - Getting Started

This was first published on my blog and due to the comments and appreciations from the readers, I decided to publish it.