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

Is there a way to fix home folder permissions remotely?

ubuntu permissions ssh

I have a remote ubuntu computer that I connect to via SSH. The remote computer has only one user. I accidentally changed the user's home folder permissions (to 555, I believe) and because of that I...

JS/CSS load issue in HTML from Isolated Storage

javascript html css windows-phone-8 isolatedstorage

I have a HTML and JS file inside the application package of WP8 app and at runtime move the files to Isolated storage and then navigate the Browser to the html page.