2013-08-27 20 views
0

我正在开发一个应用程序,它是一个独立的应用程序并将它打包为一个jar文件(它是lika一个OSGi Plugin)并将部署那jar into JBoss

当我在eclipse中运行我的应用程序时,应用程序工作正常。在Jboss中抛出错误。

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

如果我将rt.jar添加到WEB-INF/lib文件夹并部署到Jboss中。这个错误不再被抛出。但我得到了一个新的例外,即使我加jsse.jarlib但无法解决错误。

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) 

我的开发环境是Jdk1.7Windows XPEclipse Juno服务器环境也是一样的我的本地环境。

回答

1
  1. 不会将rt.jar(或任何其他内置的java)作为部署包的一部分进行打包。它会导致类加载问题和奇怪的错误 - 就像你现在遇到的错误一样。
  2. 你需要做的是声明你的依赖于你的jar清单中的dom API。这已经是asked already on the jboss forums。解决方法是在你的顶级神器的(的.ear/的.war等)清单文件的“进口包装”键,其值为org.w3c.dom.Node;resolution:="optional"

编辑:或者你可以切换你的DOM的解析代码依靠不具备像dom4j的jdk外部库,并包括一个图书馆

+0

我没有清单文件在我的.jar – MaheshVarma

+0

你可以发布清单文件的内容作为问题的一部分吗? – radai

+0

MyApplication没有Manifest文件,因为它作为一个插件部署到在JBoss上运行的BPM工具中。 @radai – MaheshVarma

6

也尝试添加 @PowerMockIgnore(“javax.net.ssl中。*”)作为 类注释。为我工作。

相关问题