Wsadmin distinguish between starting application and started application - websphere

I have an application that requires a long initialization before being completely deployed to a Webserver (WebSphere 8.5 for our use case). This initialization takes several minutes even out to half an hour and that is completely normal. I have been using the wsadmin command line tool to upload the ear file and then issue start for the application. Since the start time is long, wsadmin receives a read time exception and closes before the completion of the application initialization. If at this moment I issue a wsadmin command to see the status of the application:
wsadmin.sh -host $HOST -port $PORT -user $USER -password $PASS -c '$AdminControl completeObjectName type=Application,name='$APP',*'
I will get an answer meaning the application is running (http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Ftxml_appstate.html)
The same answer I get when the initialization has been completed.
So the question is how to determine the exact status of my application.
Thank you in advance.
P.S. I have already seen this post (How to get current application state from wsadmin console for WebSphere 7.0) but I am not sure how exactly I could follow the steps he is mentioning. Also I am running a single node and not a cluster.
P.S.2. Also is it possible to increase the time out for the wsadmin tool in the first place so as to avoid the read time out?

Related

Using SSHMon plugin with Jmeter- Plugin not capturing any stats

I have been working on Jmeter from quite sometime now and I have been trying to use Jmeter Plugin SSHMon , but I am stuck as even after configuring it completely it simply says "Waiting for samples" and does not render anything on the graph.
I am trying to execute the command on the Linux box and have passed all the relevant parameter for collecting the stats. But still I am not able to capture anything. Any help or pointer will be appreciated.
I also tried connecting the Linux box using Putty and executing the command and the command does work, but when I execute the test the Plugin does not capture anything
Please find the ScreenShot attached
In the majority of cases the answer lives in jmeter.log file, check it for any suspicious entries, if something is not working most probably there will be a cause identifier there. Also make sure to actually run your test as SSHMon is a Listener and relies on Sampler Results so if your test is not running - it will not show anything.
As an alternative you can use JMeter PerfMon Plugin which has EXEC metric so you can collect the same numbers, however PerfMon will require Server Agent to be up and running on the remote Linux system.
After a lot of trail and error I was able to get SSHMon working. Please find the solution below
Ok Guys, so its a lot tricky as you would expect. So I thought that installing the Perfmon Agent on the server made Jmeter collect the stats for SSHMon listner but there is a catch to it. To start off I will let you know that installing the Perfmon Agent on the servers and then using the plugin to collect the stats works smooth. You can definately use this option. But it requires for the Agent to be started everytime you want to run a test and if there are multiple servers you will have to restart on those server. Not sure if there is a way to automate the restart of the agent or to keep it running for a longer time. If you are lazy like me or you have installation restriction on the servers or hell bent on using SSHMon then what you need to do is stated below.
You should always start Jmeter with the command line argument --->
jmeter -H "Proxy" -P "Port" -u "UserName" -a "Password"
The arguments are self explanatory. Once you do that Jmeter will be launched, but wait its not done yet!!
When you start executing your test the command prompt in which you have started the Jmeter will prompt for Kerberos UserName [YourUsername]: you have to again Enter you username here, which you use to start Jmeter or login to you system. Followed by this it will prompt you to enter kerberos Password for your UserName: Enter Your Password and Voila!!
The thing is, it happens in the background so you never see what is happening on the Command Prompt you used to start Jmeter.
Please see below for more clarity.
Kerberos Username[UserName]: UserName Kerberos
Password for UserName: Password
I have attached the screen shot as well in the question as well as here showing the issue being resolved. Please refer "Solution ScreenShot". Cheers!!
Hope this helps Guys!! :)
Also please hit up for the answer if it helps you!! :)

Tomcat as a Service

