eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
429 stars 179 forks source link

OS X installation problems: with user installed Saxon #1274

Closed duncdrum closed 7 years ago

duncdrum commented 7 years ago

What is the problem

Installation on os x fails using the dmg provided here downloaded using safari 10.0.3.

What did you expect

Installation to succeed.

Describe how to reproduce or add a test

system specs below: I uninstalled exist 2.2 and deleted /Users/$username$/Library/Application Support/org.exist. I logged out and back in. I then dragged the exist-db app from the /dmg into app folder. After copying I started exist via the app icon in my Application folder, and was greeted with the config window as expected (the one where you configure memory settings). I was told that admin pw would be empty and that I could set it via Dashboard. There was a slash screen, apps where installed etc. When trying to access Dashboard via the menu bar item I saw this: screenshot 2017-02-21 19 42 04 tried java admin client, which silently fails, after clicking connect. Quit exist, but the dock icon kept running. Quit that manually, logged out and back in. tried again same result. According to the log exist seems to have started normally.

Maybe the dmg file requires installation as root?

Context information

Please always add the following information

duncdrum commented 7 years ago

The jar installer doesn't keep a dock icon around after start, but still has the same error. Here is a link to the full log. two things stand out. 2017-02-21 20:06:58,448 [AWT-EventQueue-0] ERROR (Configuration.java [lookupModuleClass]:448) - Configuration problem: class not found for module 'http://exist-db.org/xquery/jndi' (ClassNotFoundException); class:'org.exist.xquery.modules.jndi.JNDIModule'; message:'org.exist.xquery.modules.jndi.JNDIModule'

and

2017-02-21 20:07:03,472 [Thread-3] WARN  (WebAppContext.java [doStart]:529) - Failed startup of context eXist-db Open Source Native XML Database 
javax.servlet.ServletException: de.betterform.xml.config.XFormsConfigException: java.lang.reflect.InvocationTargetException
    at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:76) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
…
Caused by: de.betterform.xml.config.XFormsConfigException: java.lang.reflect.InvocationTargetException
dizzzz commented 7 years ago

interestingly, It works for me, flawlessly.

duncdrum commented 7 years ago

@dizzzz are you starting by double-clicking on icon? or via CLI?

dizzzz commented 7 years ago

in essence: open dmg, pull out of dmg, double click on icon ; no cli

duncdrum commented 7 years ago

The problem starts when trying to use exist, the installer seemingly runs as expected. The jar worked on WIn7 (some mysterious messages aside) and AWS linux. Its not like haven't reinstalled 2.2 a couple of times. But neither .jar nor .dmg work on my copy of mac OS. Why would it complain about a betterform error though? and whats JNDI?

dizzzz commented 7 years ago

do you have 'polluted' system? firewall?

duncdrum commented 7 years ago

No firewall, the system is less then 4 months old, and had a clean install of Mac OS (no restore from backup). 2.2 installs fine.

dizzzz commented 7 years ago

The JNDI thing is not to worry about; i have this too. In the log i see

Caused by: java.lang.NoSuchMethodError: net.sf.saxon.functions.SystemFunctionLibrary.getSystemFunctionLibrary(I)Lnet/sf/saxon/functions/SystemFunctionLibrary;
    at de.betterform.xml.xpath.impl.saxon.XPathCache.<clinit>(XPathCache.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.load(DefaultConfig.java:101) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.<init>(DefaultConfig.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_121]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_121]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_121]
    at de.betterform.xml.config.Config.initSingleton(Config.java:129) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.Config.getInstance(Config.java:166) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.WebFactory.initConfiguration(WebFactory.java:153) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:68) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
Caused by: java.lang.NoSuchMethodError: net.sf.saxon.functions.SystemFunctionLibrary.getSystemFunctionLibrary(I)Lnet/sf/saxon/functions/SystemFunctionLibrary;
    at de.betterform.xml.xpath.impl.saxon.XPathCache.<clinit>(XPathCache.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.load(DefaultConfig.java:101) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.<init>(DefaultConfig.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_121]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_121]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_121]
    at de.betterform.xml.config.Config.initSingleton(Config.java:129) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.Config.getInstance(Config.java:166) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.WebFactory.initConfiguration(WebFactory.java:153) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:68) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]Caused by: java.lang.NoSuchMethodError: net.sf.saxon.functions.SystemFunctionLibrary.getSystemFunctionLibrary(I)Lnet/sf/saxon/functions/SystemFunctionLibrary;
    at de.betterform.xml.xpath.impl.saxon.XPathCache.<clinit>(XPathCache.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.load(DefaultConfig.java:101) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.<init>(DefaultConfig.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_121]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_121]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_121]
    at de.betterform.xml.config.Config.initSingleton(Config.java:129) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.Config.getInstance(Config.java:166) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.WebFactory.initConfiguration(WebFactory.java:153) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:68) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]Caused by: java.lang.NoSuchMethodError: net.sf.saxon.functions.SystemFunctionLibrary.getSystemFunctionLibrary(I)Lnet/sf/saxon/functions/SystemFunctionLibrary;
    at de.betterform.xml.xpath.impl.saxon.XPathCache.<clinit>(XPathCache.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.load(DefaultConfig.java:101) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.DefaultConfig.<init>(DefaultConfig.java:51) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_121]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_121]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_121]
    at de.betterform.xml.config.Config.initSingleton(Config.java:129) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.xml.config.Config.getInstance(Config.java:166) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.WebFactory.initConfiguration(WebFactory.java:153) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
    at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:68) ~[betterform-exist-5.1-SNAPSHOT-20160615.jar:?]

