oracle weblogic - create new jdbc data source - connection test failed - oracle

I just installed oracle webligic 12.1.1, and I follow this videos's instructions:
youtube video
I write everything the same as in the video, when I wanted to test it, I got this exception:
Connection test failed.
IO exception: The Network Adapter could not establish the connection<br/>oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
weblogic.jdbc.common.internal.DataSourceUtil.testConnection(DataSourceUtil.java:298)
com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:746)
com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:474)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
...
...
What could be the error, how could I solve it? Please, help me! Thank you!

Error: The Network Adapter could not establish the connection
The main cause of the above issue is the database is down or not pingable or not reachble...check your db services...make sure it is running fine.

First you have to create a DB, with MySQL or Oracle Database( SQLplus ), but that you already have done.
Then you have to go in your IDE (Eclipse or NetBeans) and select the option to see Services like Databases and Servers.
In Databases with right click (in Netbeans) you can see the option "new database connection", enter your credentials of the database that you already have created and this should resolve your problem if you are using NebBeans.

weblogic gives us many database options to choose. you have to make sure your database up and running before you try to connect. Just try to create a small DB table and query it by 'SELECT' option and check your DB is perfectly running. Connect giving your DB details correctly like name and type of DB. DERBY database is the inbuilt database provided in weblogic.

In my case, the error was in Weblogic 12.2.1.3.0.
I was creating a new datasource connection using a tnsnames that works perfectly fine in WL 12.1.3.
The fix was add more TRANSPORT_CONNECT_TIMEOUT (from 3 to 10) in the connection defined in the tnsnames, because apparently it wasn't enough for stablish a connection.
After that, the error was:
Blockquote
Could not establish a connection because of java.lang.IllegalArgumentException: ONS configuration failed
I solved this by putting this in setDomainEnv:
-Doracle.jdbc.fanEnabled=false

Related

Oracle Database connection from Eclipse not working

Eclipse Version: Neon.3 Release (4.6.3)
On New Database Connection Profile/Wizard, I select Oracle as Database Type add ojdbc 8 jar and enter requested details for Oracle instance running on remote server.
I enter server, port and service values as I enter in SQL Developer (where I am able to connect), but connection test never succeed from Eclipse.
Once values are entered it constructs JDBC URL (which is not editable) in below format:
jdbc:oracle:thin:#server:port:service
Error message:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Though I wanted to directly provide jdbc URL "Connection URL" field is not editable.
After some more digging found it in one of Eclipse bug reports. Thanks to Mike Hatherly for workaround, reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382063#c3
Work around provided by Mike Hatherly:
"I have found a workaround. If you export the Database connection details, you can then manually edit the property org.eclipse.datatools.connectivity.db.URL to include the missing '/'s, then re-import and overwrite the current connection. Doing this however shows the connection properties in Eclipse as missing values, although the connection works correctly."
So before exporting you would 've saved connection profile with password and everything and Export un-encrypted. And the correct URL format when using ServiceName: jdbc:oracle:thin:#//server:port/ServiceName

sprigBoot jpa connection refused to database

today I moved my webapp project from my desktop pc to my laptop, I literally only zipped everything and moved it to this other system,
the database name and the schema is the same, so the application properties file should still have the correct parameters to connect,
but it gives me
java.net.ConnectException: Connection refused: connect
I already triedup dating maven, the project, restarting the listener of the database, if I connect from sqlDeveloper it works
here's the application properties:
# OracleDB connection settings
spring.datasource.url=jdbc:oracle:thin:#//localhost:1521/orcl.station
spring.datasource.username=C##GEST_SHOP
spring.datasource.password=admin
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle12cDialect
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true
the only difference between the dbs is that this one on the laptop doesn't need a password to connect, of course I aleady tried removing it from the application properties but it still doesn't work
please help
I found the error, this new database is on the port 1522 instead of 1521, i can't run a test tho because oracle is giving me other stupid connection errors on sqlDeveloper like doesn't know the SID which is total bs because I successfully connected before on those properties, damn I hate oracle

Unable to connect to remote Oracle database using DBeaver

I am trying to connect to a remote Oracle db from my mac using DBeaver.
Dbeaver version I am using is: 5.1.3
I installed the ojdbc6.jar file from the below link:
http://www.oracle.com/technetwork/apps-tech/jdbc-112010-090769.html
as instructed by the DBeaver tool. I added the above file in the driver manager window.
When I try to connect to the database I get the following error(dbeaver-debug.log):
Connection failed (oracle_thin-16161616-16161616)
2018-07-21 13:16:06.749 - org.jkiss.dbeaver.model.exec.DBCException: Connection has timed out
org.jkiss.dbeaver.model.exec.DBCException: Connection has timed out
at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:157)
at org.jkiss.dbeaver.ext.oracle.model.OracleDataSource.openConnection(OracleDataSource.java:133)
at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:86)
at org.jkiss.dbeaver.model.impl.jdbc.JDBCRemoteInstance.initializeMainContext(JDBCRemoteInstance
If anyone has suggestions as to how I can debug this issue, would be highly appreciated.
Thank you.
Are you able to connect via other tools (like SQL Developer)? if no then please try that as well. There can be multiple reasons for connection timeout. It is also possible that port in remote system is not accessible.

java.sql.SQLException: ORA-28040: No matching authentication protocol DSRA0010E: SQL State = 99999, Error Code = 28,040

I am trying to change the datasource in WebSphere pointing to some other environment. I am able to connect it using toad or sqldeveloper. However when I am trying to test the connection from websphere, it is giving the following error.
"java.sql.SQLException: ORA-28040: No matching authentication protocol DSRA0010E: SQL State = 99999, Error Code = 28,040. View JVM logs for further details."
I tried restarting the server but didn't helped. Not sure what is going wrong in this.
You didn't post any configuration information or server logs, so, assuming the old Oracle connection URL was working prior to you changing it, one common cause of this problem is changing the connection URL to move from an Oracle 11 instance (or earlier) to an Oracle 12 instance without properly updating the classpath of the WebSphere JDBC Provider to use at least the ojdbc6.jar.

JDBC connection problem

i have created only one object for connection MYSQL database ... and i am trying to access it only one time but it is giving a exception like this
Could not able to connect database com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections
please help me out to this problem.
What is the value of the max_connections variable in your my.cnf file? Are there other users connecting to the same MySQL server?

Resources