Ich bin neu in Docker Welt. Ich habe Anlegesteg-Container, der eine Spring-Anwendung ausführt, die keine Verbindung zu mysql herstellen kann, die außerhalb des Dock-Containers ausgeführt wird. Mysql läuft auf meinem localhost, der ein MAC ist. Ich verstehe Docker läuft in einer VM auf Mac. Meine jdbc-Verbindungszeichenfolge ist jdbc.url=jdbc:mysql://127.0.0.1:3306/
Jetty Docker Container mit Spring-Anwendung kann keine Verbindung zu mysql läuft außerhalb Docker Container
Im Folgenden ist die Ausnahme, die ich
nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 71 more
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:394)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:443)
at com.multi.enterprise.commons.jdbc.config.JdbcConfig.jdbcTemplate(JdbcConfig.java:57)
at com.multi.enterprise.commons.jdbc.config.JdbcConfig.namedParameterJdbcTemplate(JdbcConfig.java:52)
at com.multi.enterprise.commons.jdbc.config.JdbcConfig$$EnhancerBySpringCGLIB$$492af47.CGLIB$namedParameterJdbcTemplate$3(<generated>)
at com.multi.enterprise.commons.jdbc.config.JdbcConfig$$EnhancerBySpringCGLIB$$492af47$$FastClassBySpringCGLIB$$1a9e6a23.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at com.multi.enterprise.commons.jdbc.config.JdbcConfig$$EnhancerBySpringCGLIB$$492af47.namedParameterJdbcTemplate(<generated>)
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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 72 more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
... 86 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
... 89 more