mybatis出现java.sql.SQLRecoverableException: IO 错误: Invalid number format for port number

java.sql.SQLRecoverableException: IO 错误: Invalid number format for port number
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
	at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:553)
	at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:254)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1510)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1575)
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2450)
Caused by: oracle.net.ns.NetException: Invalid number format for port number
	at oracle.net.resolver.HostnameNamingAdapter.resolve(HostnameNamingAdapter.java:187)
	at oracle.net.resolver.NameResolver.resolveName(NameResolver.java:133)
	at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:431)
	at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
	at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
	at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
	... 7 more

原因是把路径写成了jdbc.url=jdbc:oracle:thin:@//xxx.xx.xxx.xx:1521:xxx将端口号后面的:改成/就好了,例如:

jdbc.url=jdbc:oracle:thin:@//xxx.xx.xxx.xx:1521/xxx这样就好了

你可能感兴趣的:(mybatis出现java.sql.SQLRecoverableException: IO 错误: Invalid number format for port number)