Invoking a process on the server from a servlet
I have the following code in my servlet, where 'out' is the HttpServletResponse object. Runtime t = Runtime.getRuntime(); try { Process proc = t.exec( c:\\TaskInfo.exe ); out.write( invoked ); } catch ( java.io.IOException ioe ) { out.write( ioe.toString() ); } What I'm getting is invoked in the browser window, but nothing visibly happens on my local machine( ie. server). I was hoping TaskInfo would start up. What I really want to do is open a file in notepad to tell me a visitor has just arrived. Am I barking up the wrong tree altogether. Should I generate an event and listen for it in another app running as a listener in the background, or is there just no way of invoking a process on localhost from a servlet. Thanks. If this is the wrong place to be asking these questions, please let me know. -- cf -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Invoking a process on the server from a servlet
The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. -Original Message- From: Stephen Clarke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:42 AM To: tomcat Subject: Invoking a process on the server from a servlet I have the following code in my servlet, where 'out' is the HttpServletResponse object. Runtime t = Runtime.getRuntime(); try { Process proc = t.exec( c:\\TaskInfo.exe ); out.write( invoked ); } catch ( java.io.IOException ioe ) { out.write( ioe.toString() ); } What I'm getting is invoked in the browser window, but nothing visibly happens on my local machine( ie. server). I was hoping TaskInfo would start up. What I really want to do is open a file in notepad to tell me a visitor has just arrived. Am I barking up the wrong tree altogether. Should I generate an event and listen for it in another app running as a listener in the background, or is there just no way of invoking a process on localhost from a servlet. Thanks. If this is the wrong place to be asking these questions, please let me know. -- cf -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Invoking a process on the server from a servlet
Mark is correct. If you want you can have the servlet write to a file every time you get a visitor and then write a seperate program that runs in your tooltray. The other program should read the file and when a new line is written then popup what ever it is you want to see. If it is in the your tooltray then the program will only work when you login. :) the servlet will just write to a special log file that is read by your new little monitoring program. goodluck, Brian -Original Message- From: Wagoner, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 9:46 AM To: 'Tomcat Users List' Subject: RE: Invoking a process on the server from a servlet The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. -Original Message- From: Stephen Clarke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:42 AM To: tomcat Subject: Invoking a process on the server from a servlet I have the following code in my servlet, where 'out' is the HttpServletResponse object. Runtime t = Runtime.getRuntime(); try { Process proc = t.exec( c:\\TaskInfo.exe ); out.write( invoked ); } catch ( java.io.IOException ioe ) { out.write( ioe.toString() ); } What I'm getting is invoked in the browser window, but nothing visibly happens on my local machine( ie. server). I was hoping TaskInfo would start up. What I really want to do is open a file in notepad to tell me a visitor has just arrived. Am I barking up the wrong tree altogether. Should I generate an event and listen for it in another app running as a listener in the background, or is there just no way of invoking a process on localhost from a servlet. Thanks. If this is the wrong place to be asking these questions, please let me know. -- cf -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Invoking a process on the server from a servlet
A few other thoughts of accomplishing the same thing: 1. You could enable Interact with desktop in the service that would allow it to open windows (but open huge security holes). Also if your site gets popular this will consume lots of memory when you can't close the windows as fast as they are opening. 2. Instead of opening a process you could send a message (via TCP) to an application that would catch it and display the message 3. Instead of opening a process you could update some internal list and then have a web page (access restricted if you want) that would display the results. Then you could do an auto-refresh header if you desired. 4. Make Tomcat SNMP enabled and then pass messages to the monitor interface. Then have your corporate management application listen for the events and display messages accordingly. -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:34 AM To: 'Tomcat Users List' Subject: RE: Invoking a process on the server from a servlet Mark is correct. If you want you can have the servlet write to a file every time you get a visitor and then write a seperate program that runs in your tooltray. The other program should read the file and when a new line is written then popup what ever it is you want to see. If it is in the your tooltray then the program will only work when you login. :) the servlet will just write to a special log file that is read by your new little monitoring program. goodluck, Brian -Original Message- From: Wagoner, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 9:46 AM To: 'Tomcat Users List' Subject: RE: Invoking a process on the server from a servlet The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. -Original Message- From: Stephen Clarke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:42 AM To: tomcat Subject: Invoking a process on the server from a servlet I have the following code in my servlet, where 'out' is the HttpServletResponse object. Runtime t = Runtime.getRuntime(); try { Process proc = t.exec( c:\\TaskInfo.exe ); out.write( invoked ); } catch ( java.io.IOException ioe ) { out.write( ioe.toString() ); } What I'm getting is invoked in the browser window, but nothing visibly happens on my local machine( ie. server). I was hoping TaskInfo would start up. What I really want to do is open a file in notepad to tell me a visitor has just arrived. Am I barking up the wrong tree altogether. Should I generate an event and listen for it in another app running as a listener in the background, or is there just no way of invoking a process on localhost from a servlet. Thanks. If this is the wrong place to be asking these questions, please let me know. -- cf -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Invoking a process on the server from a servlet
- Original Message - From: Wagoner, Mark [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, January 22, 2002 3:45 PM Subject: RE: Invoking a process on the server from a servlet The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. OK. Can you tell me for sure that trying to generate an event and 'hear' it in another infinitely looping application won't work? Personally, I've never generated my own events before so I am guessing wildly. Thanks, sc -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Invoking a process on the server from a servlet
If you want the messages to appear real-time, I think the previous suggestion to send a TCP message to a waiting listener app would be you best bet. This app could just sit there with an open window that scrolls any messages that it receives. -Original Message- From: Stephen Clarke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 11:08 AM To: Tomcat Users List Subject: Re: Invoking a process on the server from a servlet - Original Message - From: Wagoner, Mark [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, January 22, 2002 3:45 PM Subject: RE: Invoking a process on the server from a servlet The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. OK. Can you tell me for sure that trying to generate an event and 'hear' it in another infinitely looping application won't work? Personally, I've never generated my own events before so I am guessing wildly. Thanks, sc -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Invoking a process on the server from a servlet
Good points. I would NOT use interactive desktop at all. the program will die when you log out. don't do it! :) -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 9:21 AM To: Tomcat Users List Subject: RE: Invoking a process on the server from a servlet A few other thoughts of accomplishing the same thing: 1. You could enable Interact with desktop in the service that would allow it to open windows (but open huge security holes). Also if your site gets popular this will consume lots of memory when you can't close the windows as fast as they are opening. 2. Instead of opening a process you could send a message (via TCP) to an application that would catch it and display the message 3. Instead of opening a process you could update some internal list and then have a web page (access restricted if you want) that would display the results. Then you could do an auto-refresh header if you desired. 4. Make Tomcat SNMP enabled and then pass messages to the monitor interface. Then have your corporate management application listen for the events and display messages accordingly. -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:34 AM To: 'Tomcat Users List' Subject: RE: Invoking a process on the server from a servlet Mark is correct. If you want you can have the servlet write to a file every time you get a visitor and then write a seperate program that runs in your tooltray. The other program should read the file and when a new line is written then popup what ever it is you want to see. If it is in the your tooltray then the program will only work when you login. :) the servlet will just write to a special log file that is read by your new little monitoring program. goodluck, Brian -Original Message- From: Wagoner, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 9:46 AM To: 'Tomcat Users List' Subject: RE: Invoking a process on the server from a servlet The problem is due to NT (or 2000) not allowing the Tomcat service to interact with the desktop. If you bring up Task Manager, you will probably see your invoked process running, but it can't create window. In fact, the only way you will now be able to get rid of it will be to kill it in Task Manager. I don't know of any way around this. -Original Message- From: Stephen Clarke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 10:42 AM To: tomcat Subject: Invoking a process on the server from a servlet I have the following code in my servlet, where 'out' is the HttpServletResponse object. Runtime t = Runtime.getRuntime(); try { Process proc = t.exec( c:\\TaskInfo.exe ); out.write( invoked ); } catch ( java.io.IOException ioe ) { out.write( ioe.toString() ); } What I'm getting is invoked in the browser window, but nothing visibly happens on my local machine( ie. server). I was hoping TaskInfo would start up. What I really want to do is open a file in notepad to tell me a visitor has just arrived. Am I barking up the wrong tree altogether. Should I generate an event and listen for it in another app running as a listener in the background, or is there just no way of invoking a process on localhost from a servlet. Thanks. If this is the wrong place to be asking these questions, please let me know. -- cf -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Invoking a process on the server from a servlet
OK. Thanks to all. The thread got discombobulated in my reader. Anyway, I think I'll just write to a file and check it manually, or with a perl doo dad. TCP is a whole nother project. {:=o Thanks again to all who replied. -- Best, sc -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]