-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Could not find or load main class Files... openhab2 as a service on Linux (see workaround at last posts) #401
Comments
Can you reproduce any problem with a "clean" installation, so that you can rule out that your update didn't mess anything up? |
Hi Kai, latest try was with everything clean but the conf/services dir. |
Absolutely clean installation behaves the same way. |
Perhaps I was ambiguous on my latest statement: a clean installation did not work either. |
Tried on freshly updated CentOS 7 with Java 1.8.0_121 and the service does not start, issuing the same error. |
Same problem with the windows service... fresh install, latest java. It ran fine forever, and broke when I upgraded to a new snapshot. This looks relevant: https://community.openhab.org/t/install-openhab-2-in-windows-10-as-windows-service/18375/6. |
@dynostatic : My config file has all those parameters and some more |
Well, the issue is by no means solved, but since I got no responses, I will close it. Perhaps if I later open it again I catch someone's attention... |
In my initial searches see you bumped into this issue as well so hopefully this helps someone code up the correct fix, there are a few ways to attack this. The error you are getting is simple - this wrapper the team uses can't find the main class files for its libraries. "Error: Could not find or load main class org.apache.karaf.wrapper.internal.service.Main" Reason: Incorrect configuration for the wrapper was defined by openhab. So... I started digging into the /userdata/etc/openHAB-wrapper.conf `#******************************************************************** Wrapper Properties#******************************************************************** Java Applicationwrapper.working.dir=%KARAF_BASE% It appears the team has refactored something some place as this file changed quite a bit from my last one but if you look above under "Wrapper properties" this entry pointed above uses KARAF_BASE. The libraries that are missing are actually in KARAF_HOME. It appears the %KARAF_BASE%/lib/wrapper/*.jar files (class file below) do actually exist and are the same file sizes as the ones in runtime & userdata so I left that as it was as I'm going to be lazy with this "patch" or fix. You have two options:
Hopefully this helps you out. I'll let the admins integrate a fix for it. I don't know how the config files are being generated and am not interested in learning that one :) |
Well, THANK YOU @DigitalBites , I find the java errors sort of misleading and couldn´t get beyond the class itself.
I collaborate on many open source lists for libraries I use, either providing code or helping with support. In this case, I will let others deal with the admins. Enough for me. |
By the way, this impacted startup on Mac osSierra as well. The ln solution worked there as well. |
@kaikreuzer What is the official fix for the issue/workaround described by @DigitalBites? |
This issue is still not solved and messes up the service installation on Mac OS X High Sierra. I just spent two days installing and reinstalling, adapting plist files, etc etc. Finally found this thread. For me, this was an additional error after JAVA_HOME not being set in the wrapper.conf file. It now seems to work. If this is an issue every user on Mac OS X will run into, it will deter 99% of them from using openHAB. |
Where does our doc actually talk about using service wrapper for MacOS? On https://www.openhab.org/docs/installation/macosx.html, I cannot find anything about it. |
Not sure about where I found this. On the other hand, in order to execute the process of service-wrapping, one has to call a specific option in the Karaf console called openhab:install-service that first does a lot of things and then explains quite detailed how to proceed for Mac OS X. It is not called generic:install-service, but specifically openhab:install-service, so my guess is that most people will think that this is managed by openhab. The standard way of starting an app as a service would be by creating a plist file of some program, script or... wrapped service and installing it in LaunchDaemons. However, I have tried the way that was described somewhere in the documentation (?) which involved just creating a plist file that runs start.sh) but ran into a lot of problems. The install-service gave me a lot more confidence about the suggested steps and is, I think, the right solution, if only the three values that are missing / wrong are filled out correctly. UPDATE Now I am not yet at the end of my struggles, as I can now manually run the wrapper but not with launchd, but I guess that is probably due to me or my plist file. Forum post to follow.... |
I hit this too. Brand new, first time install on High Sierra. 4.30 in the morning is no time for close inspection & debugging, so I'll be looking more closely after sleep, & update this accordingly. For me installing on my Mac is for learning openHAB & I plan to run it on Raspberry Pi for actual use. |
Same here. Bad first impression.. |
openHAB2 2.4.0 (on Windows WHS2011) still has this issue. |
@scaprile You should re-open this issue until it is fixed or addressed in the documentation and the configs and service scripts corrected. I had the following two issues on MacOS High Sierra, as mentioned by others now:
Clearly the applied symlink fix works best per the above comment here, but the wrapper configuration file should be fixed as well as the install-service script corrected to locate and set the JAVA_HOME path. |
@mkormendy ... I'm sorry I don't have the time to check right now, regarding openHAB I'm on "user mode". I've since then successfully upgraded and I'm now running 2.4, No issues on upgrades. The link is still there, however. |
Well I have it running, but I had to perform the fixes as indicated in this thread. I as well, am on openHAB 2.4 (macOS download). Upgrading openHAB shouldn't overwrite the config file if it exists already when attempting to use the script to set it up again as a service. Once you've set it up and fixed/filled-in the issues in it, any further upgrades shouldn't have a problem and will use the existing config file I believe. I will put together a ticket to address this and possibly create a pull-request for the documentation and as well an update to the config file and mac-specific plist file. |
I happen to have copies of old installations and run a diff on openHAB-wrapper.conf. It is changed by upgrades. |
well... openHAB 2.5.1 after years still has the same wrong wrapper-conf. |
Can confirm. This issue is still there. Wrong classpath, took me 30 minutes to track down. Actual problem seems to be in: |
Hi there...
I don't think this is related to #112 nor #132
Just upgraded my installation yesterday to the latest snapshot. Service was running fine.
Now it does not start. Enabled debugging in wrapper conf, checked userdata/logs/wrapper.log, not much interesting data (to me) but:
Then I go ahead and see if those files are there:
Then try to run them to see if there is some sort of a magic log that points me to the right direction:
Here, "java" is the same used by openHAB, 1.8.0_77
unzip successfully reads this .jar file and
This is as far as I'm able to get.
Will appreciate some help from you guys.
The text was updated successfully, but these errors were encountered: