Automatically start Websphere after system reboot unix windows

This topic aims to start the Websphere process automatically after rebooting the system or even if the process is crashed for some reason it will restart the websphere process automatically.
  • There are several server processes that the operating system can monitor and automatically restart when the server processes stop abnormally.
  • To set up this function on a Linux® or supported UNIX® operating system, you must have root authority to edit the inittab file.
  • You can restart the server1 process, with the below example.
  • On a Linux or supported UNIX operating system, you must manually create a shell script that automatically starts any of the processes previously mentioned. Each UNIX shell script controls a single process, such as a stand-alone product instance. Multiple stand-alone Application Server processes require multiple UNIX scripts, which you can define.
  • For example you want to start the Websphere general server which is server1 to make the Websphere service up.
  • We perform this using the following step generally which is ..WebSphere/AppServer/bin#./startServer.sh server1
  • But to start this automatically you have to prepare a general script which will be triggered while system starts.
  • You can generate the script automatically by running the following command
  • ..WebSphere/AppServer/bin#./startServer.sh server1 -script -background
  • Now check in the ..WebSphere/AppServer/bin# directory for the newly created file with name start_server1.sh
  • Now the next step is to Locate the rc.was example shell script, which is in the app_server_root /bin directory.
  • Now by following the sample script rc.was create your own rc.s1 like shell scripts under ..WebSphere/AppServer/bin ..itself.
  • Create a new shell script for each process that the operating system is to monitor and restart. like rc.s1,rc.s2  etc s1: server1, s2:server2 ..
  • Edit the inittab file of the operating system, to add an entry for each shell script you have created.
  • Comments in the header of the rc.was file include a sample inittab entry line for adding this script to the inittab table.
  • Each inittab entry causes the operating system to call the specified shell script whenever the system initializes.
  • As each shell script runs, it monitors and starts the server process you specified.
  • For example, if you create the following inittab entry for a process, the rc.was shell script is run whenever the system initializes, and if the process goes down while the system is initializing into a machine that is operating at a runlevel of 2, 3, or 5:
  • was:235:respawn:/usr/WebSphere/AppServer/bin/rc.was >/dev/console 2>&1
  • Ok lets create entry for our server1 in the /etc/inittab  at the end of file like below
  • s1:2345:once:/opt/IBM/WebSphere/AppServer/bin/rc.s1 >/dev/console 2>&1
  • As we have already created rc.s1 and start_server1.sh under /opt/IBM/WebSphere/AppServer/bin when the server1 process goes down or when system rebooted the the Websephere server1 process will be made up automatically.
Hope this helps...
References : [1][2]

Read more


String comparision in Jython script class exceptions.NameError exceptions.NameError instance

I Started recently working on jython/python, and come across the following problems and here are the solutions for those
  • How to compare strings in the jython/python script
norm = "6.0.2.35"
if cmp(wsadminVers, norm) == -1:
     print "quote_required"
else:
    print "quote_not_required"
    quote = 0
    print quote
In the above code snippet cmp(wsadminVers, norm) will compare two string values in wsadminVers and norm. If wsadminVers less than norm it return -1. If both are equal it returns 0. If wsadminVers is greater than norm it return 1. So cmp method is very easy string comparison method in jython.
  • How to resolve this exceptions or errors
2010-02-25 03:14:40 CDSUpdateAPP.py checkWASVersion Entry ()
2010-02-25 03:14:40 CDSUpdateAPP.py main ERROR ('Update of application failed:', <class exceptions.NameError at 664938402>, <exceptions.NameError instance at 97256908>)
The above exception can be arise while running jythin scripts which has usage of undeclared variables. see example below.
 print super
The above is one of the code line in our jython script, in this case super is treated as variable and if it is not declared the above exceptions will results as super varibale is not initiated.
we can do some thing like
print "super" which will treat super as string and prints it on console.
P.S : Line spaces and alignment are very much important in python scripts 

Read more


WSVR0009E: Error occurred during startup Cannot get canonical host name for server

 [3/8/10 20:38:05:592 PST] 0000000a WsServerImpl  E   WSVR0009E: Error occurred during startup
