JPA connection configuration for SQLServer

Does anyone know why am I getting the following error?

javax.persistence.PersistenceException: Exception [EclipseLink-4003] (Eclipse     Persistence Services - 2.3.2.v20111125-r10461):      org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Configuration error.  Class     [com.microsoft.sqlserver.jdbc.SQLServerDriver] not found.
    org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:517)
    org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(Entity    ManagerFactoryDelegate.java:188)
    org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
mobilelink.entityservice.CheckVouchService.findAllCheckVouch(CheckVouchService.java:21)
warehouseservice.jaxrs.StockTake.getStockTakeTasks(StockTake.java:40)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:187)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

The setting in my persistence.xml is as follow

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="MobileLink" transaction-type="RESOURCE_LOCAL">
        <class>mobilelink.entity.ComputationUnit</class>
        <class>mobilelink.entity.Inventory</class>
        <class>mobilelink.entity.InventoryClass</class>
    <class>mobilelink.entity.CheckVouch</class>
    <class>mobilelink.entity.CheckVouchs</class>
    <class>mobilelink.entity.Department</class>
    <class>mobilelink.entity.Person</class>
    <class>mobilelink.entity.Warehouse</class>
    <properties>
        <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433;databaseName=UFDATA_666_2009"/>
        <property name="javax.persistence.jdbc.user" value="sa"/>
        <property name="javax.persistence.jdbc.password" value="160497"/>
        <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
        <property name="eclipselink.cache.shared.default" value="false"/>
    </properties>
</persistence-unit>

In the project build path, I have included sqljdbc4.jar downloaded from Microsoft.Thank for helping.

Answers


Move sqljdbc4.jar to folder with libs in your app-server.


Need Your Help

android communicate with webpage, get 502 error

android xml web-services http android-webservice

I have a friend who's written a servlet which just serves XML (just XML, no SOAP or etc., Content-Type: text/xml).

Issues with jquery roundabout not firing moveClockwiseThroughBack

javascript jquery

I am having issues with roundabout not firing the moveClockwiseThroughBack and moveCounterClockwiseThroughBack callbacks. The site does not provide any examples of this in use so I am wondering if ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.