In this case, the reassignment (substitution) of the tomcat-users.xml file is triggered,
But the reassignment (substitution) of the configuration file server.xml does not work, it remains the same.
I suspect that the problem is in the access rights to this file, numbers in the distribution image.
/bin/docker cp /tmp/server.xml bpmcore:/camunda/conf/server.xml
not work.
/bin/docker cp /tmp/tomcat-users.xml bpmcore:/camunda/conf/tomcat-users.xml
Replaces the target file, that is, it seems that the rights inside the file system of the distribution image.
The question is, how do we correctly replace this file ?
But the reassignment (substitution) of the configuration file server.xml does not work, it remains the same.
do you mean that the server.xml inside the container is not the one linked in? If so I cannot reproduce this.
If I run the following commands the docker container fails to start, cause the server.xml is not valid:
echo "foobar" > server.xml
docker run --rm -v $PWD/server.xml:/camunda/conf/server.xml camunda/camunda-bpm-platform:latest
The output shows that the server.xml was replaced:
Configure database
/camunda/conf/server.xml:1.1: Start tag expected, '<' not found
foobar
^
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
22-Mar-2017 14:23:55.524 SEVERE [main] org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException; systemId: file:/camunda/conf/server.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1451)
at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
22-Mar-2017 14:23:55.528 WARNING [main] org.apache.catalina.startup.Catalina.load Catalina.start using conf/server.xml: Content is not allowed in prolog.
22-Mar-2017 14:23:55.532 SEVERE [main] org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException; systemId: file:/camunda/conf/server.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1451)
at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
at org.apache.catalina.startup.Catalina.start(Catalina.java:613)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
22-Mar-2017 14:23:55.533 WARNING [main] org.apache.catalina.startup.Catalina.load Catalina.start using conf/server.xml: Content is not allowed in prolog.
22-Mar-2017 14:23:55.533 SEVERE [main] org.apache.catalina.startup.Catalina.start Cannot start server. Server instance is not configured.
Does this work on you setup? Cause if the server.xml is not replaced it should normally start?
Thank you for diving.
Understood the problem.
Here with this parameter you need to run the container,
So that /camunda/conf/server.xml is not recreated when tomcat starts in the container image: -e SKIP_DB_CONFIG = true
This flag is only responsible for server.xml creation, and not weather the container will cleanup existing database objects, right? I’m experiencing that container blows away all created persistence on restart.