ContextLoader: Context initialization error

I am trying to find the reason why a part of my application stopped working all of a sudden. I am running Spring 1 with Weblogic 8.1.4.0 and Hibernate. The report generator is the part that failed, first on our production server and then on the dev and qa servers on Friday when I was experimenting. I haven't made any changes to the code, but now I get a Missing Data Source exception in the mapping compilation statement. The only thing that has changed is a few entries in the database, but these were pretty simple changes that I doubt would have had an impact. I also got the following error from Friday around the time that two development apps might have failed:

Here is the error in the logs from the development server:

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: 

      

And there is a similar one about 10 minutes after I deployed to a QA server.

This applies to the data source and connection pool defined in WebLogic. I have checked and tested the connection and there seems to be no problem with it.

What could happen that could lead to this? I'll even go back to the build from last week to make sure it's not a code change, but the same datasource-related exception is thrown:

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)

      

Any help would be appreciated.

UPDATE: here is the complete stacktrace error:

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)

      

+3


source to share


2 answers


I still don't have a solid answer as to why this happened, but I still figured out how to fix it. I basically had to stop my deployed app, then reset the connection pool and then restart again. I would guess that restarting the entire server would do the same, but I tried it several times with no results. I don't have a watch to track down the source of the problem at this time, but if anyone gets into this situation, you will at least quickly fix it.



0


source


You have a problem with the jdni permission of your datasource. Take a look at the weblogic jdni pool and make usre you are using the correct name for jdni. java: comp / env / jdbc / reliableDS doesn't work.

This can help:

http://books.google.com/books?id=TiAKHpPHpHIC&pg=PA159&lpg=PA159&dq=weblogic+8.1+jndi+tree&source=bl&ots=cjKNXJZl4o&sig=FHs0YL6hqslNOYjuWpjyRTlCpYY&hl=en&sa=X&ei=veWBT5aVNoTMtgeJ8fC9Bg&ved=0CC0Q6AEwAQ#v=onepage&q=weblogic%208.1% 20jndi% 20tree & f = false

it's the same



http://docs.oracle.com/cd/E13222_01/wls/docs81/jndi/jndi.html

it's the same



Tomcat search vs Weblogic JNDI

+1


source







All Articles