I'm running a set of applications on Karaf 3.0.1, on Windows Server 2008. I'm running into a problem with a 3rd party library one of my services depends on.
The karaf installation is running as a dedicated Active Directory service user account. If I log into the Windows server (using my own login), and open a command prompt as the karaf service user (using run-as), and I start up karaf, all of my processes work correctly.
But I want karaf to run as a Windows service. I followed the instructions to use the karaf wrapper, and it has installed as a service. I have it running as the same karaf service user I have used to run it interactively in the console, but whenever it is running from the Windows service, I get a message in the wrapper log that it "could not load or find" my 3rd party library. I'm not sure if I'm able to disclose the 3rd party library, but I believe it uses JNI for part of it's functionality, if that matters. There's a dll involved, and there is a copy of this dll in the deploy folder and both of the Windows\system32 / syswow64 folders for completeness. I've given full rights to the entire karaf folder to the karaf service user as well.
This seems like some sort of permissions issue, or that the wrapper service config is missing something but I don't see anything jumping out at me. What else would be different between karaf running as the service vs running it from the console with the same user credentials? Any other ideas?
edit: After going through further documentation on the wrapper I ended up placing my dll in the \lib folder under my karaf installation. After that my application appears to work.
Depending on the type of your dll, it might be because the provided service wrapper is a 32-bit only wrapper, this is because of licensing issues of the Tanuki Service Wrapper. So using the dll might work when starting with bin/karaf instead of using the service. If you want to use the Tanuki Wrapper you should be able to use it installing it by yourself. The latest and greatest version of it, just can't be shipped due to licensing issues.