Exist: Missing jar for install as service on Linux (systemV)

Created on 7 Mar 2017  路  19Comments  路  Source: eXist-db/exist

When installing as a systemV-init service, the wrapper configuration file uses groovy scripting but the interpreter is not available:

XXX $ tools/yajsw/bin/installDaemon.sh
...
************* INSTALLING eXist-db ***********************

Mar 06, 2017 4:03:56 PM org.rzo.yajsw.os.posix.PosixService getPid
INFO: wrapper pid file: /run/wrapper.eXist-db.pid
Mar 06, 2017 4:03:56 PM org.rzo.yajsw.os.posix.PosixService stop
INFO: Stopping eXist-db ...
INFO: lib not found: XXX/tools/yajsw/lib/extended/groovy/groovy-patch.jar
INFO: lib not found: XXX/tools/yajsw/lib/extended/groovy/groovy-all-2.3.11.jar
INFO: lib not found: XXX/tools/yajsw/lib/extended/commons/commons-httpclient-3.0.1.jar
...
Mar 06, 2017 4:03:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: error on creating script link ${if (new File('/etc/rc0.d').exists()) return '/etc/rc4.d' else return '/etc/init.d/rcX.d'}/S20eXist-db
Mar 06, 2017 4:03:58 PM org.rzo.yajsw.os.posix.PosixService install
INFO: error on creating script link ${if (new File('/etc/rc0.d').exists()) return '/etc/rc2.d' else return '/etc/init.d/rcX.d'}/S20eXist-db
Mar 06, 2017 4:03:58 PM org.rzo.yajsw.os.posix.PosixService install
...

Adding the groovy-all-2.3.11.jar and groovy-patch.jar from the YAJSW distribution version 12.08 to tools/yajsw/lib/extended/groovy/ solved the problem.

eXist-db 3.0.0 on Ubuntu 16.04.2 LTS

bug

All 19 comments

@ptrckb so it is not about the 'lib not found' message but really that things installing as a service does not work? I guess we need to add this then ASAP...

wow..... this pulls in many megabytes for one simple check :-/

@dizzzz correct, the 'lib not found' is only the cause of the issue.

So we should try to rewrite it instead since groovy should be optional and preferably only be required if the user chooses to use the scripting actively.

@ljo I don't see any value in rewriting parts of YAJSW. The only solution with Ant at the moment is to add the missing Jar files.

I don't think 'ant' has to do anything with this. it is only yajsw that upon install needs to create one symlink.....

@dizzzz My point was rather than with Ant there is no easy mechanism for optional dependency resolution (...a reference to improving on this with a modular build system in the near future). Also I don't think we should fork YAJSW, better to use it as is as much as possible.

@adamretter well as I tried to say.... the two jars are only required by yajsw ... we should not have left them out.

We just extracted only a part of the yajsw distribution. Nothing to do with ant. JAJSW requires a strict directory hierarchy; this cannot be altered afaik.

This would mean that e.g. with maven we should pull the whole distribution in the "resources" directory of a maven structure? how would that work? There is not a classic 'dependency' thing here.

@dizzzz I would use a Maven profile and plugin to only download the YAJSW jars on deman if you need them (i.e. when you want to install a service with YAJSW).

hmmmm, sorry we are on two different levels. I can not imagine to use maven in a runtime context. And in addition: how to deal with config files, log file locations, etc etc. From the installer, anything relevant should be in it. I have too many servers that cannot connect to the internet to download resources. What ever happens.... that scenario should always work, no hurdles....

@dizzzz Okay no problem, it was just a suggestion to improve things, I will keep your requirements in mind.

Yes, I don't know why there is such a hurry here. I started to investigate how to solve it they way outlined and then you close it.

Then I rephrase it -- why was #1371 merged in such a hurry when we were discussing we preferred another way to solve it?

@ljo I am happy to see and discuss another approach of course. However this was a really easy fix to make this work right now.

@ljo do you know different way to fix it or just reasoning that there can be different way?

"in a hurry" .... my original PR is 2 weeks old already, and it was quiet afterwards. No solution direction was given, so it seemed to be stalled.

Since the JAR files do actually solve the issue.... and is part of the original distribution, it looked for me like a good idea. For now it is probably the best thing to do, hence I pulled it in.

The jars solve the systemV issue. If there is a better way, I would be happy to reconsider the approach of this PR. But forking YAJSW is probably not the best thing....

re-studying .... I guess that we could create the links indeed easily in one (or more) of the scripts wrapper code. The challenge is that we already deviate significantly from the original scripts. We need to be sure that when a new version of YAJSW comes out we can easily diff n merge the improvements......

@ljo I had no idea that you started to investigate this, sorry.

Was this page helpful?
0 / 5 - 0 ratings