嗨,我是 Jboss:D 的新宝宝。
这个错误几天让我头疼。
javax.persistence.PersistenceException: 异常 [EclipseLink-4003] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException 异常描述:配置错误。找不到类 [com.microsoft.jdbc.sqlserver.SQLServerDriver]。
我的 JBoss Standalone.xml 驱动程序标签:
<driver name="MSSQLXA" module="com.microsoft.sqlserver"> <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class></driver>
我的应用程序persistence.xml:
<persistence-unit name="Entities" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="database"/>
<property name="javax.persistence.jdbc.driver"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<property name="javax.persistence.jdbc.url"
value="jdbc:sqlserver://192.168.100.5:1433;databaseName=ADiamond;"/>
<property name="javax.persistence.jdbc.user" value="sa"/>
<property name="javax.persistence.jdbc.password"
value="diamond"/>
<property name="eclipselink.jdbc.exclusive-connection.mode"
value="Transactional"/>
<property name="eclipselink.cache.shared.default" value="false"/>
<property name="javax.persistence.cache.storeMode" value="REFRESH"/>
</properties>
谢谢。