META-INF/ws-server-components.xml
[3/8/10 20:38:05:602 PST] 0000000a WsServerImpl  E   WSVR0009E: Error occurred during startup
com.ibm.ws.exception.ConfigurationError: com.ibm.ws.exception.ConfigurationError: javax.naming.ConfigurationException: Cannot get canonical host name for server.
        at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:184)
        at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:139)


Caused by: javax.naming.ConfigurationException: Cannot get canonical host name for server.
        at com.ibm.ws.security.core.SecurityConfig.getHostName(SecurityConfig.java:2476)
        at com.ibm.ws.security.core.SecurityConfig.setValues(SecurityConfig.java:1041)
        at com.ibm.ws.security.core.distSecurityComponentImpl.initializeSecurityConfig(distSecurityComponentImpl.java:776)
        at com.ibm.ws.security.core.distSecurityComponentImpl.initialize(distSecurityComponentImpl.java:224)
        ... 27 more
Have you ever faced any such errors while starting the Websphere server ?

Resolving the problem
Ensure that the naming resolution works for the host name. In the example, the name lookup failed for host name.Run the following two commands and ensure that they return the correct information.

nslookup `hostname`
nslookup

If both are fine try to create entries in /etc/hosts file by resolving the IP of the host.
some thing like below
 #
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#
127.0.0.2       nc184120.tivlab.austin.ibm.com.tivlab.austin.ibm.com nc184120.tivlab.austin.ibm.com nc184120
9.48.184.120    nc184120 nc184120.tivlab.austin.ibm.com
Hope this will help solving ur problem

Read more


print the time,date and time zone in java program and change the time zone

Lets see how java uses the Timezone set on JVM. Lets print the current time and date of the existing time zone.
And then change the time zone to different time zone and observe the changes.
The below code will do the above purpose.
    public void testMain(Object[] args)
        {
            Date dt = new Date();
            System.out.println("Todays Date and time:"+dt);
            Calendar c = Calendar.getInstance();
            System.out.println("Current System timeZone : "+c.getTimeZone());
            System.out.println("current time : "+c.getTime());
            System.out.println("Current time in millis : "+c.getTimeInMillis());
            //Lets change the JVM time zone and see
            TimeZone cst = TimeZone.getTimeZone("CST");
            cst.setDefault(cst);
            System.out.println("new time zone: "+cst);
            Calendar curCal=Calendar.getInstance(cst);
            //System.out.println("New time Zone : "+curCal.getTimeZone());
            System.out.println("New time with : "+curCal.getTime());
            System.out.println("New Time in millis: " +curCal.getTimeInMillis());
            //Some other time operations      
            Timestamp timeNow = new Timestamp(curCal.getTimeInMillis());
            System.out.println("Time stamp type of timeNow= " + timeNow);
            sleep(10);
            //After some time
            c = Calendar.getInstance();
            System.out.println("Current timeZone : "+c.getTimeZone());
            System.out.println("current time : "+c.getTime());
            System.out.println("current time in millis : "+c.getTimeInMillis());
            //To pass the current local time format and display like that
            SimpleDateFormat DF = new SimpleDateFormat();
            System.out.println("Current sys time format : "+ DF.format(c.getTime()));
            SimpleDateFormat DF1 = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss");
            System.out.println("Change the Current sys time format : "+ DF1.format(c.getTime()));
        }