I need to write a shell script in which I need to bounce the Tomcat server(it would possibly on anyone's system). Hence, I wanted to know how should I check if tomcat is ran as a service with "service tomcat6 start" or with the script "./bin/startup.sh"?
If this is for a production server: Assume that it's always started as a service. If you find out that it isn't: Find the person that started from the shell and fire them.
Hard words, but on production systems: Hand off, keep them operating according to a standard. If you automate the bouncing (restart): This is what you do.
Dangers when starting through startup.sh: The process will be started as whatever user executes the script - potentially lacking write permissions to the log and temp files, or ruining it for the next start through service tomcat start, when the service can't access those files any more.
Thinking of it: It might be a good idea to check (at least) the identity of the current user in startup.sh (or setenv.sh) and terminate if it's not the expected one. Thus effectively forbidding to ever run startup.sh as a regular user, including root.

Can a Windows service install another Windows service?

I am having trouble when I have one Windows service try to install another Windows service.
Specifically, I have a TeamCity agent running tests for me on a Windows 2008 AWS instance. The tests are written in Java, which shell out to a .bat script to install a service (let's call it Service A), giving it a unique name each time.
The offending line is in the .bat script: sc create "%serviceName%" binPath= %binPath% DisplayName= "%serviceDisplayName:"=%" start= %serviceStartType%. I believe as long as the service name is unique that should work.
And indeed it does work if I run the tests manually on the command line, using an administrator account. Service A is installed, the test completes and Service A is uninstalled at the end.
I have tried running the TeamCity agent as LocalSystem, as Administrator, and as another user that is member of the administrators group. I have also tried disabling UAC completely.
Presumably the problem is access denied type errors, although that is not clear at this point. There are a few avenues to explore still, but it is a simple question really: are processes running as services forbidden from installing other services? Are there special things I have to do to configure the machine/ account to allow it to do this?
The point of the test it to install and use Service A, so workarounds are not relevant - Service A must be operated as a black box.
Thanks!
There are no restrictions on creating services with regards to how the creating process can execute, as long as the process has the appropriate permissions. That is to say, a process could be running as a service and create another service -- the only consideration here is the appropriate permission level.
The problem that often occurs with running batch scripts from within processes (as opposed to directly through user input on the command line) is that the environment expected isn't always the environment that is loaded. In this case, it appears that the env variables referred to in the batch script weren't properly set when running as a service, which of course then caused the service install failure. Correcting the environment loaded when the batch script is shelled out is the correct solution here.

How to start automatically and run tomcat 6.0.37 version as a background process on Remote Desktop Server start up?

Currently I am running tomcat 6.0.37 version (64-bit windows) on remote desktop server(OS-Windows2008/64-bit), please help me to find answers for the following questions.
QUESTIONS
Q1) How can I run tomcat 6.0.37 version(64-bit windows) as a background process, after closing the tomcat server command prompt window?
(Note : "Tomcat windows service Installer" is not applicable for my scenario.)
Q2) How to start Tomcat 6.0.37 version(64-bit windows) automatically when remote desktop server(OS-Windows2008/64-bit) starts up and also when remote desktop server(OS-Windows2008/64-bit) gets restarted?
Please help me regarding the above questions with step-by-step procedure and some useful information regarding above questions.
Thanks,
Ashwini
The short version is you can't. The problems you are describing are exactly the type of problems running as a service is meant to solve.
I can't think of any valid reason why a web application couldn't run as a service. I'd challenge the supplier of your application as to why they are making such a claim.
Meanwhile, I'd run Tomcat as a service anyway. If the app needs access to network shares then you'll need to run the service as a domain user with access to those shares and make sure you specify them using the full UNC path rather than mapped drives.
I found the Solution on "How to start automatically and run tomcat 6.0.37 version as a background process on Remote Desktop Server start up?"
Step 1: In Environment Variables, set variable name and variable value as
CATALINA_HOME and C:\Tomcat6
Step 2: Environment Variables, set variable name and variable value as
CATALINA_OPTS and -server -Djava.awt.headless=true -Xms384M -Xmx1536M -XX:MaxPermSize=5750M(according to usage of your RAM size)
Step 3: Once installed tomcat service installer by setting the username = xyz, password= xyz and role=xyz-gui,manager-gui.
Then, in right corner of your desktop screen will get a Tomcat server symbol to start and stop the service. Right click on the icon, choose configure---->Java tab and enter those according to your system RAM.
In Java Options text box:
-Djava.awt.headless=true
-Xms1536M
-Xmx3072M
-XX:MaxPermSize=5750m(according to ur RAM size)
And set the values of:
Initial Memory Pool = 64MB
Maximum memory Pool = 5750(usage of RAM Size)
Thread Stack Size = 256MB
These steps are working perfectly for me. Tomcat service is running successfully without any problems.
Thanks,
Ashwini

VB6 application keeps lock on Access (.mdb) database after creation, causing an error 3028

Our application builds an Access database (.mdb) and then starts a different application with the Shell command which needs Read/Write Access to this very database. The problem is that on some systems our application seems erratically to retain an exclusive lock on the database, preventing the other application from accessing it. Only after closing down the first application can the other application proceed.
The specific Error that is raised is Error 3028, which seems to be specific for DAO 3.51 (Access '97) which we indeed employ. I cannot understand why some systems are affected (and then not consistently) and others never. I thought that it might be a timing issue and built in a Sleep period between building the database and launching the other application, but that does not help.
What is going on?
EDIT:
I now created a workaround by creating the database in a separate file and then copying it. Now the second program should always be able to access it and any remaining lock problems will surface in the first program, which I maintain. I will follow up later when our users have been able to test this.
Are you closing the connection to the DB before passing control to another EXE?
I had a similar issue previously which wasn't quite the same but from what you have described this is the approach I would try:
Before lauching the secondary application with the shell command.
Alongside the sleep period you have already employed you will also need to close the original program which generated the .mdb file.
I achieved this by shelling a windows batch file, and then immediately exiting the original program.
Batch file makeup as follows:
ping -n 5 localhost >NUL
start MSAccess.exe "C:\DB.mdb"
exit
This allows 5 seconds for the mdb file to be freed-up before launching, you could replace my Ms Access call with your secondary program.

Resources