Is there a way to reset the JRun server from within a ColdFusion page?
4 Answers
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.

- 12,316
- 9
- 38
- 55
-
2But that is not really "fixing" the problem. – Leigh Oct 08 '10 at 02:43
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.

- 3,669
- 2
- 27
- 36
-
2Good 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 Oct 07 '10 at 17:44
-
*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 Oct 08 '10 at 00:53
-
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 Oct 08 '10 at 04:42
-
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. – James T Oct 08 '10 at 13:59
<cfset myJrunObj = createObject("java", "jrunx.kernel.JRun")>
<cfset myJrunObj.restart(myJrunObj.getServerName())>

- 156,901
- 35
- 231
- 235

- 21
- 1
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...

- 750
- 4
- 7