Thursday, June 18, 2009

How to change OS boot priority in Ubuntu

Login as root user.
edit the following file

you could see list of all installed OS here as follows:
Note: I have installed Ubuntu and XP in my machine

Ubuntu 8.10, kernel 2.6.27-7-generic
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=1d034dd4-58c3-4ae9-abc0-c1b5e4591639 ro quiet splash


Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)

Ubuntu 8.10, memtest86+

Other operating systems:

Microsoft Windows XP Home Edition

The id start from 0.
0 = Ubuntu 8.10, kernel 2.6.27-7-generic
1 = Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
2 = Ubuntu 8.10, memtest86+
3 = Other operating systems:
4 = Microsoft Windows XP Home Edition

The following line is taking care of which OS to boot by default

default 0

this means by default Ubuntu 8.10, kernel 2.6.27-7-generic will be booted

If we want to boot XP as default, change this line to

default 4

save the file. When you boot next time by default XP will be booted.

Tuesday, June 16, 2009

java UnsupportedClassVersionError

While deploy java code into tomcat, it thrown exception as follows

SEVERE: Exception starting filter struts
java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(
at org.apache.catalina.loader.WebappClassLoader.findClass(
at org.apache.catalina.startup.Bootstrap.start(
at org.apache.catalina.startup.Bootstrap.main(
17 Mar, 2009 1:29:25 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext

The problem is version conflict [development machine java version is 1.5 but machine where i deploy has the 1.6 version]

To fix this problem we need to install java-1.6 version in the deployment machine.

Monday, June 15, 2009

JSP form getting submitted twice

When i was working in the struts2,hibernate and spring technology, strangely "null pointer exception" thrown for attribute which used in the form even i give valid input.

I dig this issue and found that, struts action called twice when i request for the URL. Again this also crazy for me. When debug the application, found that browser sending new request if any empty 'src' in the <img> tag present in the code.


<img src="">

In our case browser sent second request with empty form[no data] . so obviously "null pointer exception".

so take out or give the valid image src name and this will fix the problem.