java 应用程序在 weblogic 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12899464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
application not working in weblogic
提问by Freakyuser
I deployed an application in WebLogic, after generating the project by deploying it in Tomcat. The project works fine in Tomcat but not in Weblogic.
我在 WebLogic 中部署了一个应用程序,通过在 Tomcat 中部署它来生成项目。该项目在 Tomcat 中运行良好,但在 Weblogic 中不起作用。
Lots of errors like:
很多错误,例如:
<--date-->
<--日期-->
<Error> <HTTP> <BEA-101020> <[weblogic.servlet.int
ernal.WebAppServletContext@1f9a403 - appName: 'app-name', name: 'app-name', contex
t-path: '/app-name', spec-version: '2.5'] Servlet failed with Exception
java.lang.NullPointerException
Now my doubt is, is this because of the usage of getServletContext/pageContext? If yes, then what should I use?
现在我的疑问是,这是不是因为使用了getServletContext/pageContext?如果是,那么我应该使用什么?
Thanks in Advance
提前致谢
回答by Freakyuser
While searching for the return-NULL-of-getServletContext().getRealPath() behaviour, I found this,
在搜索 return-NULL-of-getServletContext().getRealPath() 行为时,我发现了这个,
http://ananthkannan.blogspot.in/2009/12/servletcontextgetrealpath-returns-null.html
http://ananthkannan.blogspot.in/2009/12/servletcontextgetrealpath-returns-null.html
this did the trick. It was the usage of the getRealPath that deterred the app from running successfully. After enabling the archived getRealPath, its not returning null.
这做到了。正是 getRealPath 的使用阻止了应用程序成功运行。启用存档的 getRealPath 后,它不会返回 null。