Rumah > Soal Jawab > teks badan
项目是(spring+mybatis+oracle)
docker是安装在虚拟机下面的,jdbc连接的数据库是安装另外一台linux的物理机上面,本机测试能通过,但是到虚拟机里的docker环境下就报这个错误,是什么原因?
报错信息如下:
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01882: 未找到时区
)
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The Network Adapter could not establish the connection)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
習慣沉默2017-04-26 09:04:21
Jika bekas Docker perlu bersambung ke hos lain, anda perlu menggunakan pilihan "--net=host" semasa menjalankan, yang bermaksud bekas dan hos berkongsi rangkaian.
sudo docker run --net=host
淡淡烟草味2017-04-26 09:04:21
Cuba tetapkan mesin maya kepada mod rangkaian NAT. Selepas menyediakan, gelagat rangkaian mesin maya adalah sama seperti mesin hos, mengakses rangkaian luaran dan LAN di mana mesin hos berada.