简体   繁体   English

JBoss7:为SSLContext配置的类:sun.security.ssl.SSLContextImpl $ TLS10Context不是SSLContext

[英]JBoss7: class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLS10Context not a SSLContext

I am developing an application which is a standalone application and gonna package it as a jar file (Which is lika a OSGi Plugin ) and will deploy that jar into JBoss . 我正在开发一个独立的应用程序,并将其打包为jar文件(这是OSGi Plugin简称),并将该jar into JBoss部署jar into JBoss

When I run my application in my eclipse the application works fine. 当我在Eclipse中运行应用程序时,该应用程序运行良好。 In Jboss It throws error. 在Jboss中引发错误。

java.lang.ClassNotFoundException: org.w3c.dom.Node . java.lang.ClassNotFoundException: org.w3c.dom.Node

If I add rt.jar to WEB-INF/lib folder and deploy into Jboss. 如果我将rt.jar添加到WEB-INF/lib文件夹并部署到Jboss中。 That error no longer thrown. 该错误不再引发。 But I got a new exception Even I added jsse.jar to lib but unable to resolve the error. 但是我有一个新的异常,即使我向lib添加了jsse.jar但也无法解决该错误。

 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

 06:10:53,484 ERROR [stderr] (default-short-running-threads-threads - 26) at     
 sun.security.jca.GetInstance.checkSuperClass(GetInstance.java:258)

 06:10:53,484 ERROR [stderr] (default-short-running-threads-threads - 26) at    
 sun.security.jca.GetInstance.getInstance(GetInstance.java:237)

 06:10:53,484 ERROR [stderr] (default-short-running-threads-threads - 26) at  
 sun.security.jca.GetInstance.getInstance(GetInstance.java:164)

 06:10:53,484 ERROR [stderr] (default-short-running-threads-threads - 26) at  
 javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)

 06:10:53,500 ERROR [stderr] (default-short-running-threads-threads - 26) at   
 com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1353)

My Development environment is Jdk1.7 , Windows XP and Eclipse Juno The server Environment is also same as my local environment. 我的开发环境是Jdk1.7Windows XPEclipse Juno服务器环境也与我的本地环境相同。

Also try to add @PowerMockIgnore("javax.net.ssl.*") as class annotation. 也尝试将@PowerMockIgnore(“ javax.net.ssl。*”)添加为类注释。 Worked for me. 为我工作。

  1. dont ever package rt.jar (or any other java built-in) as part of your deployment. 不要将rt.jar(或任何其他内置的Java)打包为部署的一部分。 it causes classloading issues and weird errors - like the one youre experiencing now. 它会导致类加载问题和奇怪的错误-就像您现在遇到的那样。
  2. what you need to do is declare your dependency on the dom API in your jar's manifest. 您需要做的是在jar清单中声明对dom API的依赖。 this has been asked already on the jboss forums . 这个问题已经在jboss论坛上问过 the solution is to have an "Import-Package" key in your top-level artifact's ( .ear/ .war etc) manifest file with the value org.w3c.dom.Node;resolution:="optional" 解决方案是在顶级工件( .ear / .war等)清单文件中具有“ Import-Package”键,其值为org.w3c.dom.Node;resolution:="optional"

edit: or you could switch your DOM-parsing code to rely on an external library not provided with the jdk like dom4j and include that as a library 编辑:或者您可以切换DOM解析代码,使其依赖于dom4j之类的jdk未提供的外部库,并将其作为库包含在内

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HttpClientBuilder 问题:无法初始化类 sun.security.ssl.SSLContextImpl$CustomizedTLSContext - HttpClientBuilder issue : Could not initialize class sun.security.ssl.SSLContextImpl$CustomizedTLSContext Java SSLContextImpl $ TLS10Context随机“peer not authenticated”异常 - Random “peer not authenticated” exceptions with Java SSLContextImpl$TLS10Context Java NoSuchAlgorithmException - SunJSSE,sun.security.ssl.SSLContextImpl $ DefaultSSLContext - Java NoSuchAlgorithmException - SunJSSE, sun.security.ssl.SSLContextImpl$DefaultSSLContext 如何修复'NoClassDefFoundError:无法初始化类sun.security.ssl.SSLContextImpl $ DefaultManagersHolder' - How to fix 'NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$DefaultManagersHolder' java.security.NoSuchAlgorithmException:为SSLContext配置的类 - java.security.NoSuchAlgorithmException: class configured for SSLContext java.security.NoSuchAlgorithmException:SSL_TLSv2 SSLContext 不可用 - java.security.NoSuchAlgorithmException: SSL_TLSv2 SSLContext not available SSLContext.getInstance("TLS") 漏洞 - SSLContext.getInstance("TLS") vulnerability SSLContext证书链未填充到上下文中 - SSLContext certificate chain not populated into context 是否可以构建使用SSL / TLS JAVA_OPTS作为其SSLContext的Java 11 HttpClient? - Is it possible to build a Java 11 HttpClient that uses SSL/TLS JAVA_OPTS as its SSLContext? Java 通过代理使用 TLS/SSLContext 的 HttpClient - Java HttpClient with TLS/SSLContext through proxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM