Hi,
I am trying to install Xwiki with Docker in production. So I have to connect to a non docker mysql server. The application starts installation but on some point gives status 500 error.
The error seems to be caused by following rows:
Root Cause
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
jdk.internal.reflect.GeneratedConstructorAccessor118.newInstance(Unknown Source)
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014)
com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
jdk.internal.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:55)
org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:355)
org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:115)
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:665)
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:544)
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:221)
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:107)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:246)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:175)
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:473)
org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:84)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:689)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.build(HibernateStore.java:290)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.initHibernate(HibernateStore.java:231)
com.xpn.xwiki.store.XWikiHibernateBaseStore.initHibernate(XWikiHibernateBaseStore.java:193)
com.xpn.xwiki.store.XWikiHibernateBaseStore.checkHibernate(XWikiHibernateBaseStore.java:482)
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:867)
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:363)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:2116)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:2178)
com.xpn.xwiki.XWiki.getXClass(XWiki.java:6746)
com.xpn.xwiki.XWiki.getClass(XWiki.java:6759)
com.xpn.xwiki.doc.DefaultDocumentAccessBridge.isPropertyCustomMapped(DefaultDocumentAccessBridge.java:552)
org.xwiki.query.xwql.internal.QueryContext$PropertyInfo.isCustomMapped(QueryContext.java:153)
org.xwiki.query.xwql.internal.QueryContext$ObjectInfo.isCustomMapped(QueryContext.java:122)
org.xwiki.query.xwql.internal.hql.ObjectPrinter.print(ObjectPrinter.java:37)
org.xwiki.query.xwql.internal.hql.Printer.print(Printer.java:70)
org.xwiki.query.xwql.internal.hql.XWQLtoHQLTranslator.translate(XWQLtoHQLTranslator.java:61)
org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:97)
org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:306)
org.xwiki.wiki.internal.descriptor.document.DefaultWikiDescriptorDocumentHelper.findXWikiServerClassDocumentReference(DefaultWikiDescriptorDocumentHelper.java:121)
org.xwiki.wiki.internal.descriptor.document.DefaultWikiDescriptorDocumentHelper.findXWikiServerClassDocument(DefaultWikiDescriptorDocumentHelper.java:140)
org.xwiki.wiki.internal.descriptor.DefaultWikiDescriptorManager.getByAlias(DefaultWikiDescriptorManager.java:147)
org.xwiki.url.internal.standard.AbstractWikiReferenceExtractor.getWikiDescriptorByAlias(AbstractWikiReferenceExtractor.java:78)
org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.resolveDomainBasedWikiReference(DomainWikiReferenceExtractor.java:61)
org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.extract(DomainWikiReferenceExtractor.java:47)
org.xwiki.url.internal.standard.entity.BinEntityResourceReferenceResolver.extractWikiReference(BinEntityResourceReferenceResolver.java:51)
org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:87)
org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:50)
org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:61)
org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:47)
org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:65)
org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:43)
org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:93)
org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:48)
com.xpn.xwiki.XWiki.initializeResourceFromURL(XWiki.java:1026)
com.xpn.xwiki.XWiki.getXWiki(XWiki.java:891)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:285)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:218)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
Root Cause
java.net.UnknownHostException: "192.168.2.150"
java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:797)
java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:188)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219)
com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014)
com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
jdk.internal.reflect.GeneratedConstructorAccessor115.newInstance(Unknown Source)
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:55)
org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:355)
org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:115)
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:665)
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:544)
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
com.xpn.xwiki.store.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:221)
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:107)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:246)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:175)
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:473)
org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:84)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:689)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.build(HibernateStore.java:290)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.initHibernate(HibernateStore.java:231)
com.xpn.xwiki.store.XWikiHibernateBaseStore.initHibernate(XWikiHibernateBaseStore.java:193)
com.xpn.xwiki.store.XWikiHibernateBaseStore.checkHibernate(XWikiHibernateBaseStore.java:482)
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:867)
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:363)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:2116)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:2178)
com.xpn.xwiki.XWiki.getXClass(XWiki.java:6746)
com.xpn.xwiki.XWiki.getClass(XWiki.java:6759)
com.xpn.xwiki.doc.DefaultDocumentAccessBridge.isPropertyCustomMapped(DefaultDocumentAccessBridge.java:552)
org.xwiki.query.xwql.internal.QueryContext$PropertyInfo.isCustomMapped(QueryContext.java:153)
org.xwiki.query.xwql.internal.QueryContext$ObjectInfo.isCustomMapped(QueryContext.java:122)
org.xwiki.query.xwql.internal.hql.ObjectPrinter.print(ObjectPrinter.java:37)
org.xwiki.query.xwql.internal.hql.Printer.print(Printer.java:70)
org.xwiki.query.xwql.internal.hql.XWQLtoHQLTranslator.translate(XWQLtoHQLTranslator.java:61)
org.xwiki.query.xwql.internal.XWQLQueryExecutor.execute(XWQLQueryExecutor.java:97)
org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:306)
org.xwiki.wiki.internal.descriptor.document.DefaultWikiDescriptorDocumentHelper.findXWikiServerClassDocumentReference(DefaultWikiDescriptorDocumentHelper.java:121)
org.xwiki.wiki.internal.descriptor.document.DefaultWikiDescriptorDocumentHelper.findXWikiServerClassDocument(DefaultWikiDescriptorDocumentHelper.java:140)
org.xwiki.wiki.internal.descriptor.DefaultWikiDescriptorManager.getByAlias(DefaultWikiDescriptorManager.java:147)
org.xwiki.url.internal.standard.AbstractWikiReferenceExtractor.getWikiDescriptorByAlias(AbstractWikiReferenceExtractor.java:78)
org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.resolveDomainBasedWikiReference(DomainWikiReferenceExtractor.java:61)
org.xwiki.url.internal.standard.DomainWikiReferenceExtractor.extract(DomainWikiReferenceExtractor.java:47)
org.xwiki.url.internal.standard.entity.BinEntityResourceReferenceResolver.extractWikiReference(BinEntityResourceReferenceResolver.java:51)
org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:87)
org.xwiki.url.internal.standard.entity.AbstractEntityResourceReferenceResolver.resolve(AbstractEntityResourceReferenceResolver.java:50)
org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:61)
org.xwiki.url.internal.GenericResourceReferenceResolver.resolve(GenericResourceReferenceResolver.java:47)
org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:65)
org.xwiki.url.internal.standard.StandardExtendedURLResourceReferenceResolver.resolve(StandardExtendedURLResourceReferenceResolver.java:43)
org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:93)
org.xwiki.url.internal.DefaultResourceReferenceResolver.resolve(DefaultResourceReferenceResolver.java:48)
com.xpn.xwiki.XWiki.initializeResourceFromURL(XWiki.java:1026)
com.xpn.xwiki.XWiki.getXWiki(XWiki.java:891)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:285)
com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:218)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
I am using bridge connection to the host server where is also located mysql server. This is my docker compose file:
version: '3.8'
networks:
services:
web:
image: "xwiki:lts-mysql-tomcat"
container_name: xwik
ports:
- "8080:8080"
environment:
- DB_USER=xwiki
- DB_PASSWORD=xwiki
- DB_DATABASE=xwiki
- DB_HOST=192.168.2.150
volumes:
- xwiki-data:/usr/local/xwiki
volumes:
xwiki-data: {}
networks:
default:
external:
name: local-network