views:

61

answers:

3

Is there a way to reset the JRun server from within a ColdFusion page?

A: 

I believe the answer is no for security reasons. It would be bad from a security stand point for an application to be able to modify the JVM that it was running in...

Daniel Sellers
+4  A: 

No, you can't do that.

But just a suggestion if I may (and I don't mean to sound condescending here):

If you are trying to do a restart because of server performance I suggest you troubleshoot the real issue before even attempting to implement something like this.

  • Check your exception logs
  • Start using server monitoring
  • Check system resources

See where that leads you.

We used to have to restart our CF servers a lot, but with careful understanding of the problems and subsequent fixing we would very rarely need to do that now.

I hope that helps.

Ciaran Archer
But that is not really "fixing" the problem.
Leigh
+3  A: 

Yep, you can restart any service you want. Just write a batch file and run with cfexecute.

<cfexecute name="#filepath#restartjrun.bat"></cfexecute>

In the batch file something like:

net stop "Macromedia JRun CFusion Server"
net start "Macromedia JRun CFusion Server"

As Ciaran mentioned though, it's always best to solve performance problems than rely of temporary fixes like this.

Bigfellahull
Good idea to get the job done, but does it depend on permissions of the user running CF? If it works it's like CF pulling the trigger on itself :-P
Ciaran Archer
*If it works it's like CF pulling the trigger on itself*: Forcing your CF server to commit hara kiri. Talk about abuse. But seriously, even if it is possible, I too would question the reasons for wanting to do so
Leigh
It would prolly be better to create an ASP/PHP page to do this. Especially since I have found that if you need to restart the JRun service, a coldfusion page won't load anyway.
Tyler Clendenin
We have 2 instances of ColdFusion (subsite.website.com), and they very rarely seize up at the same time, I would put a page on the subsite to restart the main site and vice-versa.
Bubby4j