Setup a Oracle JDBC provider in Websphere 8.0.0.13 - java

We are trying to set up a JNDI (oracle database) on a Websphere Application Server version 8.0.0.13. Running Java 1.6.0:
WebSphere Platform 8.0.0.13 [BASE 8.0.0.13 cf131705.01] running with process name pandora-vmNode01Cell\Aplicacion-node\server1 and process id 5230
Host Operating System is Linux, version 3.13.0-133-generic
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
I downloaded the ojdbc6.jar from maven and oracle servers and we created a JDBC provider that uses that jar file. And We tried to configure the Datasource with that JDBC provider. But, when we test the connection this error appears:
The test connection operation failed for data source XXXXX_oracle on server
server1 at node Aplicacion-node with the following exception:
java.sql.SQLException: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad
major version; class=oracle/jdbc/pool/OracleConnectionPoolDataSource,
offset=6. View JVM logs for further details.
What can be happening?
We are using the correct ojdbc file because the server is running the same SDK version.
Thank you in advance.

As you've said, the ojdbc6 jar should be compatible with Java 6, so maybe a different version Oracle JDBC driver is actually being used. Is there a different copy of the Oracle JDBC driver present in the app or WebSphere configuration? If so that version, which may require higher than Java 6, could be loaded rather than the ojdbc6 driver you've configured.
Check that there are no additional Oracle JDBC drivers packaged with your application.
Check if there are other Oracle JDBC Providers configured in WebSphere using a newer JDBC driver. If so either modify your configuration so all of your providers are using the same version Oracle JDBC driver or you will need to Isolate your JDBC Providers.
Also, friendly reminder that both WebSphere 8.0 and Java 6 are out of support, so if possible you should migrate to a newer version of both.

Related

Oracle SQL Developer won't connect to local database, OCI library won't load

I opened Oracle SQL Developer after using it for a while a few days ago and then I run into this mysterious and infuriating issue where I cannot connect to my locally installed database. First I got a report of the JDBC driver being outdated when testing the connection, so I replaced it with the updated version and then tried again, but then got a different error saying the OCI library won't load. The path to my Oracle Databse Express Edition 18 installation that works as ORACLE_HOME is C:\app\nicho\product\18.0.0\dbhomeXE. I don't understand why the OCI library won't load, as the oci.dll and associated oci files are all in the directory the error message specifies: C:\app\nicho\product\18.0.0\dbhomeXE\bin. I tried using the Instant Client option in the Tools->Preferences->Database->Advanced section by downloading the Oracle Instant Client and changing the path, but I got the same OCI library load failed message. This problem is very significant because I need to use this software for my college project and cannot do my work. I don't understand why this error is happening.
Testing the Oracle Home located at C:\app\nicho\product\18.0.0\dbhomeXE
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 21.1.0.0.0
Testing testing native OCI library load ... Failed:
Error loading the native OCI library
The native OCI driver could not be loaded. The system propertyjava.library.path contains the entries from the environment variable PATH. Check it to verify that
the expected native library directory C:\app\nicho\product\18.0.0\dbhomeXE\bin is present and precedes any other client installations.
java.library.path = C:\Users\nicho\OneDrive\Documents\IS 410\sqldeveloper\sqldeveloper\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\app\nicho\product\18.0.0\dbhomeXE\bin;C:\Users\nicho\AppData\Local\Microsoft\WindowsApps;;.
As you can see, the expected native library directory is in the path, but the OCI driver will still not load. My database and installation were working fine before today. Please help. :(

About Legacy Application Classes 12 to Ojdbc6 migration in jdev9.0

Currently I am working with a legacy application which uses classes12 and jdevoper 9.0 and java 1.4. I wanted to upgrade java to 1.6 and OJDBC6 with Jdev 9.0 .
But Jdev use BC4 libraries which are also old one. I had changed my java version to 1.6 and updated classes12 to ojdbc6. but after that I was facing build issue as BC4j lib also have some connection with it.
after updating bcj lib with adfm jar I am getting below issue. Could any one please suggest any minimal changes to work my application to work
Currently java 1.4 oracle 11g DB and Jdev 9.0 classe12 and I want
java 1.6 oracle 12c jdev 9.0 ojdbc6
SEVERE: { type : AppBundleInfoRT, id : 'en_US-null-null', moRefName : null, appBundleName : null, writable : false, dirty : false, hasMdsConfig : false, appOverrideBundle : null}: Fail to read adf-config.xml
oracle.adf.share.ADFShareException: getMDSInstance error
at oracle.adf.share.config.FallbackConfigImpl.getMDSInstance(FallbackConfigImpl.java:104)
at oracle.javatools.resourcebundle.AppBundleInfoRT.readAdfConfig(AppBundleInfoRT.java:341)
at oracle.javatools.resourcebundle.AppBundleInfoRT.loadData(AppBundleInfoRT.java:123)
at oracle.javatools.resourcebundle.AppBundleInfoFactoryRT.createAppBundleInfo(AppBundleInfoFactoryRT.java:83)
at oracle.javatools.resourcebundle.ResourceBundleUtils.getAppBundleInfoUnlocked(ResourceBundleUtils.java:334)
at oracle.javatools.resourcebundle.ResourceBundleUtils.getAppBundleInfo(ResourceBundleUtils.java:325)
at oracle.javatools.resourcebundle.ResourceBundleCacheConfig.getCurrentAppConfig(ResourceBundleCacheConfig.java:109)
at oracle.javatools.resourcebundle.ResourceBundleManagerRT.<init>(ResourceBundleManagerRT.java:84)
at oracle.javatools.resourcebundle.ResourceBundleManager.getResourceBundleManager(ResourceBundleManager.java:183)
at oracle.javatools.resourcebundle.BundleFactory.getMap(BundleFactory.java:86)
at oracle.javatools.resourcebundle.BundleFactory.getBundle(BundleFactory.java:245)
at oracle.javatools.resourcebundle.BundleFactory.getBundle(BundleFactory.java:206)
at oracle.jbo.common.StringManager.getStringFromBundle(StringManager.java:582)
at oracle.jbo.common.StringManager.getStringInternal(StringManager.java:530)
at oracle.jbo.common.StringManager.getString(StringManager.java:477)
at oracle.jbo.common.StringManager.getLocalizedString(StringManager.java:305)
Oracle 12c does not support ojdbc6 as per What are the Oracle JDBC releases versus JDK versions? docs. Do note that Oracle 12cR2 strictly requires ojdbc8 to establish the connection, your current Java 6 setup most likely won't work.

Hibernate and MSSQL 2016 issue

I'm facing a problem with a Java application (JVM 1.6) that is using Hibernate 3.6 to access a Microsoft SQL Server via Microsoft JDBC Driver for SQL Server.
When working with SQL JDBC driver 3.0 and MSSQL 2008 - 2014 all is working just fine.
But when I'm trying to use MSSQL 2016, the latest "Microsoft JDBC Driver 6.0" (sqljdbc4.jar) - I get a bunch of those errors:
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)
It happens on different entities, and can happen on a get or update operations.
My question: is this an issue with Hibernate that also needs to be updated to a newer version?
I wasn't able to find any information about compatibility issues when accessing MSSQL 2016 via Java/Hibernate.
Thanks!
If possible can you try to use JVM 1.7 and sqljdbc41.jar? Better if you able to use JVM 1.8 and sqljdbc42.jar.
Microsoft recently Open Source their driver on GitHub. You can raise issue on their github project.
As per my understanding for SQL Server 2016 you need either sqljdbc41.jar or sqljdbc42.jar
Further you can found more official documentation on MSDN.
Microsoft JDBC Driver 6.0 and 4.2 for SQL Server:
To support backward compatibility and possible upgrade scenarios, the JDBC Drivers 6.0 and 4.2 include four JAR class libraries in each installation package: sqljdbc.jar, sqljdbc4.jar, sqljdbc41.jar, and sqljdbc42.jar. Note: sqljdbc.jar, sqljdbc4.jar are provided only for backwards compatibility, and do not contain new features included with driver versions 6.0, 4.2, and 4.1.

