java.security.NoSuchAlgorithmException:为SSLContext配置的类



我正在开发一个独立的java应用程序,它将被打包为jar文件(OSGi插件),并将在部署在Jboss AS 7.1上的EAR中运行。当我尝试使用JDBC type 4驱动程序(sqljdbc4.jar)连接到Microsoft SQLServer 10时,我得到了以下Exception

    com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish   
   a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.   
   Error: "class configured for SSLContext:  
  sun.security.ssl.SSLContextImpl$TLS10Context not a SSLContext".
    Caused by: java.security.NoSuchAlgorithmException: class configured for 
     SSLContext:  sun.security.ssl.SSLContextImpl$TLS10Context not a SSLContext
  C14:30:34,169 ERROR [stderr] (default-short-running-threads-threads - 13)            
    at sun.security.jca.GetInstance.checkSuperClass(GetInstance.java:258).

注意:应用程序在eclipse中运行良好。但是在把它做成一个罐子并部署到Jboss之后,它抛出了异常

我的jar目录结构

 MYApp
 |
 |src
  |  
  |   
  | 
   META-INF
   |
    lib
     | 
       sqljdbc4.jar
       rt.jar
       jsse.jar

从案例rt.jarjsse.jar中的lib目录中删除与java相关的jar,并将xmlbeans.jar, xbean.jar, xml-apis添加到库中。

最新更新