今天一大早,启动J2EE项目,出现了很奇怪的问题
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.awaitAcquire(BasicResourcePool.java:972)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:260)
... 47 more
连接出错,后来找了一下问题,把jdbc:oracle:thin:@192.168.1.148:1521:orclip修改为本地ip127.0.0.1,问题解决了,但是这样的话其它人特也不能连接我的项目。
后来启动myeclipse自带的连接数据库,也出现问题the network adapter could not establish the connection,问题还是没有解决。
后来在区修改oracle的tnsnames.ora文件,把内网的ip加进去。
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.148)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) 问题还是没有解决,不知道为何?