Tomcat Error: WARNING: Failed to retrieve JNDI naming context for container

匿名 (未验证) 提交于 2019-12-03 01:58:03

问题:

I am encountering the following error within the catalina.2013-12-31.log file on the Tomcat70/logs/ folder, when I attempt to start a recently deployed web application on Tomcat 7.

Dec 31, 2013 10:11:20 AM org.apache.catalina.deploy.NamingResources cleanUp WARNING: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/crm]] so no cleanup was performed for that container javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].     at org.apache.naming.NamingContext.lookup(NamingContext.java:820)     at org.apache.naming.NamingContext.lookup(NamingContext.java:168)     at org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:977)     at org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:959)     at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)     at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5483)     at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:141)     at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1247)     at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:747)     at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:222)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)     at java.lang.Thread.run(Thread.java:722) 

My application is a JDK7 Web Application. I have tried to look for similar questions and tried some suggestions such as restarting the server (in order to get to clear some XML files), but it did not work.

Any ideas please?

Update:

This is what I have in web.xml:

60Servlet Mapped FilterFilters.ExampleFilterattributeFilters.ExampleFilter.SERVLET_MAPPEDPath Mapped FilterFilters.ExampleFilterattributeFilters.ExampleFilter.PATH_MAPPEDRequest Dumper FilterFilters.RequestDumperFilterSet Character EncodingFilters.SetCharacterEncodingFilterencodingEUC_JPCompression FilterCompressionFilters.CompressionFiltercompressionThreshold10debug0Servlet Mapped FilterinvokerPath Mapped Filter/servlet/*Listeners.ContextListenerListeners.SessionListenerSendMailServletSendMailServlet             snoop                      SnoopServlet         Security role for anonymous accesstomcat           servletToJsp                  servletToJsp                    CompressionFilterTestServlet                      CompressionFilters.CompressionFilterTestServlet                      CompressionFilterTestServlet                      /CompressionTest         SendMailServlet/SendMailServlet             snoop                      /snoop                      servletToJsp                      /servletToJsp         AddNewContactCrm.Servlets.AddNewContactAddNewContact/servlet/AddNewContactAddTipCrm.Servlets.AddTipAddTip/servlet/AddTipCaaPdfOutputterCrm.Servlets.CaaPdfOutputterCaaPdfOutputter/servlet/CaaPdfOutputterCaaTestSubmitCrm.Servlets.CaaTestSubmitCaaTestSubmit/servlet/CaaTestSubmitDeleteTipCrm.Servlets.DeleteTipDeleteTip/servlet/DeleteTipDestinationCustomerFinancialAdvisorRefreshCrm.Servlets.DestinationCustomerFinancialAdvisorRefreshDestinationCustomerFinancialAdvisorRefresh/servlet/DestinationCustomerFinancialAdvisorRefreshDestinationCustomerRefreshCrm.Servlets.DestinationCustomerRefreshDestinationCustomerRefresh/servlet/DestinationCustomerRefreshDestinationCustomerShadowFinancialAdvisorRefreshCrm.Servlets.DestinationCustomerShadowFinancialAdvisorRefreshDestinationCustomerShadowFinancialAdvisorRefresh/servlet/DestinationCustomerShadowFinancialAdvisorRefreshDestinationOfficerControlCrm.Servlets.DestinationOfficerControlDestinationOfficerControl/servlet/DestinationOfficerControlDestinationOfficerFinancialAdvisorControlCrm.Servlets.DestinationOfficerFinancialAdvisorControlDestinationOfficerFinancialAdvisorControl/servlet/DestinationOfficerFinancialAdvisorControlDestinationOfficerShadowFinancialAdvisorControlCrm.Servlets.DestinationOfficerShadowFinancialAdvisorControlDestinationOfficerShadowFinancialAdvisorControl/servlet/DestinationOfficerShadowFinancialAdvisorControlFactFindControlCrm.Servlets.FactFindControlFactFindControl/servlet/FactFindControlInsertAddedCustomerFinancialAdvisorCrm.Servlets.InsertAddedCustomerFinancialAdvisorInsertAddedCustomerFinancialAdvisor/servlet/InsertAddedCustomerFinancialAdvisorInsertAddedCustomerRelationshipOfficerCrm.Servlets.InsertAddedCustomerRelationshipOfficerInsertAddedCustomerRelationshipOfficer/servlet/InsertAddedCustomerRelationshipOfficerInsertAddedCustomerShadowFinancialAdvisorCrm.Servlets.InsertAddedCustomerShadowFinancialAdvisorInsertAddedCustomerShadowFinancialAdvisor/servlet/InsertAddedCustomerShadowFinancialAdvisorKYCControlCrm.Servlets.KYCControlKYCControl/servlet/KYCControlLeadAssignmentTransferCrm.Servlets.LeadAssignmentTransferLeadAssignmentTransfer/servlet/LeadAssignmentTransferLeadAssignmentViewCrm.Servlets.LeadAssignmentViewLeadAssignmentView/servlet/LeadAssignmentViewLeadDetailsGeneratorCrm.Servlets.LeadDetailsGeneratorLeadDetailsGenerator/servlet/LeadDetailsGeneratorListAddedCustomerFinancialAdvisorCrm.Servlets.ListAddedCustomerFinancialAdvisorListAddedCustomerFinancialAdvisor/servlet/ListAddedCustomerFinancialAdvisorListAddedCustomerRelationshipOfficerCrm.Servlets.ListAddedCustomerRelationshipOfficerListAddedCustomerRelationshipOfficer/servlet/ListAddedCustomerRelationshipOfficerListAddedCustomerShadowFinancialAdvisorCrm.Servlets.ListAddedCustomerShadowFinancialAdvisorListAddedCustomerShadowFinancialAdvisor/servlet/ListAddedCustomerShadowFinancialAdvisorRemoveCustomerFinancialAdvisorCrm.Servlets.RemoveCustomerFinancialAdvisorRemoveCustomerFinancialAdvisor/servlet/RemoveCustomerFinancialAdvisorRemoveCustomerRelationshipOfficerCrm.Servlets.RemoveCustomerRelationshipOfficerRemoveCustomerRelationshipOfficer/servlet/RemoveCustomerRelationshipOfficerRemoveCustomerShadowFinancialAdvisorCrm.Servlets.RemoveCustomerShadowFinancialAdvisorRemoveCustomerShadowFinancialAdvisor/servlet/RemoveCustomerShadowFinancialAdvisorRetrieveTipsCrm.Servlets.RetrieveTipsRetrieveTips/servlet/RetrieveTipsSourceCustomerFinancialAdvisorRefreshCrm.Servlets.SourceCustomerFinancialAdvisorRefreshSourceCustomerFinancialAdvisorRefresh/servlet/SourceCustomerFinancialAdvisorRefreshSourceCustomerRefreshCrm.Servlets.SourceCustomerRefreshSourceCustomerRefresh/servlet/SourceCustomerRefreshSourceCustomerShadowFinancialAdvisorRefreshCrm.Servlets.SourceCustomerShadowFinancialAdvisorRefreshSourceCustomerShadowFinancialAdvisorRefresh/servlet/SourceCustomerShadowFinancialAdvisorRefreshSourceOfficerControlCrm.Servlets.SourceOfficerControlSourceOfficerControl/servlet/SourceOfficerControlSourceOfficerFinancialAdvisorControlCrm.Servlets.SourceOfficerFinancialAdvisorControlSourceOfficerFinancialAdvisorControl/servlet/SourceOfficerFinancialAdvisorControlSourceOfficerShadowFinancialAdvisorControlCrm.Servlets.SourceOfficerShadowFinancialAdvisorControlSourceOfficerShadowFinancialAdvisorControl/servlet/SourceOfficerShadowFinancialAdvisorControlTransferCustomerFinancialAdvisorCrm.Servlets.TransferCustomerFinancialAdvisorTransferCustomerFinancialAdvisor/servlet/TransferCustomerFinancialAdvisorTransferCustomerRelationshipOfficerCrm.Servlets.TransferCustomerRelationshipOfficerTransferCustomerRelationshipOfficer/servlet/TransferCustomerRelationshipOfficerTransferCustomerShadowFinancialAdvisorCrm.Servlets.TransferCustomerShadowFinancialAdvisorTransferCustomerShadowFinancialAdvisor/servlet/TransferCustomerShadowFinancialAdvisorUpdateCustomerMonitoringUnitCrm.Servlets.UpdateCustomerMonitoringUnitUpdateCustomerMonitoringUnit/servlet/UpdateCustomerMonitoringUnitSohPdfOutputterCrm.Servlets.SohPdfOutputterSohPdfOutputter/servlet/SohPdfOutputtervariouscontrolCrm.Servlets.variouscontrolvariouscontrol/servlet/variouscontrol        http://jakarta.apache.org/tomcat/debug-taglib                     /WEB-INF/jsp/debug-taglib.tld                 http://jakarta.apache.org/tomcat/examples-taglib                     /WEB-INF/jsp/example-taglib.tld         mail/Sessionjavax.mail.SessionContainerExample Security ConstraintProtected Area/jsp/security/protected/*DELETEGETPOSTPUTtomcatrole1FORMExample Form-Based Authentication Area/jsp/security/protected/login.jsp/jsp/security/protected/error.jspminExemptions1java.lang.Integerfoo/name1value1java.lang.Stringfoo/bar/name2truejava.lang.Booleanname31java.lang.Integerfoo/name410java.lang.IntegerExample EJB Referenceejb/AccountEntitycom.mycompany.mypackage.AccountHomecom.mycompany.mypackage.AccountExample Local EJB Referenceejb/ProcessOrderSessioncom.mycompany.mypackage.ProcessOrderHomecom.mycompany.mypackage.ProcessOrder

Server's context.xml in /Tomcat70/conf/:

WEB-INF/web.xml

回答1:

I removed my server and re add it . worked



回答2:

I got this error when Eclipse overwrote my server.xml, particularly removing JNDI dependancy from one of my contexts:

        

The obvious solution - modify "Servers"-> "Tomcat v7" -> server.xml in Eclipse again manually and add 'Resource' element back.



回答3:

Mine went away after cleaning Tomcat server.



回答4:

I had the same Error today. Then I performed a Clean on Tomcat Server, which told me there are several Maven POMs missing. So I performed a Maven Update Project (Eclipse: Right Click on Project -> Maven -> Update Projects.. -> Select your needed Projects). This solves the Problem for me.



回答5:

I recently faced this strange issue and the answer is the manifest file is not of right encoding or have non visible junc character. It might happen if the file is created in unix environment and you are running it in windows.

solution is to recreate the file witj UTF-8 encoding.



回答6:

That's quite a weird problem, but I resolved it by carefully checking web.xml of my project. This same problem occurred when I added 1 wrong servlet config line to web.xml and it disappeared when removed it. So check your web.xml very carefully and reverse all recent changes to it - if it makes it work, just correct the config errors you just made



回答7:

May be this is the old question... but we can become lesson learned for others...

I got the same errors... and I removed runtime from the server, I remove all the repositories in .m2/repositories, Maven update, compile and it works



回答8:

Restart Tomcat.

Mine got broken after the test servlet caused exceptions.



回答9:

I had the same problem.

I was using Tomcat 8.5, and I used JNDI to configure access to an MySQL database, I used the MySQL-connector jar version 8, in my java application,

I solve it by using MySQL-connector jar version 5.



回答10:

open server configuration by double-clicking on the server name. after that check the checkbox of "Publish module contexts to separate XML files".

and then restart the server



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!