JChemCartridgeService won't start

User 46924c5277

24-08-2012 15:35:54

Hi,


I'm running into a problem on Windows Server 2008: the JChem Cartridge Service won't start. I've seen a couple of threads in the forum about the service not being created, but mine is created fine, it just doesn't run. I thought it might be that I didn't run the installation as Administrator (even though I'm logged in as Administrator), so I tried specifically opening a command prompt with "Run as Administrator" and deleting the service ("sc delete JChemCartridgeService") then reinstalling it ("install.bat --jcserver-only"). That successfully recreates the service, but it still doesn't run.


The error message I get when attempting to start the service is not all that useful. It tells me to check the Event Log or, if it's not a Microsoft service, to report it to the service vendor with service-specific error 0.  The event log says basically the same thing, except that it helpfully reminds me that the hex value of 0 is 0x0.


I can run the cartridge just fine with "server.bat start". 


I looked at the service to see exactly what it was trying to do, and ran that command in the commant prompt. Here is the output:

 C:\Program Files\jchem\cartridge>prunsrv-amd64 //RS/JChemCartridgeService
[2012-08-24 08:19:22] [427  prunsrv.c] [error]
The operation completed successfully.
[2012-08-24 08:19:22] [1336 prunsrv.c] [error]
Load configuration failed


On the off chance that was the wrong version of the command to use (the actual CPU is a Xeon), I tried just prunsrv instead of prunsrv-amd64.  That gives the exact same error message, modulo the time stamps.


This is a virtual machine running in VirtualBox, if that makes any difference.  It's also the 64-bit version of Windows 2008 Server.


Any suggestions on what to try next?

ChemAxon aa7c50abf8

24-08-2012 15:56:16

Hi,


Is this a new JCC installation or is this a formerly working installation which has just started to misbehave?


Please, could you send me the server.* files from the jchem/cartridge/logs directory?


Thanks


Peter

User 46924c5277

24-08-2012 16:05:22

Hi Peter,


This is a new installation.


There are two such files, server.stderr and server.stdout. Both of them are completely empty (0 bytes).

User 46924c5277

24-08-2012 17:04:19

In case anyone else runs into this problem (surely I can't be the only one) and comes across this thread in the future, I found a program called NSSM at http://nssm.cc/ which allows running a batch script  (or pretty much anything else) as a service. I'd obviously prefer an "official" solution, but having NSSM run "server.bat start" for me as a service is better than having to manually run it and leave the administrator logged in in order to use the cartridge.

ChemAxon aa7c50abf8

24-08-2012 18:03:08

Many thanks for sharing this with us and with our Microsoft Windows users. (I'd also love if Microsoft had an "official" solution to run batch scripts as Windows services -- if this is what you meant.) 


We've seen sporadic problems of starting the JCC service on Windows 2008 Server, but they appear to be of different nature: the service can start the server process (which then leaves useful traces in the error.sdterr file), but the server process dies due to another process (remnant from the JCC installation) blocking the JCC-port.


We will check NSSM out and will switch to it, if it turns out to be more generally stable than the solution (Apache Runproc) we currently have for this.


Peter

User 46924c5277

24-08-2012 18:08:16

I haven't actually tried it, but the documentation for NSSM says it monitors the service and can restart it if it stops, which seems like it might address the other issue you've seen as well.

ChemAxon aa7c50abf8

24-08-2012 18:27:00

I'd love to here your experiences. (There are several utilities like this out there, and most of them has some issues.) But I am also ready to continue working with you on the issue about our service's failure.


Hmm, I didn't pay attention to the VM product you are using: Virtual Box. JCC Windows service certainly hasn't been tested with it. As the error appears to occur in the no man's land of a successfully installed service and our process not being started by this service, I suspect some really low-level problem in your environment -- and VirtualBox would be a good candidate. I think it would be a good counter-test, if you tried if NSSM worked on it.


Peter

User 46924c5277

24-08-2012 18:39:10

I would not be too surprised if it turns out to be some incompatibility between VirtualBox and procrun, since I've never had this problem on a production system running on physical hardware (and it even seems to work fine on our virtual machines running under VMware). NSSM so far appears to be working beautifully on the VirtualBox VM, though: when I start the service, it runs the batch script and starts up the jchem server, and the server persists after I log off and back on again, which is considerably ahead of where I was this morning.

ChemAxon aa7c50abf8

24-08-2012 19:11:10

I opened an issue Windows 2008 Service Not Working On VirtualBox. But I am wondering if we will want to fully support VirtualBox. ("Fully" meaning here such niceties as Windows service.) We have VMWare, Xen, Oracle's Xen, RedHat's KVM (and who else's KVMs and XENs) -- all of them with much better "enterprise traction", I'd say, than VirtualBox. I personally know developers using linux runnng VirtualBox to host Gotomeeting and other Windows applications, or developers with OS X to run Oracle on hosted linux -- so it looks mostly a developers'/geeks' thing to me... What is your take on this? 


Thanks


Peter

User 46924c5277

24-08-2012 19:31:48

Well, we as a company are developers, and I can't in all honesty argue that I personally should not be characterized as a geek, so I wouldn't argue with a resolution of "fixed by documentation" (i.e. "The windows service doesn't run in VirtualBox").  Doubly true since prunsrv is Apache project software, not something written internally by ChemAxon.


I agree that it's not terribly likely that anyone would be using a vbox VM as a production system, and now that I've got a workaround I'm not tremendously upset about it.

ChemAxon aa7c50abf8

04-04-2013 12:39:06

Hi


We have recently been reported the same problem ("Windows service fails to start after successful installation") against a different environment (VMWare), so we took a closer look.


It turned out the issue is Java version specific rather than virtualization-technology-specific. The problem starts to occur with Java 7 (Java 6 still works fine). Using the newest version of the Apache Daemon (which we use to create and run the windows service for JChem Cartridge server) solves the problem. We will bundle this most recent version starting with JChem 6.1. In the meantime, please, try the new wrappers if you have a chance/time. You only have to replace the corresponding files in the jchem/cartridge directory with the files found here: https://shared.chemaxon.com/projects/jcc/Java7-compatible-Windows-service-wrapper/ style="color: #000000; font-family: Arial, sans-serif; font-size: 13.600000381469727px;"> .


Thanks,


Peter

User 46924c5277

04-04-2013 15:03:59

Thanks for the update!  I've since had it occur in environments other than VirtualBox myself (including on a native Windows PC), but I've just been using the NSSM workaround.  It's nice to have an "official" solution though.

ChemAxon aa7c50abf8

13-09-2013 17:29:12

Just for the record: JChem version 6.1 has been released with updated Apache Daemon support files.


Peter