java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

Java.net JIRA | chuha | 6 years ago
  1. 0

    [GLASSFISH-15795] JDBC connections to Oracle over SSL fail - Java.net JIRA

    java.net | 11 months ago
    java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
  2. 0

    Connections to an Oracle database using JDBC over SSL fail. The same connection works properly when not using SSL. The same SSL configuration is working under Glassfish 2.1.1 and Glassfish 3.0.1. When attempting to ping the connection the following error is received. [#|2011-02-02T10:44:45.347-0500|WARNING|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=106;_ThreadName=Thread-1;|RAR8054: Exception while creating an unpooled [test] connection for pool [ __chrrproc ], Connection could not be allocated because: IO Error: The Network Adapter could not establish the connection|#] The full error trace: [#|2011-02-02T10:44:45.331-0500|FINE|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.gjc.spi|_ThreadID=106;_ThreadName=Thread-1;ClassName=com.sun.gjc.spi.CPManagedConnectionFactory;MethodName=createManagedConnection;|RAR5066 : Exception while getting pooled connection :{0} java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280) at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:139) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:88) at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:70) at com.sun.gjc.spi.CPManagedConnectionFactory.createManagedConnection(CPManagedConnectionFactory.java:131) at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:699) at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:427) at com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:1110) at org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:130) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:354) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:369) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1080) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1260) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1248) at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:202) at org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommand(TemplateExecCommand.java:127) at org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGet(TemplateCommandGetResource.java:78) at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:186) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:121) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:121) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1347) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1279) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1219) at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:180) at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:145) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:177) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:636) Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:375) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:678) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:238) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308) ... 60 more Caused by: oracle.net.ns.NetException: Unable to initialize ssl context. at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:296) at oracle.net.nt.TcpsNTAdapter.connect(TcpsNTAdapter.java:110) at oracle.net.nt.ConnOption.connect(ConnOption.java:123) at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:353) ... 65 more Caused by: oracle.net.ns.NetException: Unable to initialize the key store. at oracle.net.nt.CustomSSLSocketFactory.getKeyManagerArray(CustomSSLSocketFactory.java:369) at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:279) ... 68 more Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:788) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55) at java.security.KeyStore.load(KeyStore.java:1201) at oracle.net.nt.CustomSSLSocketFactory.getKeyManagerArray(CustomSSLSocketFactory.java:360) ... 69 more Caused by: java.security.UnrecoverableKeyException: Password verification failed at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:786) ... 72 more |#] The error seems related to the keystore. The server certificate is in glassfish truststore. Steps to reproduce: 1. Install Glassfish-3.1b40 using either the installer or zip archive on either Linux or Windows platforms. 2. Place the Oracle ojdbc6.jar from 11.2.0.2 in glassfish3/glassfish/domains/domain1/lib/ext. Note the 11.2.0.1 driver has bugs related to SSL that have been fixed in 11.2.0.2. 3. Create a JDBC connection pool. Resource type can be java.sql.DataSource or java.sql.ConnectionPoolDataSource. Choose Oracle as the database vendor. 4. Enter a JDBC URL that makes the connection over SSL. 5. Test the connection with Ping.

    Java.net JIRA | 6 years ago | chuha
    java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Error reading keystore

    GitHub | 5 years ago | forkner
    java.io.IOException: Keystore was tampered with, or password was incorrect

  1. kid 1 times, last 9 months ago
43 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.security.UnrecoverableKeyException

    Password verification failed

    at sun.security.provider.JavaKeyStore.engineLoad()
  2. Java RT
    KeyStore.load
    1. sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:786)
    2. sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    3. java.security.KeyStore.load(KeyStore.java:1201)
    3 frames
  3. Oracle jdbc
    OracleConnectionPoolDataSource.getPooledConnection
    1. oracle.net.nt.CustomSSLSocketFactory.getKeyManagerArray(CustomSSLSocketFactory.java:360)
    2. oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:279)
    3. oracle.net.nt.TcpsNTAdapter.connect(TcpsNTAdapter.java:110)
    4. oracle.net.nt.ConnOption.connect(ConnOption.java:123)
    5. oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:353)
    6. oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
    7. oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:678)
    8. oracle.net.ns.NSProtocol.connect(NSProtocol.java:238)
    9. oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)
    10. oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
    11. oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
    12. oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
    13. oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    14. oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
    15. oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
    16. oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)
    17. oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:139)
    18. oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:88)
    19. oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:70)
    19 frames
  4. Embedded GlassFish Web
    CPManagedConnectionFactory.createManagedConnection
    1. com.sun.gjc.spi.CPManagedConnectionFactory.createManagedConnection(CPManagedConnectionFactory.java:131)
    1 frame
  5. Connectors Runtime
    ConnectorRuntime.pingConnectionPool
    1. com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:699)
    2. com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:427)
    3. com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:1110)
    3 frames
  6. Embedded GlassFish Web
    PingConnectionPool.execute
    1. org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:130)
    1 frame
  7. Kernel Classes
    CommandRunnerImpl$ExecutionContext.execute
    1. com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:354)
    2. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:369)
    3. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1080)
    4. com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    5. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1260)
    6. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1248)
    6 frames
  8. GlassFish Admin
    TemplateCommandGetResource.processGet
    1. org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:202)
    2. org.glassfish.admin.rest.resources.TemplateExecCommand.executeCommand(TemplateExecCommand.java:127)
    3. org.glassfish.admin.rest.resources.TemplateCommandGetResource.processGet(TemplateCommandGetResource.java:78)
    3 frames
  9. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:616)
    3 frames
  10. Jersey
    WebApplicationImpl.handleRequest
    1. com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:186)
    2. com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
    3. com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
    4. com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:121)
    5. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
    6. com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:121)
    7. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
    8. com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
    9. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
    10. com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
    11. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1347)
    12. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1279)
    13. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
    14. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1219)
    14 frames
  11. jersey-bundle
    GrizzlyContainer.service
    1. com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:180)
    2. com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:145)
    2 frames
  12. GlassFish Admin
    RestAdapter.service
    1. org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:177)
    1 frame
  13. Grizzly WS
    GrizzlyAdapter.service
    1. com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    1 frame
  14. Kernel Classes
    ContainerMapper.service
    1. com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    2. com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
    2 frames
  15. Grizzly WS
    AbstractThreadPool$Worker.run
    1. com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
    2. com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
    3. com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
    4. com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    5. com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    6. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    7. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    8. com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    9. com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    10. com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    11. com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    12. com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    13. com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    13 frames
  16. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:636)
    1 frame