Corresponding output is as follows :
    Todays Date and time:Thu Mar 11 12:21:59 IST 2010
    Current System timeZone : sun.util.calendar.ZoneInfo[id="Asia/Calcutta",offset=19800000,dstSavings=0,useDaylight=false,transitions=6,lastRule=null]
    current time : Wed Mar 03 15:47:38 IST 2010
    Current time in millis : 1267611458390
    new time zone: sun.util.calendar.ZoneInfo[id="CST",offset=-21600000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=CST,offset=-21600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
    New time with : Wed Mar 03 04:17:38 CST 2010
    New Time in millis: 1267611458406
    Time stamp type of timeNow= {SysUpTime = 146714 days 6:56:24} {Timestamp = Wed Mar 03 04:17:38 CST 2010}
    Current timeZone : sun.util.calendar.ZoneInfo[id="CST",offset=-21600000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=CST,offset=-21600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
    current time : Wed Mar 03 04:17:48 CST 2010
    current time in millis : 1267611468406
    Current sys time format : 3/3/10 4:17 AM
    Change the Current sys time format : 2010-03-03 04.17.48
Explanation:
So by observing the output and code lines we can understand that the time changes according to Timezone used.

Read more


How to find Websphere Version in python/jython scripts WAS

How to find WebsphereVersion(Exact build number) in python/jython scripts ?

The following lines of code will give the exact WAS version along with build number when used in a jython or python script.

wsadminNode = AdminControl.getNode()
print wsadminNode
wsadminSvr = AdminControl.queryNames("node="+wsadminNode+",type=Server,*")
print wsadminSvr
#wsadminVers = AdminControl.getAttribute(wsadminSvr, "platformVersion")
# The above line also gives us the WAS version but it will not give the exact build number details.
wsadminSvrON = AdminControl.makeObjectName(wsadminSvr)
wsadminVers = wsadminSvrON.getKeyProperty('version')
print  wsadminSvr

Hope this helps in finding the WAS versions in a jython/python script.

The above when run with wsadmin.sh script some times it throws the following error.
AppSrv01\bin>wsadmin.bat -conntype NONE -javaoption -Xmx384m -f  C:/kb/1321CDSUpdateAPP.py -lang jython  -appServerName CDSServer  -logDir C:/kb -logFile test.log  -appFileName "C:\\kb\\test.txt"  -appName CDS -controlFile c:/kb/test.txt

2010-02-25 02:41:40 CDSUpdateAPP.py main ERROR ('Update of application failed:', , com.ibm.ws.scripting.ScriptingException: AdminControl service not available)

 The above error can be rectified by passing the hostname explicitly or else by changing the connection type to RMI and RMI port. When we run the above lines of code using connType none as below
./wsadmin.sh  -conntype NONE -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -lang jython  -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
It may through the error above we have seen
Solution for this will be
 -host with complete hostname or ipaddr is the alternate solution, since its a failure with Java
probably we can try  InetAddress.getAllByName(host)  in a standalone Java program and try to resolve it the same solution will apply to wsadmin as well.
Using Connection type RMI
./wsadmin.sh -conntype RMI -port 2809 -lang jython -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt
Using Host name and removing connection type NONE
./wsadmin.sh  -host nc145002.tivlab.austin.ibm.com -lang jython -javaoption -Xmx384m -f /opt/builds/1321CDSUpdateAPP.py -appServerName CDSServer  -logDir /opt/builds -logFile test.log -appFileName /opt/builds/test.txt -appName CDS -controlFile /opt/IBM/WebSphere/AppServer/bin/testctrl.txt


P.S: To find the different connection types and ports used by the Websphere installation, try open the Administration console using the url http://:9060/ibm/console/ in browser.

Read more


Big Banyan Tree,Srirangapatnam,Balmuri-Edmuri Falls,Chamundi Hills,St. Philomena's Church, KRS dam,Vrindavan Gardens,Mysore Palace

Trip to Mysore
(Big Banyan Tree,Srirangapatnam,Balmuri-Edmuri Falls,Chamundi Hills,,St. Philomena's Church, KRS dam,Vrindavan Gardens,Mysore Palace)

This was an unplanned trip for me, it is just to accompany my close friends. I was requested to join with them to fill the vacant seat in the cab. With this my visit to Mysore become fourth time. Still I feel worth exploring. Mysore(Garden city) is really place for travelers due to is unique history and rich heritage. Actually my friends intention is to visit Sri Chamundeshwari Temple primarily,but I added many to it, hope they enjoyed the trip. Of course I enjoyed undoubtedly because I just want to travel all the time.

The plan was to start by Indica cab (as we are just 4 members)by 5:30 AM, as usual and quite expected for me it started only at 6:50 AM due to drivers late arrival to our place. Usually it happens with one of our mates but this time the culprit was Cab driver, can't even scold him. Most of the journeys I did were very successful primarily due to the best planing and secondary due to best execution. Best execution role should be done primarily by cab driver and by the people in the trip. This time driver is not up to my expectations, I tried my best to motivate driver by speaking in Kannada also. He so reserved and also stubborn... What to say ?? Any way our journey started.
The very first place we reached according to plan was Big Banyan Tree,This is a 500 yrs old Banyan tree.A mere 25 kms from the Bangalore City.you can reach the spot either from Kumbalgod on Mysore Road or from Chennenahalli on Magadi Road.This is the fourth largest banyan tree in India.
It is in a village called Ramohalli about 6-7 km on the road that links Mysore Road with Magadi Road. This road is on the right about 5 km from Kengeri next to Rajarajeshwari Dental College.Take the road to the right at Kumbalagod junction on Mysore road. Further 7 Kms on this narrow road leads you to the Banyan Tree.But this place is not up to my imagination, we took some snaps and moved ahead. people started shouting for a sojourn for break-fast but I kiboshed them till we reach  Bididi village.
Finally we reached Kamat(new) hotel near Bididi and had break-fast. There we saw Javagal Srinath, former Indian cricketer. I think he was on a family trip. We took his autographs and took some snaps.
He was quite simple and normal, it happened to speak with him in our regional language Telugu too when he called one of our mates in Telugu. With this happy movement, trip made me more happy and we moved to wards Srirangapatnam via Ramnagaram and Channapattana.

Ramnagaram-This rocky land is an important silk cocoon-marketing center, 49 kms from Bangalore. The popular Hindi movie Sholay was shot here. Channapattana-Famous for its wooden toys and silks. It is located at 58 kms on the way to Mysore.we did not stop in these villages but still felt the speciality of these villages. Quickly we reached Srirangapatnam in less than an hour.
 
Srirangapatnam - around 123 Kms. from Bangalore on Mysore road.Town made famous by legendary warrior Tipu Sultan. We have seen Dariya Daulat Bagh and museum at Tippus summer palace.This garden was good looking than in my previous visit, may be due to more flowers. In this museum we can many paintings, swords, rifles,coins, medals and some of the Tippus clothes and utensils.Most of these paintings were narrating the battles done by Tippu sultan and most of them are collected from the magazines published in abroad countries. After having some photo shoot we moved towards Sri Ranganatha Swamy Temple, on the way we can still the see the fort and its traces. Sri ranganath temple is simply superb, here we can see god in the posture of sleeping on a snake.
Then our next stop is at Balmuri - Edmuri Falls, which just 15 KMs from Srirangapatnam. Balmuri falls is the famous of the two and many Indian movies have used this location to shoot song and dance sequences. These waterfalls are not actually waterfalls technically. Balmuri Falls is the primary attraction at the Ranganthittu Sanctuary.Hit the Bangalore-Mysore highway till you reach the bridge at Srirangapattanam. You"ll soon find directions to the bird sanctuary. Follow it until you reach the clean and speck sanctuary that can entice any being at a sight. We are disappointed at this falls because there is no water in the store and hence there is no falls. So we did not spend more 30 mins here quickly proceeded to Mysore city.

The first stop in mysore was at Sri Chamundeshwari Temple(Located on the Chamundi hills which is around 13 KM from city), we reached there at 2:30 PM though we know the temple timigs as below
Chamundeshwari Temple timings:+91-821-259-0027
7.30 a.m. to 2 p.m.
3.30 p.m. to 6 p.m.
7.30 p.m. to 9 p.m.
So we had lunch on the hill top itself and waited till 3:30 till the temple opens. We had quick and special darshan. The Chamundi maata here is made of gold and looking very delighting.
There is a huge granite Nandi on the 800th step on the hill in front of a small Shiva temple a short distance away. This Nandi is over 15 feet high, and 24 feet long and around its neck are exquisite bells.
The next stop was at The Mysore Palace - it is open to visitors from 6 am to 9 am and from 3.30 PM to 6.30 PM every day. It was almost like Museum, there we can see many photographs and paintings of the kings and their family. But still palace is worth by its royal and elegant look, we can just imagine how the king used to live. It took more than 40 mins to visit the whole palace and there was enough crowd due to some schools visit. I know that Palace will be Illuminated bu electric lights on Sundays, National holidays and on festivals(Timings : 7:00 p.m. - 9:00 p.m). I have seen the palace with lights twice before but my Friends missed it, as it was Saturday that day. Rite time to visit Mysore palace is during Dasara festival season. so I suggest everybody to visit this place during festival season.
Then we proceeded to St Philomena’s Church - Located about 3 kms from the city center is the imposing St. Philomena's church, a miniature replica of the Cologne cathedral in Italy. Built in the early 1930’s in the Gothic style, it is the tallest cathedral in India. Colorful stained glass panels depict the birth, the last supper, the Crucifixion, Resurrection and Ascension of Jesus Christ. Light filtering in through these panels imparts an ethereal ambiance to the inside of the church. The catacomb houses the statue and relics of the 3rd century saint Philomena. Twin spires rise up about 175 mts to the skies and can be seen for miles around. Visiting hours are from 8 am to 1 pm and from 5 pm to 8 pm. Don’t miss to see the illuminated church in the evenings.

Now almost everybody are slightly tired due to heavy heat and sun. Our last spot of the trip was Vrindavan Gardens and K R SDam(Krishna Raja Sagar dam). We reached there around at 6:50 PM, there was a huge crowd at entrance due to small entrance. The main garden entrance was under renovation. We paid for entrance tickets and we moved to wards our right of the garden as almost everybody are running in that route. I expected that people are running to see musical fountain which used to run during that time. We also blindly reached that place, as expected it was musical fountain.
But none of us are interested to see that, as we have seen such fountains many times in many places.
Then we quickly returned back and moved to wards left of the Garden, that side is really worth watching. it has many beautiful and big fountains. We can just recollect many of the old famous movies songs which were shot here. 

Ahh finally we concluded the trip and started return journey, we had some tifins at one of the hotels near mandya and reached Bangalore around at 12 PM.
P.S : Once I again I would like to thank my friends who initiated and invited me to this trip... 

Read more


Modelart R/C Helicopter-For indoor flight-3Channel infrared controlled mini helicopter

Its been around 3 years I thought of flying a toy helicopter, its fulfilled yesterday. We got a brand new Modelart R/C Helicopter. Its so cute and also very strong and powerful. The controls are perfect and they allow you to take full control of the chopper while it is flying. If I am not wrong this is the latest from this model-art. Its really a Fun for big boys like me. The propeller is not only flexible but also has a very good balancer.

 Its completely radio controlled one with out any wires. This is just 7 to 10 gms and 15 cms length due to its light weight it helps in doing miracles.
 I think this is best indoor and outdoor playable toy, which I missed since years. The LED lights with this are attractive with illuminating multiple colors which looks so good and let you flight in the nights also. Its extreme strength to withstand even after hitting big obstacles is only due to its powerful metallic body and design as well. Another thing I like with this is its stunning flight time, around 10 mins is flight time even in mild winds.
 The best and fastest charging mechanism to re-use the chopper is ultimate.

The battery power required for the remote is exactly 6 2A batteries which is some what disappointing. The leap forward and also back are the another plus points for this which allows you to make rounds and rounds.  Remote control with this pack allows you to set your frequency also. The micro control wheel help you to stabilize the chopper to make it fly in the stand still position. The best charging mechanism I have seen for the first time in this , the USB wire it self is provided with a LED which shows red while charging and stops glowing once charging chopper is finished. One point forgot to mention, its available for affordable price 1800 INR.

Read more

Translate

Enter your email address:

Buffs ...

Visitors


hits counter
View My StatsCheck Google Page Rank

Add to Google Reader or Homepage

Bookmark and Share

Tags


Powered by WidgetsForFree

Archives