Jakarta ee 如何在WebSphere中读取文件属性

Jakarta ee 如何在WebSphere中读取文件属性,jakarta-ee,properties,io,struts,websphere,Jakarta Ee,Properties,Io,Struts,Websphere,我正在将EAR文件部署到IBM WebSpehre服务器6.1 属性文件位于共享库中 启动服务器时,在System.err中我收到了此错误 [29/02/12 10.13.10:487 CET] 00002e0f ActionServlet E org.apache.struts.action.ActionServlet init Unable to initialize Struts ActionServlet due to an unexpected exception or error t

我正在将EAR文件部署到IBM WebSpehre服务器6.1 属性文件位于共享库中

启动服务器时,在System.err中我收到了此错误

[29/02/12 10.13.10:487 CET] 00002e0f ActionServlet E org.apache.struts.action.ActionServlet init Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable.  Most likely, this is due to an incorrect or missing library dependency.
javax.servlet.ServletException: Null InputStream is not a valid argument
    at it.blabla.StartUpInit.init(StartUpInit.java)
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359)
在指令中

this.getClass().getClassLoader().getResourceAsStream("path as String").

我必须在getResourceAsStream中放置什么路径?现在值是“/xml/file.properties”

,file.properties在共享jar文件中的/xml中?是的,我解决了:共享库中的abolsute路径不正确。现在它开始工作了:我写了一个相对路径,但Websphere需要一个绝对路径。Websphere不需要绝对路径。通常我使用ApacheCommons项目来读取属性文件等。我需要确保的是属性文件在类路径中,并且您已经准备好了。