SQLJDBC driver is not supported by JRE 1.7 - java

I am trying to develop RESTful JAVA web service using Netbeans and MS SQL Server 2008 as DBMS.
I am registering sqljdbc4.jar as a driver but still it is showing me this error while deploying the project. I tried all the options available online and also removed driver, relocated driver did every thing except uninstalling entire developing package(Netbeans, JDK, SQL Server 2008).
Following is the error:
Error occurred during deployment: Exception while deploying the app [webapptest1] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Java Runtime Environment (JRE) version 1.7 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
Error Code: 0. Please see server.log for more details.

Use jTDS which is an opensource driver which supports MS Sql Server

Related

Setup a Oracle JDBC provider in Websphere 8.0.0.13

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.

Updating ConnectionPool in Glassfish when derby is upgraded

I was using Glassfish4 with Eclipse and derby-10.6 with JEE. Everything was working fine. Then for some tutorials I switched to Netbeans8.1 which had Glassfish4.1.1 and derby-10.12. Now I am back to Eclipse and want to start from where I left. Meanwhile database created by derby-10.6 is upgraded by 10.12. How can I change settings in Glassfish4 so that it can connect to the database? I am guessing I need to change something with ConnectionPool.
The error I am getting is:
Error occurred during deployment: Exception while deploying the app [ejb] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 0, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'EmployeeDB' with class loader sun.misc.Launcher$AppClassLoader#61bbe9ba, see the next exception for details.::SQLSTATE: XSLANDatabase at C:...\db-derby-10.6.2.1-bin\bin\EmployeeDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.9. Error Code: 0. Please see server.log for more details.
Note that, I don't have derby-10.9.

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.

Could not load any resource bundle by com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages

I have a web application and using jenkins for build and deployment to glassfish 3+ server. But now I am facing a problem. The jenkins is building the application successfully but when it tries to deploy the application to the target server then it failed with following error
Deploying /var/lib/jenkins/workspace/Gordon Converter Dev/target/gordons-dev-deployment.war to container GlassFish 3.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.util.CargoException: Deployment has failed: Action failed Deploying application to target server failed; Error occurred during deployment: Exception while deploying the app [gordons-dev-deployment] : Could not load any resource bundle by com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages. Please see server.log for more details.
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.waitForProgressObject(AbstractJsr88Deployer.java:220)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.deploy(AbstractJsr88Deployer.java:76)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.redeploy(AbstractJsr88Deployer.java:142)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:920)
at hudson.FilePath.act(FilePath.java:893)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
at hudson.model.Run.execute(Run.java:1735)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)
Finished: FAILURE
I just got this error too and I noticed that Java had auto updated itself to the latest version. So I was compiling the application with Java 1.7.0_131, but Glassfish3 was still running under Java 1.7.0_121. My solution was to restart Glassfish so that it was running under the new version of Java 1.7.0_131. I guess I could have also downgraded my Java back to 1.7.0_121 and compiled my application with that... Bottom line here is to make sure that you are compiling with the same version of Java that Glassfish is running.

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