Sunday, December 13, 2009

Getting started with JINI in Ubuntu Linux

Get yourself running JINI in UBUNTU with the following steps :

Download the java version of JINI distribution from the following page, because the linux versions is facing some problems so its better to download the java version even if you are Linux users.

Run the Jini_2.1.jar from the command line by using the following command
java -cp Jini_2.1.jar install

follow the procedure for full or custom installation of JINI

After installtion go to jini2_1/installverify/support folder of the installation
Before you can run the launch-all you have to edit the launch-all file

search export LD_ASSUME_KERNEL=2.2.5 line in the file

comment this line in launch-all
export LD_ASSUME_KERNEL=2.2.5
#export LD_ASSUME_KERNEL=2.2.5

now run launch-all from the commandline

All the jini services will be started.
This completes the installtion procedure of JINI under UBUNTU and Linux platforms.

You can run sample application now.

Wednesday, December 02, 2009

facelet-taglib_1_0.dtd parse problems

Solution for parse problem of facelet-taglib_1_0.dtd in JSF/facelets

initial definition in taglib.xml

"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"


change it with the following

"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"

The warning message should resolve . It works for me.

Monday, November 30, 2009

could not synchronize with fileSystem problem in eclipse

could not synchronize with fileSystem problem in eclipse

This problem can be solved by following steps :

windows-> Preferences -> General -> Refresh Automatically

this should solve the synchronization problem with the file System.

Wednesday, November 25, 2009

java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

Problem with Running facelets

Environments : JBoss 4.2.0
Error : java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

Cause of Error : If we are getting such error while trying to run facelets with JBoss Server, then
the most probable cause for this is the library not included in path.

make sure you include these libraries\jars in \WEB-INF\lib folder.


With JBoss we dont need to include jsf libraries and jstl libraries.
Including above libraries should eliminate the error.
Note : Check if the JBoss distribution contains commons-collections and commons-loggin In such case we dont need to include these in our project as they are already included with JBoss distribution. ReIncluding these jars can cause problems of conflict. Also check whether commons-el jar is present on the server distribution or not, In such case it is also not required to be included in the project as by default it will be included in the Project during build.

Wednesday, November 18, 2009

Generics are not supported insource 14 use version 5 or higher error Netbeans

Generics are not supported insource 14 use version 5 or higher

This might be a common error while working with Generics in Netbeans.
The problem is that you are using older version of Runtime environment maybe 4 or less.

Solution :

Right click the netbeans project
Go to Sources
In source Binary Format select 5 or 6

Now you wont get the earlier error.

Tuesday, July 07, 2009

Dashain Ashirwad दशै आशिर्वाद

केटाहरुको दशै आशिर्वाद र अर्थ

आयुर द्रोणसुते श्रीयं दशरथे सत्रु क्षयम राघवे । ऐश्वर्यं नहुशे गतिस्च पवने मानं च दुर्योधने । सौयेर्म शान्तनबे बल हल धरे सत्यम चः कुन्तीसुते । बिज्ञान बिदुरे भवन्तु भवताम क्रिश्तिंचा नारायणे !

द्रोणको छोरा अश्वश्थामा को जस्तै लामो आयु होस् । दशरथको जस्तै श्रेय पाइयोस् । रामचन्द्रले जस्तै शत्रुलाई नाश गर्न सकियोस् । नहुस राजाको जस्तै ऐश्वर्य होस्, पवनको जस्तो गति होस्, दुर्योधनको जस्तो मान-मर्यादा कमाइयोस् । सूर्यका छोरा कर्णजस्तो दानी हुनु, हलोधारी बलरामजस्तै बलवान् हुनु, कुन्तीको छोरा ले जस्तै सत्य बोल्नु । विधुरजस्तै ज्ञान-विज्ञान, शास्त्र बुझेको हुनु, भगवान नारायण को जस्तै र्कीति हासिल गर्नु !

केटीहरुको दशै आशिर्वाद र अर्थ

जयन्ती मंगलाकाली भद्रकाली कपालिनीदुर्गाक्ष्यमा शिवाधात्री स्वाहास्वधा नमस्तुते ! जयन्ती मंगलाकाली भद्रकाली कपालिनी दुर्गा क्षमा शिवधातृ स्वहा स्वधा भनेको देवीका नामहरु हुन् जसलाई मन्त्रमा म नमस्कार गर्छु भनिएको छ ।

Monday, June 29, 2009

nagios email notification in gmail problem and solution

step 1 : check in templates.cfg . The configuration should be similar to the one below(in objects folder in my case)

# Generic contact definition template - This is NOT a real contact, just a template!

define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0

step 2 : check contacts.cfg

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit from generic-conta
alias Bishal Acharya ; Full name of user



# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.

define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin

Make sure we have contact and cotactgroup defined in contacts.cfg. In my case it is with my denominations.

step 3 : Check the commands.cfg file . Make sure we make /usr/bin/mailx in the configuration under Ubuntu systems. Also do install sendmail prior to doing this by using(sudo apt-get install sendmail) and check by command line that you can send mail by using command (mail . If you successfully sent your mail then your nagios too can send mail or else we again need to troubleshoot.

# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $ADMINEMAIL$

# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $ADMINEMAIL$

Make sure ADMINEMAIL has been set accordingly in nagios.cfg file as

step 4 : Time to check few things
check whether notifications are set or not in nagios.cfg file if not set it to 1, similarly also make notifications to 1 in services and host definitions, Nagios cant sent notifications unless you enable them.

Now reload your nagios and test by stopping one of the services like ssh or other anyone If you are lucky you will receive notifications according to the timing settings. If not check your log file.

Common problem :

Warning: Contact 'nagiosadmin' service notification command '/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: SSH\nHost: bishal\nAddress:\nState: CRITICAL\n\nDate/Time: Mon Jun 29 17:24:26 JST 2009\n\nAdditional Info:\n\nConnection refused" | /usr/bin/mail -s "** PROBLEM Service Alert: bishal/SSH is CRITICAL **"' timed out after 60 seconds

Solution for Nagios notification Timeout problem :
Go to nagios.cfg and increase the notification_timeout to some larger value, In my case i made it 600 from 60


Now again reload nagios and you should be alerted when any service goes down. Test it by stopping any service also we are notified when any service recovers. We may give our mobile phone email address so that we are alerted to our mobile phones when problem occurs instead of our computer.

Good Luck ! Comments are welcomed

Sunday, April 12, 2009

sudo not working in Ubuntu and Semantic package manager vanished

I have recently had a problem when sudo did not worked in Ubuntu, The problem was that whenever I tried to do sudo it would ask for my password but it wont carry out the action as per the command.Another symptom was that the synaptic package manager had vanished from the menu. It was a peculiar behavior for me because I had jumped from windows to Ubuntu and it was just few weeks I was trying on Ubuntu. I was trying to install Nagios and this problem suddenly arised when normally working sudo stopped working for my root user.

The problem with it was that I had accidently removed my root admin user from the admin group, So in order to fix I had to do the following steps :

step 1 : I started the computer in recovery mode
step 2 : I entered the root user space
step 3 : And finally I just added my user back to admin group by the following command
adduser username admin

And the problem was solved I again had my synaptic package manager in the menu and I could now do everything back again. I guess my experience might help some novice users.

user@user : adduser username admin

Comments are welcomed !

Monday, February 09, 2009