开发者

Java SQL Exception over sqljdbc4.jar

开发者 https://www.devze.com 2023-02-14 21:19 出处:网络
I am attempting to test a RESTful webservice on Glassfish everything works ok until actually try to process a simple GET it throws this:

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. E开发者_运维知识库rror 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


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消