ContextLoader:上下文初始化失败

时间:2012-04-08 17:54:16

标签: spring weblogic

我试图找出部分应用程序突然停止工作的原因。我正在使用Weblogic 8.1.4.0和Hibernate运行Spring 1。报告生成器是失败的部分,首先在我们的生产服务器上,然后在星期五在我进行实验时在dev和qa服务器上。我没有对代码进行任何更改,但我现在在映射查询的compile语句中获得了Missing Data Source异常。唯一改变的是数据库中的几条记录,但它们是相当简单的变化,我怀疑它会产生影响。从周五开始,两个开发应用程序可能都失败了,我也遇到了以下错误:

以下是来自开发服务器的日志中的错误:

04-06 14:31:34 ERROR [main] org.springframework.web.context.ContextLoader: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myDataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.LinkException: 

从我部署到QA服务器大约10分钟后出现类似的情况。

它指的是WebLogic中定义的数据源和连接池。我已经检查并测试了连接,并且似乎没有任何问题。

可能会发生什么会导致这种情况?我甚至从上周恢复到构建版本以确保它不是代码更改,但是发生了相同的数据源异常:

04-07 16:15:04 DEBUG [ExecuteThread: '14' for queue: 'default'] org.eei.survey.data.RegionDataDAO$NERCRegionMappingQuery: RdbmsOperation with SQL [{call prc_NERCRegions_get}] compiled
04-07 16:15:04 ERROR [ExecuteThread: '14' for queue: 'default'] error.jsp: Error page displayed to user due to unhandled exception
org.springframework.dao.InvalidDataAccessApiUsageException: dataSource is required
    at org.springframework.jdbc.object.RdbmsOperation.compile(RdbmsOperation.java:300)
    at org.eei.survey.data.ReportDAO$NCRMappingQuery.<init>(ReportDAO.java:535)
    at org.eei.survey.data.ReportDAO.executePrcNCR(ReportDAO.java:548)
    at org.eei.survey.data.ReportDAO.getNCR(ReportDAO.java:59)
    at jsp_servlet._reliability._charts.__barncr._jspService(__barncr.java:235)

任何帮助都将不胜感激。

更新:这是错误的完整堆栈跟踪:

04-08 14:56:19 WARN  [ExecuteThread: '14' for queue: 'default'] org.apache.shale.faces.ShaleViewHandler: No ViewController for viewId /reliability/support/reportgen.faces found under name reliability$support$reportgen
04-08 14:56:19 DEBUG [ExecuteThread: '14' for queue: 'default'] org.eei.survey.data.ReportDAO: java.lang.IllegalArgumentException: No DataSource specified
04-08 14:56:19 ERROR [ExecuteThread: '14' for queue: 'default'] error.jsp: Error page displayed to user due to unhandled exception
java.lang.NullPointerException
    at jsp_servlet._reliability._support.__reportgen._jspService(__reportgen.java:156)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:322)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at org.apache.shale.faces.ShaleViewHandler.renderView(ShaleViewHandler.java:142)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at org.apache.shale.faces.InvokeCommand.execute(InvokeCommand.java:40)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:166)
    at org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:218)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at org.eei.survey.web.UserFilter.doFilterInternal(UserFilter.java:30)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:0)

对于为什么会这样,我仍然没有一个可靠的答案,但我现在已经弄明白了如何修复它。我基本上不得不停止部署的应用程序,然后重置连接池,然后重新启动。我会假设重新启动整个服务器会完成相同的事情,但我尝试了几次没有结果。我现在没有时间来追踪问题的根源,但如果有人遇到这种情况,你至少可以快速解决问题。