Using Rational Asset Manager 7.5.4.1 version with Oracle 11.g on WAS 8.5.5.13 I am getting following oracle error?
While we see the logs we get following SQL error code.
SQL Error Code is 17008 SQL State is :08003
Other log trace says like below.
java.nio.channels.ClosedByInterruptException
java.sql.SQLRecoverableException: Closed Connection
com.ibm.websphere.ce.cm.StaleConnectionException: Closed Connection
com.ibm.websphere.ce.cm.StaleConnectionException: IO Error: Socket read interrupted
What could be the reason?
The error usually is caused due to network issue or firewall issues.
To root cause and eliminate those:
1. You can check AWR and other connectivity reports
2. Ping works between app server and DB host
3. Required configurations for sqlnet.ora parameters time out are set correctly.
If none of them fix the issue, it worth to check jdbc jar file and its version.
In this case i think solution is to use jdbc6.jar and checking if there is any mismatch in the version of the jar that is presently used.
Related
This question already has answers here:
Oracle JDBC intermittent Connection Issue
(13 answers)
Closed 5 years ago.
I have a java program which connect to oracle database sometimes it work and sometimes show me this error message :
Exception in thread "main" java.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:498)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
How i can solve this problem?
Answer took from oracle forum, here:
java.security.SecureRandom is a standard API provided by sun. Among various methods offered by this class void nextBytes(byte[]).
This method is used for generating random bytes. Oracle 11g JDBC drivers use this API to generate random number during
login. Users using Linux have been encountering SQLException("Io exception: Connection reset").
The problem is two fold:
The JVM tries to list all the files in the /tmp (or alternate tmp directory set by -Djava.io.tmpdir) when
SecureRandom.nextBytes(byte[]) is invoked. If the number of files is large the
method takes a long time
to respond and hence cause the server to timeout
The method void nextBytes(byte[]) uses /dev/random on Linux and on some machines which lack the random
number generating hardware the operation slows down to the extent of bringing the whole login process to
a halt. Ultimately the the user encounters SQLException("Io exception:
Connection reset")
Users upgrading to 11g can encounter this issue if the underlying OS is Linux which is running on a faulty hardware.
The cause of this has not yet been determined exactly. It could either be a problem in the hardware or the fact
that for some reason the software cannot read from dev/random
a solution seems to add this setting to the jvm
-Djava.security.egd=file:/dev/./urandom
Connection reset usually happens when the connection between you app and the database gets disconnected for example network issue or resources that's required.
Check the following post it should give you an idea of what to check.
SQLRecoverableException: I/O Exception: Connection reset
I want my java program to handle Oracle SQL queries. For that, I have written the following code.
on running this code it shows the following errors.
I don't know how to connect my Eclipse IDE with the Oracle. How could I connect my Eclipse IDE to the Oracle and how to get rid of these errors? And I don't want to connect to any online oracle servers, I googled and get suggestions for connecting to online servers.
How could I connect my Oracle 11g with my Eclipse Kepler in Windows 8?
Please check below :
Driver version and DB version should be same.
Try login with sqlplus or some clients like Toad, SQL developer.
The number of connections allowed may exceeded, result in TNS listener error, that you may got minus one from read call error in stacktrace. If connections are exceeded kill inactive connections.
Try establishing connection like below
DriverManager.getConnection(DB_URL,USER,PASS);
Above exception your are getting when operating system has some internal environment problem.
I have got same problem with type 4 driver. But type 1 driver not giving this exception. So start using the type 1 oracle driver.
You can check the sid port in tnsnames.ora file which is in below location.
C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\SAMPLE\tnsnames.ora
I am trying to connect to a db2 database in Java. Below the driver and the connection string and the driver details i am giving
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
String url="jdbc:db2://hostname:portnumber/databasename";
sourceConnection=DriverManager.getConnection(url,"username","password");
But I am getting the below exception
"COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0615E Error receiving from socket, server is not responding. SQLSTATE=08S01"
I also tried changing the connection string to
String url="jdbc:db2:hostname:portnumber/databasename";
Still it is resulting the same exception above while trying to get the Connection.
And i have tried the below option also using JDBC app driver
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
DB2DataSource db2ds = new DB2DataSource();
db2ds.setServerName("hostname");
db2ds.setPortNumber(portnumber);
db2ds.setDatabaseName("databasename");
db2ds.setUser("username");
db2ds.setPassword("password");
sourceConnection=db2ds.getConnection();
For the above two connection I used the jar "db2java.jar"
And i have tried using the JCC driver:
Class.forName("com.ibm.db2.jcc.DB2Driver");
String url="jdbc:db2://hostname:portnumber/databasename";
sourceConnection=DriverManager.getConnection(url,"username","password");
For this connection i have added the below jars
1)db2jcc.jar
2)db2jcc_license_cu.jar
This time around I am getting the below error,
"com.ibm.db2.jcc.am.go: [jcc][t4][201][11237][3.57.82] Connection authorization failure occurred.
Reason: Security mechanism not supported. ERRORCODE=-4214, SQLSTATE=28000"
I tried to connect to the same db2 source using "Quest for DB2" tool and the connection was successful.
Am i missing something in the code and is it a problem with DB2 drivers or connection string?
Can someone please guide me.
Thanks in advance.
Cause:
If the DB2® instance where InfoSphere Optim Performance Manager is running has the authentication configuration parameter set to DATA_ENCRYPT, you cannot log in to the web console.
Resolving the problem:
Do the following steps:
On the DB2 instance where Optim Performance Manager is running, set the authentication configuration parameter to SERVER by issuing the following command:
db2 update dbm cfg using authentication server
Restart the DB2 instance and InfoSphere Optim Performance Manager.
For more details visit here.
Your first two attempts were not supposed to work. You're using the JCC driver URL format, so it wouldn't be valid for either "net" or "app" drivers, which are deprecated anyway.
Use the JCC driver (com.ibm.db2.jcc.DB2Driver) and the URL format of "jdbc:db2://hostname:portnumber/databasename" and see this technote for the solution to the "Security mechanism not supported" problem. In short, you need to use a supported JDK.
I am trying to connect to an Oracle Database using java and JDBC code. I can't do that because I get the error below:
java.sql.SQLException: Listener refused the connection with the
following error: ORA-12514, TNS:listener does not currently know of
service requested in connect descriptor
What is the reason for the error and how to fix it ?
PS-
Out of all the DBMS, Oracle express 11g seems to be the most complicated and difficult to use.
Is that really the case ?
Listener does not currently know of service requested in connect
descriptor
Self explainatory. You're requesting connection to a service or instance in a DB that the DB's listener does not know, so it says "I have no clue".
Check the way you installed your Oracle 11g express. Remember that the service name there is often "xe".
I resolve this issue by increasing RAM size of my Virtual machine because i installed oracle
in VM that require more memory. So this could be one reason for your problem.
I'm curious about something... is it possible for an Oracle 11 instance to be configured so that it does not return any ORA-?????? error messages?
I've issued many invalid queries where I've misspelled column names, table names... things where I would expect an ORA error message.
Say for security purposes say if a stray java stack trace got exposed to a browser could you force oracle to always show the same bogus error message in the stack trace?
I always get this one:java.sql.SQLException: IO Error: Size Data Unit (SDU) mismatch
I've googled that error up and down, and I do not have any connection or database configuration issues at all! I get it on a per-query basis.
Not a direct solution but I was having the same problem with the SDU mismatch masking the real error. I found a link (http://www.rajivnarula.com/blog/2013/03/13/table-not-found-or-error-not-found/) that gave an indirect way to expose the error:
I tried swapping the JDBC driver with the older ojdbc14.jar and voila
! The real error was exposed : Good old
ORA-00942 (table or view does not exist)
Once I put the table in- everything works fine- with ojdbc14.jar as
well ojdbc6.jar
Obviously a pain but useful until someone posts a way to get the underlying error with the newer driver...
Basically your setup is not correct. Either on the client or on the server or on both the sdu size has been set and they do not match between client and server. The sdu size can be set on the client in
the sqlnet.ora file or
in the connect descriptor
On the server it can be set with
in the sqlnet.ora file
the dispatchers init.ora parameter
or the listener.ora file.
If you are still not convinced, trace the tns traffic to verify this. Client side tracing can be enabled by adding the following settings to the sqlnet.ora file:
trace_level_client = 10
trace_unique_client = on
trace_file_client = sqlnet.trc
trace_directory_client = <path_to_trace_dir>
Server side settings can be enabled with the following settings:
trace_level_server = 10
trace_file_server = server.trc
trace_directory_server = <path_to_trace_dir>
If level 10 is not sufficient, set the level to 16. This will create a trace file that you can analyze.
You can try to upgrade the Oracle 11g JDBC driver to a version greater than 11.2.0.3.0, as described here
There is another chance whether the table in the query exists in the database or not. Check for table name in the query or try whether you are trying for Oracle Database using mysql driver