学习和生活
这两天同事的项目工程突然出现了故障,web包发布后,不断地抛异常,由于刚好我在修改登陆的页面,所以他们不约而同地认为是我搞得鬼,天可怜见,我可是一安分守己之公民啊,没办法,只好削尖了头往问题里钻,但是愣没看出个所以然,,好晕阿。于是拿到其他同事的机器上面部署,一切OK,更晕!!!!!!第一次打开index.jsp时,异常如下:Error 500--Internal Server Error java.lang.ExceptionInInitializerError at jsp_servlet.__login._jspService(__login.java:209) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6354) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.struts.taglib.html.LocalStrings, locale zh_CN at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773) at java.util.ResourceBundle.getBundle(ResourceBundle.java:511) at org.apache.struts.util.MessageResources.(MessageResources.java:102) at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:579) at org.apache.struts.taglib.html.FormTag.(FormTag.java:140) ... 13 more然后刷新了一下页面,马上就变了:java.lang.NoClassDefFoundError at jsp_servlet.__login._jspService(__login.java:209) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6354) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)这个错误实属可恨,给我造成了很大的误解,初一看,哦,很明显嘛,是Struts标签的问题,没难度的,打开页面开始查找,一看,原来是说formbean找不到了,不可能阿,这怎么会找不到呢?,这个用了几年了,不可能出问题阿!又调了几次,实在受不了了,干脆把struts标签搞掉算了,这下问题又变了,说是资源文件找不到了,很可惜,这个异常没有记录下来。。。。。。。重装了服务器,仍然不行,痛苦啊!后来换了个用户登录了一下,惊奇的发现竟然可以正常运行,,恩,还不算太坏,于是才发现原来是环境变量出了问题,classpath配置到了另一个项目中,。去掉了这个环境变量后,一切OK!做项目时,真的要细心细心再细心阿,环境变量这个东西,太容易在项目开发过程中忽视了,但有时问题就偏偏出在这上面,这样当问题出现时,就很难真正的发现错误的源泉,解决起来只能靠时间和经验了,同时,希望大家在做项目时尽量不要交叉进行,否则,出现莫名其妙的问题的几率太大了!特写于此,以对自己以示警戒!
Powered by: BlogJava Copyright © TrampEagle