2
votes

I am attempting to test a RESTful webservice on Glassfish everything works ok until actually try to process a simple GET it throws this:

Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0. Error Code: 0

I thought this was related to the presence of an earlier version sqljbc and 1.5 JDK as far I know I am using 1.6 and sqljdbc4.jar is included. Any ideas?

Thanks Rickud

3

3 Answers

1
votes

You need to place the sqljdbc4.jar into your glassfish domain lib. ie. mine is in C:\glassfishv3\glassfish\domains\domain1\lib\sqljdbc4.jar so that glassfish has access to it.

1
votes

Apparently you have sqljdbc.jar (which is for Java 5) in your classpath. You have to replace that with sqljdbc4.jar

0
votes

In Glassfish v2, 3rd party jars used to reside in /lib whereas from v3 onwards they go in the lib folder under the appropriate domain, usually, domain1/lib.