which might indicate a conflict of betterForm with a saxon.

We need "Saxon-HE-9.6.0-7.jar" , but we found "Checking for Saxon, found version 9.7.0.14" ....

did you put another saxon version 'somewhere on your system class path' ?

duncdrum commented 7 years ago

I do have another Saxon installed. Is that preventing jetty or just creating the errors in the log

adamretter commented 7 years ago

@duncdrum Did you install Saxon into your JRE?

dizzzz commented 7 years ago

I think it is on your java system class path ?

dizzzz commented 7 years ago

https://developer.apple.com/library/content/qa/qa1170/_index.html

duncdrum commented 7 years ago

@adamretter, @dizzzz yes, it's on the path and installed as jre extension. I use it for cli xls tasks

adamretter commented 7 years ago

@duncdrum Having it installed as a JRE extension will force any other Java app using that JRE to see that version of Saxon. I would suggest either:

1) Not having it installed as a JRE extension 2) Install a second JRE which you use just for eXist-db and set the JAVA_HOME to that when running eXist-db

duncdrum commented 7 years ago

@adamretter, @dizzzz not using Saxon as JRE extension fixes the installer problem. I ll have to fix the other instances where i actually depended on it being there. I really think that either during install or in the documentation some kind of warning should have been generated. That being said, thank you two so much for the extremely quick and effective help 🥇

dizzzz commented 7 years ago

I'll think on how to tackle ... the saxon version detection is not correct as it seems... it should check for an exact version

duncdrum commented 7 years ago

I ll keep it open then until there is a fix, want me to open a separate issue for the dock icon problem? This is installing from .dmg, after shutting down exist the dock icon sticks around, and activity monitor shows screenshot 2017-02-21 22 34 45

adamretter commented 7 years ago

@duncdrum Yes please a separate issue would be best.

adamretter commented 7 years ago

@dizzzz Actually eXist version detection is just meant to look for a minimum version, however betterForm is tied to an exact version.

duncdrum commented 7 years ago

@adamretter will do about the dock icon. As for the installation error, if any other Saxon then the version required by betterForm is a no no for installation, exist should inform users.

dizzzz commented 7 years ago
adamretter commented 7 years ago

@dizzzz Full classpath is absolutely huge. I would rather not report it - it could be a debug/trace option maybe

joewiz commented 7 years ago

Have we properly accounted for the fact that Betterform has a dependency on a specific version of Saxon? Should the presence of this version be checked and flagged on startup? If the classpath is useful for diagnosis, is it possible to output it only when an error is found, instead of all the time? Or is it best to always report it in debug/trace?

adamretter commented 7 years ago

@joewiz First let me say that I am not anti-betterForm or anti-XForms before other people start shouting.

But... I would like to get an idea about whether we have users that are using betterForm. betterForm locks us to a specific Saxon version. Subsequently updating betterForm each time for a new Saxon version with API changes is a lot of work (I have done it in the past ;-)).

As we get very very few questions about betterForm, I have a feeling that there are not many eXist-db users using betterForm with eXist-db. There haven't been any betterForm releases for a significant period of time. Also I note that the W3C XForms WG was disbanded some time ago.

Perhaps @JoernT and/or @windauer could comment on any betterForm roadmap plans?

p.s. I want this to be a constructive dialogue :-)

dizzzz commented 7 years ago

The hard dependancy is indeed a problem, as you point out. I actually have no idea where/how it is used at this moment......

duncdrum commented 7 years ago

hi guys my issues was that users following the install instructions encounter a critical error on macOS. I think debating the pro's and con's of hard dependencies in general, and the state of betterform /xforms should be a separate issues.