日期:2014-05-20  浏览次数:20837 次

Jboss奇怪问题,高手指点一下,网上说的方法都试了 Apparently wrong driver class specified for URL
[JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.microsoft.sqlserver.jdbc.SQLServerDriver, url: jdbc:microsoft:sqlserver://localhost:1434;DatabaseName=zpz)

在公司一直用Eclipse、JBoss、SQL2005从来没有出现这种问题。

各种方法都试了:
  1>环境变量配置了JBOSS_HOME、JAVA_HOME、PASS。
JAVA_HOME:C:\Program Files\Java\jdk1.6.0_07
JBOSS_HOME:E:\jboss-4.2.3.GA
path:%JAVA_HOME%\bin
classpath:%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\dt.jar;
  2>数据源配置
<datasources>
  <local-tx-datasource>
  <jndi-name>ZPZMSSQLDS</jndi-name>
  <connection-url>jdbc:microsoft:sqlserver://localhost:1434;DatabaseName=zpz</connection-url>
  <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
  <user-name>sa</user-name>
  <password>123</password>
  <!-- sql to call when connection is created
  <new-connection-sql>some arbitrary sql</new-connection-sql>
  -->

  <!-- sql to call on an existing pooled connection when it is obtained from pool 
  <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
  -->

  <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
  <metadata>
  <type-mapping>MS SQLSERVER2005</type-mapping>
  </metadata>
  </local-tx-datasource>

</datasources>
  3>各种版本的驱动程序:1.0、1.1、1.2都试过了。

------解决方案--------------------
你写错了吧,是1433端口吧。
------解决方案--------------------
你用你的代码在别人的机子上式一下,如果不行的话,说明你的程序有问题,如果可以的话,应该是你的机子问题,有可能环境变量什么的没有配置。