Friday, September 10, 2010

How to bring MyComputer Icon in desktop in Windows 7


To bring the MyComput Icon in desktop in Windows7. Click the Start menu, and then right click on the "Computer". Click on the "Show on Desktop" item in the menu, and your computer icon will be back on the desktop.

Wednesday, August 25, 2010

Exception in thread "main" java.lang.NoClassDefFoundError: javax.persistence.Cacheable

When you are working with Hibernate using the Annotations, you will get the following exceptions
Exception in thread "main" java.lang.NoClassDefFoundError:javax.persistence.Cacheable 
even though you have added the required libraries that comes with the Hibernate distribution final 3.5 as well as ejb3-persistence.jar.
The reason for this javax.persistence.Cacheable is part of JPA 2.0 specification. To overcome this issue, you need to add the following JAR file hibernate-jpa-2.0-api-1.0.0.Final.jar, which will be available under /lib/jpa directory in Hibernate distribution.

Happy programming

Initial SessionFactory creation failed.org.hibernate.AnnotationException: java.lang.NoSuchMethodException

When you have the default libraries provided by the Hibernate 3.5 (hibernate-annotations.jar)and also have the ebj3-persistence.jar to support the annotation feature, you will be end up with the following exception on runtime
Initial SessionFactory creation failed.org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
This is because of the incompatible types, if you are using the EJB based Annotations feature just, remove the hibernate-annotations.jar from your library. This will resolve the above runtime exceptions.

Saturday, August 14, 2010

java.net.BindException: Address already in use: JVM_Bind 8009

In most of our development machines, we would have installed so many things for our practice purpose, which will create hell of issues, on the port number. So many of you, have encountered the following exceptions, when starting our server
java.net.BindException: Address already in use: JVM_Bind 8009.
How to figure out which application is occupying my port
In Windows
1. In MS-DOS, send command "netstat -ao". You can get network information for all processes.

2. Find out the one using port 8009, get the PID.
3. Find out the process with the PID you just got from windows task manager and shut it down. (By default the Task Manager doesn't show the PID. You have to add it from the menu View Select columns)
4. That's it, restart your server

Friday, March 6, 2009

Difference between Puts and Print in Ruby

The difference between Puts and Print in ruby is, Puts appends a new line if it doesn't have at the end, while Print doesn't. Print outputs only what we have provided
print "Hello World", " by print\n"
puts "Hello World", " by puts"


//Output
Hello World by print
Hello World
by puts

Happy Programming

Thursday, February 5, 2009

SQL CE - NText, doesn't support more than 4000 characters

When using SQL CE and trying to insert data with NText type column that has more than 4000 characters I got this error
Type : System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : @TextContent : String truncation: max=4000, len=27811, value='In the email Content provide the following value,.
When i am looking into this issue, i came to know, that while dealing with NText, we need to add SQLCEParameter like this, to avoid the exception, Changing the command parameters as follows, resolve the issue.
SqlCeParameter textContent;
cmdEmail.Parameters.Add("@ID", ActivityDetails.Email.ID);


cmdEmail.Parameters.Add("@CCRecipients",ActivityDetails.Email.CCRecipients);

textContent = cmdEmail.Parameters.Add("@TextContent", SqlDbType.NText);

textContent.Value = ActivityDetails.Email.TextContent;

cmdEmail.ExecuteNonQuery();

Happy Programming

Wednesday, January 7, 2009

Black Day of Indian Market - Satyam Computers Conspiracy

The Indian stock market today Jan 07,witnessed one of the greatest fall, beacause of the Satyam scam, considered one of the biggest after Harshad Mehta and Ketan Parekh. This new has hammered the stock a lot, which touched a new 52 week low of 30.80, a leap drop of nearly 80%, cornering all those who have bought this share above 150 after Jan 01, to a sleepless night. Yeap, i am the one of those, who have been cornered.

Whom to blame? I thinks there is a consipiracy with the company auditors also, without their knowledge this cannot happen. What's the next step of SEBI, to guard the investors money from going into the hands of these culprits.

God sake, it is important to remember that Satyam doesn't make the entire Indian Software industry, still there are good reputed companies with honest managements in this country, and this scam is not going to represent India as a whole, it just represent a individual.

Hope the Black day for investors as well as the Indian IT industry will pass soon.