Archive for the ‘Application Servers’ Category
nowadays i have been ‘realizing’ many proverbs i would say. well, i may post those experiences in a separate blog!
this is an infamous proverb we might have been coming across since our childhood during several occasions and we happened to hear from many people around as well. ‘everything happens for good‘ – this might make us feel irritated and like adding fuel to fire when we are ‘in’ the circle! yes, i mean it.
when we say it to others, it may not matter but only when we ‘experience’, it will give a totally different shape.
Today i got a call from office saying that the filesystem reached its 100% in Production. Despite being a holiday, it does not matter when you are on a production support :). You have to be available on 24*7 basis as per norms. Well, i just told the network admin (aka system admin) to move the heapdumps, javacore files (they are the files which the Java process writes into the filesystem when the running java process reaches out of memory) to the external hard drive so that we can get some space. but even after that, there was no luck :(.
I came to office and i did the usual work around. I stopped the application server and cleaned up the temporary files as well by archiving the log files. And moved those archived files to the external hard drive. still no luck :(. It was stubborn and showing 99% :).
Had been thinking what would be the cause and somehow started into the tuning, troubleshooting documents. In the middle, thought of bringing the server up. But to my surprise, the server was not getting started and it was showing some errors in the linux console. After some attempts, thought of killing the process as usual and while doing so, by mistake i killed a different process named ‘EmailService‘ which was on top when i searched for the ‘java’ processes running at present in the system. Usually there won’t be any other services than our regular application server process and the corresponding node agent. Till now i have not seen this EmailService and it was not attracting me too. So i went ahead in killing the process and then i found out the mistake when verifying after deletion.
In the middle, i just checked for the memory usage, it went again upto 100%. Wondering what might be happening!
Thought i have done a mistake and have to get it corrected, searched for the process or its corresponding scheduler (cronjob in linux which is similar to the batch file in windows to automate tasks) for starting the EmailService. There we found so many core dumps generated in the EmailScheduler :). Lucky are we! After taking backup of those core dumps and deleting them, we got 24% free space and the disk usage was 76% !!
When asked the colleague about the issue during the startup of EmailService, he told one more infomation that this email service would be generating some pdfs as well. After some usual searches, we found out in a subdirectory there were some 7600+ pdfs silently sitting and occupying minimum of 1.1 MB each. Few of them had around 2MB size and very few had 20 MBs.. 🙂 So altogether we got some 700 MB+ space in disk.
Had the ‘EmailService’ not been deleted accidentally, we would have ended up somewhere else. Atleast we would have wasted some more time when dealing with the ‘Production issue’.
Overall, we should not panic about the issues rather we should welcome! 🙂 — is that what i feel now! wat say?
The people in enterprise applications would have definitely got their hands dirty in dealing with a buzzword called ‘components’. As a component, it has to be searched first and upon successful return of its whereabouts, a reference to it has to be returned to the caller which becomes the first step of success to the programmer who is in need of it.
So, how can you search for a component? Obviously, with some of its properties that helps to identify the components uniquely in the arena where its deployed. Its up to the programmer to be aware of the correct JNDI name (Java Naming and Directory Interface) which helps to achieve the binding of the component with its unique name.
In case of Application Servers they may have some components deployed by themselves and they let the users make use of it with the enhancement support if required. Is there a way to find out all the components deployed and their JNDI names as well?
Well, i am not going to give the way for ‘n’ number of application servers available in the market except ‘WAS’ (IBM’s WebSphere Application Server). Probably, a later time i may be able to consolidate if i get a chance to try with other application servers. 😉
Here you go for WAS….
(i) Start your WebSphere Application Server (this you can achieve it by going to the ‘bin’ directory of ‘ApplicationServerRootInstallationDirectory’ and then double click on the batch file (in case of Windows, it would be “.bat” and in case of Unix like OS, it would be “.sh” [meaning a shell script]) named ‘startServer’.
Other way is you can directly go to the particular bin directly in the command prompt or shell (based on the OS) and then execute the batch file. This saves you in retaining the window. In the previous scenario where you just double click on the batch / script file the window may get vanished once the server is started. This holds for other Web Servers like Tomcat as well.
(ii) Wait for sometime till the application server is started and ready to listen. Usually it will take a couple of minutes to get started (without errors, obviously ;-))
(iii) Once the App. Server is started, issue the following command in the command prompt [if you have just double clicked on the executable batch/script file, you have to go to command prompt and navigate to the ‘bin’ directory].
“dumpNameSpace.bat -port <port_number>”
Usually the port number would be “2809” until and unless it is overridden. The command fetches you the list of components and their JNDI names. You can make use of it by redirecting it to a file in the command prompt like
“C:\IBM\WebSphere\AppServer\bin>dumpNameSpace.bat -port 2809 > namespace.txt”
The redirection symbol (the ‘greater than’ arrow mark in Windows OS) tells the OS to redirect the output of the previous command (dumpNameSpace.bat) to the next resource which is nothing but the file in our case and its name is “namespace.txt“. It will be saved in the current directory where this dumpNameSpace command is executed.