Unable to connect Oracle 11g via thin

I am trying to connect to Oracle 11g DB through my below java code, in an web application using Tomcat 4 server. ojdbc6.jar in Eclipse build path, but getting this below Error.
BUT when I tried this piece of same Java code in a Java file (public static void main()) and having ojdbc6.jar in Eclipse build path, it was able to connect to d DB, Very Strange!!
Then why this same code is not working in my web application??
Server: Tomacat 4
JDK Version: JDK 1.6
Java Code:
Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:#hostName:portNum:SID","user", "pass");
Getting this below Error:
java.lang.ArrayIndexOutOfBoundsException: 7
at oracle.security.o3logon.C0.r(C0)
at oracle.security.o3logon.C0.l(C0)
at oracle.security.o3logon.C1.c(C1)
at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
at oracle.jdbc.ttc7.O3log.<init>(O3log.java:289)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
Since your standalone program is running correctly, it means your program runtime classpath is fine. However for Tomcat 4 its failing which raises a suspicion on the tomcat classpath. My guess is that since your tomcat is pretty old, it might be containing old driver class (may be classes12.jar or older ojdbc jar file in libraries of your tomcat (especially look into the $CATALINA_HOME/common/lib). If that is the case remove all other jars except ojbdc6 from your classpath. Also make sure your web application libraries do not contain the classes12.jar or older ojdbc jars.
Also you can try to use -verbose:class in your tomcat jvm startup to print the information from where the classes are loaded. This will however output lots of information in the log files.Search for the driver class and it will show you where this was loaded from.
Loaded oracle.jdbc.driver.OracleDriver from file: xxx.jar

Errors accessing MSSQL form Xpages using ExtlibX - Driver or JVM not supported

I am trying to connect to SQL from Xpages, so I installed the latest extlibx 9 and downloaded the drivers from microsoft and added it to notes9\data\jvm\lib\ext
Now I get the following errors when trying to query SQL from my xpage:
Error I get in xpages extlibx when using Microsoft SQL Driver sqljdbc.jar
Error while reading the relational data
JRE (Java Runtime Environment) version 1.6 stöds inte av den här drivrutinen. Använd klassbiblioteket sqljdbc4.jar som stöder JDBC 4.0.
In English: JRE (Java Runtime Environment) version 1.6 is not supported by this driver. Use class library sqljdbc4.jar which supports JDBC 4.0.
Error I get in xpages extlibx when using Microsoft SQL Driver sqljdbc4.jar
Error while reading the relational data
Error while creating connection
SQL Server version 8 stöds inte av den här drivrutinen. ClientConnectionId:9195a17a-22f4-4377-a41a-be6f213b05ff
In English: SQL Server version 8 is not supported by this driver
A few years ago there was a file called extlib.driver.mssql_1.0.0.201109061401 which worked just fine using the same SQL server I am using now. but I cannot find that file anymore.
what should I do to get SQL queries working?
Ok, I will answer my own question here
The reason for getting these errors is because I was using the wrong driver.
There are two different version of the drivers so make sure you use the right one
This one do not work
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
This one works
http://www.microsoft.com/en-us/download/details.aspx?id=2505

Categories