部署环境:Windows Server 2008,Tomcat 7.0.5,Oracle JRE 1.6。开发环境与Eclipse Helios相同。
当我尝试部署使用OpenSAML 2.3.1的Java应用程序并对其进行实时测试时,它不想运行。查看源代码和堆栈跟踪,似乎DefaultBootstrap.bootstrap()
最终导致java.lang.IllegalArgumentException: InputStream cannot be null
。我在下面列出了完整的堆栈跟踪。
目标部署系统上的软件版本,或者至少应该与我的开发盒上的软件版本完全相同,其中一切运行正常,但当然我没有使用.war进行部署。我明显感觉到我在部署档案中缺少一些XML或DTD文件,但这种感觉本身并没有帮助我修复它。谷歌搜索堆栈跟踪的部分内容也对我没有多大帮助。
我从哪里开始追踪此错误的实际根本原因,以便我可以修复它?
2011-feb-10 10:56:08 org.apache.catalina.core.StandardWrapperValve invoke
ALLVARLIG: Servlet.service() for servlet [se.novasoftware.gabriel.SAMLParser] in context with path [/ServiceTier] threw exception [java.lang.IllegalArgumentException: InputStream cannot be null] with root cause
java.lang.IllegalArgumentException: InputStream cannot be null
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:120)
at org.opensaml.xml.parse.BasicParserPool$DocumentBuilderProxy.parse(BasicParserPool.java:643)
at org.opensaml.xml.parse.BasicParserPool.parse(BasicParserPool.java:216)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:141)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:148)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:88)
at _mynamespace_.saml.ParsedResponse.<init>(ParsedResponse.java:56)
at _mynamespace_.saml.ParsedResponse.<init>(ParsedResponse.java:104)
at _mynamespace_.SAMLParser.doPost(SAMLParser.java:29) // servlet entry point
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
ParsedResponse.java第56行是其构造函数中的bootstrap()调用:
private PersedResponse() throws ConfigurationException {
DefaultBootstrap.bootstrap(); // line 56
...
而同一文件中的第104行是从外部调用此私有默认构造函数的构造函数:
public ParsedResponse(final String samlXML)
throws UnmarshallingException, ConfigurationException {
this(); // line 104
...
答案 0 :(得分:21)
将openws-1.3.0.jar
添加到部署程序集就可以了。