title: Could not create oracle database connection from jboss
body: <p>During my development, server(jboss4.0) was restarted because of some changes in java source and server failed to restart with the below stacktrace. </p>
  
  <pre><code>[JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
  org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4)))))
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:491)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
  Caused by: java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4))))
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
      at oracle.jdbc.driver.OracleConnection.&lt;init&gt;(OracleConnection.java:404)
      at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
      ... 150 more
  17:51:19,271 WARN  [SettingsFactory] Could not obtain connection metadata
  org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=
  </code></pre>
  
  <p>I have even successfully tested connection with a standalone java program and with ping. Also it is connecting from my oracle sql developer. I'm using oracle 9i.</p>
  
  <p>What could be the reason as its suddenly getting into this error? </p>