• Post Reply Bookmark Topic Watch Topic
  • New Topic

running .bat file from jsp  RSS feed

 
yuvaraj vanarase
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i m tring to start an stop the jboss thr JSP using runtime frm java.
i can stop jboss using its shutdown.bat but i dont know why the run.bat is not getting executed and jboss is not starting.
And actually same code does work properly in separate java file.
I am new to JSP ...just learning. M i getting wrong somewhere??

plz kindly give me some updates an solution on this issue.

Thanx
yuvaraj
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would be using Runtime.exec() for that. And I'd suggest you to go through this first!

Article on Runtime.exec()
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no you couldn't.
By the time shutdown has run (so startup would have to be launched) the server is down so it can't execute the startup script.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yuvaraj,
You would need to create a new batch file that calls both shutdown and run to get around the problem Jeroen described.

Also, I strongly advise against doing this from a JSP. JSPs are meant for presentation. It should be done in a secured servlet. Secured because you don't want just anyone shutting down the app server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!