Wednesday, February 11, 2009

Exception in thread "main" java.lang.NullPointerException on iReport

I have installed an ireport on my RHEL server. When I try to start the ireport it gives an error as

Exception in thread "main" java.lang.NullPointerException

But I am able to use netbeans for development so I came to a conclusion that there cannot be a problem with java, and I assume that it cannot be a bug of ireports, because I have a server with identical configuration which ireports works perfectly.

I checked the /usr/bin java link

[root@krisha ~]# cd /usr/bin/
[root@ krisha bin]# ls -l java
lrwxrwxrwx 1 root root 26 2008-07-02 14:56 java -> /etc/alternatives/java
[root@shaamil bin]#

Oh... That's the problem. My java installation is located on /usr/java/jdk6, but the link (/usr/bin) is pointed to some other place.

I corrected and pointed as follows.

[root@krisha ~]# cd /usr/bin/

[root@ krisha bin]# mv java java.back
[root@shaamil bin]# ln -s /usr/java/jdk6/bin/java /usr/bin/java

PROBLEM SOLVED…

Special Thanks to shaamil who edit this article ;)


Thursday, February 5, 2009

Java / JSF – Calendar control not working

I have developed a system on J2EE behalf for my last work place. Currently is maintained by the developer replaced for me. She called me last week and informed a nice problem. That all calendar controlls have stopped working. When click on calendar, No error messages, no popup and no other changes. The only thing which happens is it puts a “#” mark at the end of the address bar.
Environment:
1. CentOS 5
2. Tomcat
3. JSF
4. Netbeans 5.5

Eg:
http://localhost:8084/index.jsp

When click the calendar it change as
http://localhost:8084/index.jsp/#

I did some inquiries from her, because it could not be the problem of java script. Further ther is no way it could effect to all calendar controls at the same time, so what can be the problem?
Restarted all the services… Read the /var/logs…, checked the JDK and JRE, couldn’t find any alerts on above , my main problem still remained.
I did some guesses. I think it was a nice guess. Thought this could be a problem unique to this month (feb). I asked to change the system date to January. WOW. It iworked... then changed the date to current date (5th February 2009). then it stopped working again. Then I asked to change the date to 5th February 2008. Nice.. IT IS WORKING….. it means the problem is with the system date, when the calander comes to February 2009 the control stops working. (Problem is not month of February – it is February 2009) is there a relationship with leaning year? 2008 is a leaning year controll works fine. 2009 is a normal year controll stops working.!!
This is only a guess. Still I don’t know whats the reason or logic behind this. And also I didn’t test whether it can repeat for other years or not. I Just wanted to address this issue.

Special Thanks to shaamil who edit this article ;)