eXist failed to start in a Tomcat engine (version 8.5.12 in my case).
I expected a nice deployment and start of eXist in a Tomcat environment (as suggested here)
Get Tomcat (mine is apache-tomcat-8.5.12).
Get eXist master branch sources (currently version 3.1.0).
Generate eXist-db WAR archive from the sources, using Ant: build.bat dist-war.
Copy the generated war to your installed Tomcat webapps directory and rename it to exist.war.
Start your Tomcat server, with the command: .\bin\catalina.sh start from your Tomcat installation.
In my case, eXist doesn't start. Here is the stacktrace, found in logs\catalina.out from the Tomcat installation (I put in bold relevant informations to me) :
17-Mar-2017 15:06:58.645 INFOS [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Déploiement de l'archive C:\Program Files\apache-tomcat-8.5.12\webapps\exist.war de l'application web
17-Mar-2017 15:07:09.784 INFOS [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
net.sf.saxon.trans.XPathException: I/O error reported by XML parser processing file:/C:/Program%20Files/apache-tomcat-8.5.12/webapps/exist/WEB-INF/classes/META-INF/resources/xhtml.xsl: C:\Program Files\apache-tomcat-8.5.12\webapps\exist\WEB-INF\classes\META-INF\resources\xhtml.xsl (Le chemin d’accès spécifié est introuvable)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:467)
at net.sf.saxon.event.Sender.send(Sender.java:171)
at net.sf.saxon.style.StylesheetModule.loadStylesheetModule(StylesheetModule.java:128)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:131)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:94)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:152)
at de.betterform.xml.xslt.impl.CachingTransformerService.getTransformer(CachingTransformerService.java:150)
at de.betterform.agent.web.WebFactory.initTransformerService(WebFactory.java:188)
at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:72)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4599)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5242)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: C:\Program Files\apache-tomcat-8.5.12\webapps\exist\WEB-INF\classes\META-INF\resources\xhtml.xsl (Le chemin d’accès spécifié est introuvable)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:440)... 25 more
java.io.FileNotFoundException: C:\Program Files\apache-tomcat-8.5.12\webapps\exist\WEB-INF\classes\META-INF\resources\xhtml.xsl (Le chemin d’accès spécifié est introuvable)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:440)
at net.sf.saxon.event.Sender.send(Sender.java:171)
at net.sf.saxon.style.StylesheetModule.loadStylesheetModule(StylesheetModule.java:128)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:131)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:94)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:152)
at de.betterform.xml.xslt.impl.CachingTransformerService.getTransformer(CachingTransformerService.java:150)
at de.betterform.agent.web.WebFactory.initTransformerService(WebFactory.java:188)
at de.betterform.agent.web.filter.XFormsFilter.init(XFormsFilter.java:72)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4599)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5242)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
17-Mar-2017 15:07:11.578 GRAVE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
17-Mar-2017 15:07:11.578 GRAVE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Erreur de démarrage du contexte [/exist] suite aux erreurs précédentes
17-Mar-2017 15:07:11.656 INFOS [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Program Files\apache-tomcat-8.5.12\webapps\exist.war has finished in 13 011 ms
I am not too sure if the devs want to keep to support WAR file deployment (tomcat in specific). It used to work but maintenance is hard and it limits our freedom in some technical designs. But maybe someone from the community can help out.
I wouldn't give up too easily ;-), it is working fine for most of the time! This issue seems very similar to https://github.com/eXist-db/exist/issues/1352, which is solely caused by the XFormsFilter. @dovikos , could you try and comment out the XFormsFilter sections (lines 321-336 in my local install) in the WEB-INF/web.xml file, and see if that makes the startup succeed?
If both are the same issue, I think the problem can be trimmed down to the betterFORM code or its configuration.
Thanks for the answers guys.
Indeed, when the XFormsFilter section is commented, I had no problem to start eXist on Tomcat.
Dovikos
@dovikos @rvdb Shall we close this as a dupe of #1352 then?
@joewiz, makes sense to me
@rvdb Great, and thanks for your insight that helped @dovikos overcome this problem!
Hopefully you continue to support tomcat deployment as it seems like a good option for linux users, it also seem like a robust and secure way to put exist into a production environment as there is a good AJP connector for apache and as it clusters easily and has good support for monitoring and debugging!
It all depend on support of the community....
Most helpful comment
@rvdb Great, and thanks for your insight that helped @dovikos overcome this problem!