During my development, server(jboss4.0) was restarted because of some changes in java source and server failed to restart with the below stacktrace.
[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.<init>(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=
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.
What could be the reason as its suddenly getting into this error?
Related
I wish to use Hikari Connection Pool in my Spring application to connect to the Oracle Database
Below is the connection string
JDBC URL:
jdbc:oracle:thin:#ldaps://abc-def-dmz.demo.com:876/SOM_APP,cn=oraclecontext,dc=demo,dc=com
Getting the following error
Error Message: Failed to initialize pool: IO Error: JNDI Package
failure javax.naming.CommunicationException: localhost:876[Root
exception is java.net.ConnectException: Connection refused: connect]
How do I fix this?
java.net.ConnectException: Connection refused: connect
The error implies that your connection is being blocked, most likely by a firewall. Check with your DBA and system or network administrators to make sure the network path to the server is open, and that you are using the right port numbers.
I have a Spring Boot data JPA application where I am creating two data sources. I am getting this error when my application is booting up.
1. org.apache.tomcat.jdbc.pool.ConnectionPool init
SEVERE: Unable to create initial connections of pool.
java.sql.SQLException
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:253)
2. Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:245)
... 88 more
3. Jan 20, 2020 7:39:29 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: null
[http-bio-8080-exec-1] ERROR org.springframework.boot.web.support.ErrorPageFilter - Forwarding to error page from request [/orderForDateTopK/1/2] due to exception [Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection]
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:431)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
4. Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
5. Caused by: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
You're using Tomcat JDBC Connection Pool for your datasource, but in your application.properties you configured connection pool for Hikari datasource.
Your datasource is not instanced well, because of the connection pool settings.
your wrong configuration:
#HikariCP settings
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=15
spring.datasource.hikari.minimum-idle=1
You have 2 solutions
1- Change your connection pool settings from hikari to tomcat
like so
spring.datasource.tomcat.initial-size=
spring.datasource.tomcat.max-wait=
spring.datasource.tomcat.max-active=
spring.datasource.tomcat.max-idle=
spring.datasource.tomcat.min-idle=
spring.datasource.tomcat.default-auto-commit=
//..
Some useful guide in this field :
Configuring a Tomcat Connection Pool
2- Use Hikari Connection Pool instead of tomcat (Change datasource connection pool)
Some useful guide in this field :
A Simple Guide to Connection Pooling in Java
Introduction to HikariCP
Unable to establish a connection between IaaS Sql server and function App. I am getting SSL Key exception
I am trying to run a function in azure functions that were created in java. I establish the DB connection with the help of sqljdbc4.jar. This code runs successfully on a local machine, but when I try to run it on function app it throws below issue.
Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: \"java.security.ProviderException: java.security.KeyException: Key does not exist.\r\n\
Expected to establish a connection between IaaS SQL server and azure function.
I have a pretty simple commandline app that runs inside of eclipse that connects to an Oracle 12 database and issues a pretty simple query. I'm getting the following exception:
Exception in thread "main" org.javalite.activejdbc.InitException: Failed to connect to JDBC URL: jdbc:oracle:thin:#oratest2a.emspic.org:1521:workstst
at org.javalite.activejdbc.DB.open(DB.java:93)
at org.javalite.activejdbc.Base.open(Base.java:64)
at org.emspic.works.RegistrationUtil.doMain(RegistrationUtil.java:135)
at org.emspic.works.RegistrationUtil.main(RegistrationUtil.java:75)
Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset by peer: socket write error
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:752)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
Code throwing the exception is basically this:
// use properties to open the datasource for work
System.out.println("Opening database connection.");
logger.info("Opening database");
String dbDriver = dbProps.get("dbDriver");
String dbURL = dbProps.get("dbURL");
String username = dbProps.get("username");
String password = dbProps.get("password");
Base.open(dbDriver, dbURL, username, password);
logger.info("Database successfully opened.");
Everything I've googled indicates the problem is a "network issue"...except that on this same machine, I am currently connected to the very table I'm trying to open via TOAD...and I also am running a jboss as server connecting to that very same database...so there is no way it is a network problem.
I'm at a total loss.
Java1.8, ojdbc7.jar, all running on a Microsoft Surface Pro 3..., Oracle version is 12.0.2 running remotely.
Your exception has nothing to do with AcitveJDBC. There is a problem with your Oracle configuration. I bet you will get the same exception if you try just JDBC with the same parameters. When/if you fix your issue with JDBC, ActiveJDBC will work just fine.
I am doing a practical assessment task for my IT class and I am having some trouble with my database connection.
The error is:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error unable to open registry key'Temporary(volatile) jet DSN for process 0x858 Thread 0xa20 dbc 0x38825c Jet
with the throw, catch it said:
java.lang.NullPointerException