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

13

16

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:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

    <!-- Define CRM session timeout -->
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>

    <!-- Define servlet-mapped and path-mapped example filters -->
    <filter>
        <filter-name>Servlet Mapped Filter</filter-name>
        <filter-class>Filters.ExampleFilter</filter-class>
    <init-param>
        <param-name>attribute</param-name>
        <param-value>Filters.ExampleFilter.SERVLET_MAPPED</param-value>
    </init-param>
    </filter>
    <filter>
        <filter-name>Path Mapped Filter</filter-name>
        <filter-class>Filters.ExampleFilter</filter-class>
    <init-param>
        <param-name>attribute</param-name>
        <param-value>Filters.ExampleFilter.PATH_MAPPED</param-value>
    </init-param>
    </filter>
    <filter>
        <filter-name>Request Dumper Filter</filter-name>
        <filter-class>Filters.RequestDumperFilter</filter-class>
    </filter>

    <filter>
        <filter-name>Set Character Encoding</filter-name>
        <filter-class>Filters.SetCharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>EUC_JP</param-value>
        </init-param>
    </filter>
    <filter>
        <filter-name>Compression Filter</filter-name>
        <filter-class>CompressionFilters.CompressionFilter</filter-class>
        <init-param>
          <param-name>compressionThreshold</param-name>
          <param-value>10</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
    </filter>

    <!-- Define filter mappings for the defined filters -->
    <filter-mapping>
        <filter-name>Servlet Mapped Filter</filter-name>
    <servlet-name>invoker</servlet-name>
    </filter-mapping>
    <filter-mapping>
        <filter-name>Path Mapped Filter</filter-name>
    <url-pattern>/servlet/*</url-pattern>
    </filter-mapping>

    <!-- Define example application events listeners -->
    <listener>
        <listener-class>Listeners.ContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>Listeners.SessionListener</listener-class>
    </listener>

    <!-- Define servlets that are included in the example application -->
    <servlet>
        <servlet-name>SendMailServlet</servlet-name>
        <servlet-class>SendMailServlet</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>
            snoop
        </servlet-name>
        <servlet-class>
            SnoopServlet
        </servlet-class>
        <run-as>
            <description>Security role for anonymous access</description>
            <role-name>tomcat</role-name>
        </run-as>
    </servlet>

    <servlet>
      <servlet-name>
          servletToJsp
      </servlet-name>
      <servlet-class>
          servletToJsp
      </servlet-class>
    </servlet>
    <servlet>
        <servlet-name>
            CompressionFilterTestServlet
        </servlet-name>
        <servlet-class>
            CompressionFilters.CompressionFilterTestServlet
        </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>
            CompressionFilterTestServlet
        </servlet-name>
        <url-pattern>
            /CompressionTest
        </url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>SendMailServlet</servlet-name>
        <url-pattern>/SendMailServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>
            snoop
        </servlet-name>
        <url-pattern>
            /snoop
        </url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>
            servletToJsp
        </servlet-name>
        <url-pattern>
            /servletToJsp
        </url-pattern>
    </servlet-mapping>

    <!-- Added 11/02/2013 - Ryan Sammut -->
    <!-- Servlet Mapping -->
    <servlet>
        <servlet-name>AddNewContact</servlet-name> 
        <servlet-class>Crm.Servlets.AddNewContact</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>AddNewContact</servlet-name> 
        <url-pattern>/servlet/AddNewContact</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>AddTip</servlet-name> 
        <servlet-class>Crm.Servlets.AddTip</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>AddTip</servlet-name> 
        <url-pattern>/servlet/AddTip</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>CaaPdfOutputter</servlet-name> 
        <servlet-class>Crm.Servlets.CaaPdfOutputter</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>CaaPdfOutputter</servlet-name> 
        <url-pattern>/servlet/CaaPdfOutputter</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>CaaTestSubmit</servlet-name> 
        <servlet-class>Crm.Servlets.CaaTestSubmit</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>CaaTestSubmit</servlet-name> 
        <url-pattern>/servlet/CaaTestSubmit</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DeleteTip</servlet-name> 
        <servlet-class>Crm.Servlets.DeleteTip</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DeleteTip</servlet-name> 
        <url-pattern>/servlet/DeleteTip</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationCustomerFinancialAdvisorRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationCustomerFinancialAdvisorRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationCustomerFinancialAdvisorRefresh</servlet-name> 
        <url-pattern>/servlet/DestinationCustomerFinancialAdvisorRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationCustomerRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationCustomerRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationCustomerRefresh</servlet-name> 
        <url-pattern>/servlet/DestinationCustomerRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationCustomerShadowFinancialAdvisorRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationCustomerShadowFinancialAdvisorRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationCustomerShadowFinancialAdvisorRefresh</servlet-name> 
        <url-pattern>/servlet/DestinationCustomerShadowFinancialAdvisorRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationOfficerControl</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationOfficerControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationOfficerControl</servlet-name> 
        <url-pattern>/servlet/DestinationOfficerControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationOfficerFinancialAdvisorControl</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationOfficerFinancialAdvisorControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationOfficerFinancialAdvisorControl</servlet-name> 
        <url-pattern>/servlet/DestinationOfficerFinancialAdvisorControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>DestinationOfficerShadowFinancialAdvisorControl</servlet-name> 
        <servlet-class>Crm.Servlets.DestinationOfficerShadowFinancialAdvisorControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>DestinationOfficerShadowFinancialAdvisorControl</servlet-name> 
        <url-pattern>/servlet/DestinationOfficerShadowFinancialAdvisorControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>FactFindControl</servlet-name> 
        <servlet-class>Crm.Servlets.FactFindControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>FactFindControl</servlet-name> 
        <url-pattern>/servlet/FactFindControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>InsertAddedCustomerFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.InsertAddedCustomerFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>InsertAddedCustomerFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/InsertAddedCustomerFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>InsertAddedCustomerRelationshipOfficer</servlet-name> 
        <servlet-class>Crm.Servlets.InsertAddedCustomerRelationshipOfficer</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>InsertAddedCustomerRelationshipOfficer</servlet-name> 
        <url-pattern>/servlet/InsertAddedCustomerRelationshipOfficer</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>InsertAddedCustomerShadowFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.InsertAddedCustomerShadowFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>InsertAddedCustomerShadowFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/InsertAddedCustomerShadowFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>KYCControl</servlet-name> 
        <servlet-class>Crm.Servlets.KYCControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>KYCControl</servlet-name> 
        <url-pattern>/servlet/KYCControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>LeadAssignmentTransfer</servlet-name> 
        <servlet-class>Crm.Servlets.LeadAssignmentTransfer</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>LeadAssignmentTransfer</servlet-name> 
        <url-pattern>/servlet/LeadAssignmentTransfer</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>LeadAssignmentView</servlet-name> 
        <servlet-class>Crm.Servlets.LeadAssignmentView</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>LeadAssignmentView</servlet-name> 
        <url-pattern>/servlet/LeadAssignmentView</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>LeadDetailsGenerator</servlet-name> 
        <servlet-class>Crm.Servlets.LeadDetailsGenerator</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>LeadDetailsGenerator</servlet-name> 
        <url-pattern>/servlet/LeadDetailsGenerator</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>ListAddedCustomerFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.ListAddedCustomerFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>ListAddedCustomerFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/ListAddedCustomerFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>ListAddedCustomerRelationshipOfficer</servlet-name> 
        <servlet-class>Crm.Servlets.ListAddedCustomerRelationshipOfficer</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>ListAddedCustomerRelationshipOfficer</servlet-name> 
        <url-pattern>/servlet/ListAddedCustomerRelationshipOfficer</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>ListAddedCustomerShadowFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.ListAddedCustomerShadowFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>ListAddedCustomerShadowFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/ListAddedCustomerShadowFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>RemoveCustomerFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.RemoveCustomerFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>RemoveCustomerFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/RemoveCustomerFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>RemoveCustomerRelationshipOfficer</servlet-name> 
        <servlet-class>Crm.Servlets.RemoveCustomerRelationshipOfficer</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>RemoveCustomerRelationshipOfficer</servlet-name> 
        <url-pattern>/servlet/RemoveCustomerRelationshipOfficer</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>RemoveCustomerShadowFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.RemoveCustomerShadowFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>RemoveCustomerShadowFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/RemoveCustomerShadowFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>RetrieveTips</servlet-name> 
        <servlet-class>Crm.Servlets.RetrieveTips</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>RetrieveTips</servlet-name> 
        <url-pattern>/servlet/RetrieveTips</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceCustomerFinancialAdvisorRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.SourceCustomerFinancialAdvisorRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceCustomerFinancialAdvisorRefresh</servlet-name> 
        <url-pattern>/servlet/SourceCustomerFinancialAdvisorRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceCustomerRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.SourceCustomerRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceCustomerRefresh</servlet-name> 
        <url-pattern>/servlet/SourceCustomerRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceCustomerShadowFinancialAdvisorRefresh</servlet-name> 
        <servlet-class>Crm.Servlets.SourceCustomerShadowFinancialAdvisorRefresh</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceCustomerShadowFinancialAdvisorRefresh</servlet-name> 
        <url-pattern>/servlet/SourceCustomerShadowFinancialAdvisorRefresh</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceOfficerControl</servlet-name> 
        <servlet-class>Crm.Servlets.SourceOfficerControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceOfficerControl</servlet-name> 
        <url-pattern>/servlet/SourceOfficerControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceOfficerFinancialAdvisorControl</servlet-name> 
        <servlet-class>Crm.Servlets.SourceOfficerFinancialAdvisorControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceOfficerFinancialAdvisorControl</servlet-name> 
        <url-pattern>/servlet/SourceOfficerFinancialAdvisorControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SourceOfficerShadowFinancialAdvisorControl</servlet-name> 
        <servlet-class>Crm.Servlets.SourceOfficerShadowFinancialAdvisorControl</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SourceOfficerShadowFinancialAdvisorControl</servlet-name> 
        <url-pattern>/servlet/SourceOfficerShadowFinancialAdvisorControl</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>TransferCustomerFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.TransferCustomerFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>TransferCustomerFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/TransferCustomerFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>TransferCustomerRelationshipOfficer</servlet-name> 
        <servlet-class>Crm.Servlets.TransferCustomerRelationshipOfficer</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>TransferCustomerRelationshipOfficer</servlet-name> 
        <url-pattern>/servlet/TransferCustomerRelationshipOfficer</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>TransferCustomerShadowFinancialAdvisor</servlet-name> 
        <servlet-class>Crm.Servlets.TransferCustomerShadowFinancialAdvisor</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>TransferCustomerShadowFinancialAdvisor</servlet-name> 
        <url-pattern>/servlet/TransferCustomerShadowFinancialAdvisor</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>UpdateCustomerMonitoringUnit</servlet-name> 
        <servlet-class>Crm.Servlets.UpdateCustomerMonitoringUnit</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>UpdateCustomerMonitoringUnit</servlet-name> 
        <url-pattern>/servlet/UpdateCustomerMonitoringUnit</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>SohPdfOutputter</servlet-name> 
        <servlet-class>Crm.Servlets.SohPdfOutputter</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>SohPdfOutputter</servlet-name> 
        <url-pattern>/servlet/SohPdfOutputter</url-pattern> 
    </servlet-mapping>

    <servlet>
        <servlet-name>variouscontrol</servlet-name> 
        <servlet-class>Crm.Servlets.variouscontrol</servlet-class> 
    </servlet>
    <servlet-mapping>
        <servlet-name>variouscontrol</servlet-name> 
        <url-pattern>/servlet/variouscontrol</url-pattern> 
    </servlet-mapping>

    <taglib>
        <taglib-uri>
       http://jakarta.apache.org/tomcat/debug-taglib
        </taglib-uri>
        <taglib-location>
           /WEB-INF/jsp/debug-taglib.tld
        </taglib-location>
    </taglib>

    <taglib>
        <taglib-uri>
       http://jakarta.apache.org/tomcat/examples-taglib
        </taglib-uri>
        <taglib-location>
           /WEB-INF/jsp/example-taglib.tld
        </taglib-location>
    </taglib>

    <resource-ref>
      <res-ref-name>mail/Session</res-ref-name>
      <res-type>javax.mail.Session</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>

    <security-constraint>
      <display-name>Example Security Constraint</display-name>
      <web-resource-collection>
         <web-resource-name>Protected Area</web-resource-name>
     <!-- Define the context-relative URL(s) to be protected -->
         <url-pattern>/jsp/security/protected/*</url-pattern>
     <!-- If you list http methods, only those methods are protected -->
     <http-method>DELETE</http-method>
         <http-method>GET</http-method>
         <http-method>POST</http-method>
     <http-method>PUT</http-method>
      </web-resource-collection>
      <auth-constraint>
         <!-- Anyone with one of the listed roles may access this area -->
         <role-name>tomcat</role-name>
     <role-name>role1</role-name>
      </auth-constraint>
    </security-constraint>

    <!-- Default login configuration uses form-based authentication -->
    <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Example Form-Based Authentication Area</realm-name>
      <form-login-config>
        <form-login-page>/jsp/security/protected/login.jsp</form-login-page>
        <form-error-page>/jsp/security/protected/error.jsp</form-error-page>
      </form-login-config>
    </login-config>

    <!-- Environment entry examples -->
    <!--env-entry>
      <env-entry-description>
         The maximum number of tax exemptions allowed to be set.
      </env-entry-description>
      <env-entry-name>maxExemptions</env-entry-name>
      <env-entry-value>15</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry-->
    <env-entry>
      <env-entry-name>minExemptions</env-entry-name>
      <env-entry-value>1</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/name1</env-entry-name>
      <env-entry-value>value1</env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/bar/name2</env-entry-name>
      <env-entry-value>true</env-entry-value>
      <env-entry-type>java.lang.Boolean</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>name3</env-entry-name>
      <env-entry-value>1</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/name4</env-entry-name>
      <env-entry-value>10</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>

    <!-- EJB Reference -->
    <ejb-ref>
      <description>Example EJB Reference</description>
      <ejb-ref-name>ejb/Account</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <home>com.mycompany.mypackage.AccountHome</home>
      <remote>com.mycompany.mypackage.Account</remote>
    </ejb-ref>

    <!-- Local EJB Reference -->
    <ejb-local-ref>
      <description>Example Local EJB Reference</description>
      <ejb-ref-name>ejb/ProcessOrder</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>com.mycompany.mypackage.ProcessOrderHome</local-home>
      <local>com.mycompany.mypackage.ProcessOrder</local>
    </ejb-local-ref>
</web-app>

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

<?xml version='1.0' encoding='utf-8'?>
<Context>
   <WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
Brachy answered 31/12, 2013 at 9:16 Comment(7)
What do you have in your web.xml and Tomcat's context.xml in terms of JNDI lookups?Najera
@Najera - Added my code in the following files in the update aboveBrachy
The error seems to be warning only and its not coming from your application, but Tomcat Manager. Does it actually prevent you running your application?Najera
@Najera - Yes the application does not start in fact. The problem seemed to have cropped up with newer development, but in reality, I just added a new servlet and some classes to the application.Brachy
Is that the only error in Tomcat logs? Was this error present in earlier log files (i.e. when the application was still working for you?). Are there any other log files, i.e. localhost.log? I am not convinced that the above error is the problem here.Najera
I encountered this today, running Tomcat server on Eclipse. After cleaning my project and republishing it started just fine.Tabret
Does no one know why does errors like these originate? There must be some reason for this?Settles
L
17

open server configuration by double-clicking on the server name. after that check the checkbox of "Publish module contexts to separate XML files". enter image description here and then restart the server

Sometimes, It's worked by removing and adding the server will resolves this issue

Lactescent answered 26/2, 2018 at 11:55 Comment(2)
Worked for me. Thanks.Stern
Anyone knows why this worked? What happened underneath?Pastypat
D
9

I removed my server and re add it . worked

Dvorak answered 5/7, 2016 at 0:2 Comment(0)
F
5

Mine went away after cleaning Tomcat server.

enter image description here

Fearful answered 31/1, 2017 at 3:57 Comment(0)
I
5

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.

Including answered 28/4, 2017 at 9:21 Comment(1)
this helped me tyOntiveros
M
2

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

        <Context
            docBase="myapp"
            path="/myapp"
            reloadable="true"
            source="org.eclipse.jst.j2ee.server:myapp"
        >
            <Resource
                name="jdbc/myDataSource"
                auth="Container"
                type="javax.sql.DataSource"
                ... />
        </Context>

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

Moonier answered 5/10, 2014 at 11:14 Comment(0)
T
0

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.

Thorlay answered 15/1, 2014 at 17:41 Comment(2)
Could you please explain why MANIFEST file could cause such a problem?Stedfast
I dont have a complete answer to it, but it is clear that a manifest file plays a role when deploying the archive. Simply deletion of manifest sometime helps because that triggers creation of a new with proper char spec during deployment or war packagingThorlay
S
0

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

Speos answered 17/7, 2014 at 1:34 Comment(0)
I
0

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

Inherited answered 10/12, 2016 at 4:14 Comment(0)
J
0

Restart Tomcat.

Mine got broken after the test servlet caused exceptions.

Jarib answered 9/4, 2017 at 20:50 Comment(0)
P
0

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.

Perfection answered 21/2, 2018 at 17:21 Comment(0)
K
0

It might due to java is corrupted, uninstall the java and install the new java version. it worked for me..

Kesha answered 3/4, 2018 at 6:41 Comment(0)
U
0

Had the same problem after setting up a complete new eclipse. Couldn´t get webapps running after fresh checkout.

In my case I had to set the "Targeted Runtimes" in the project-properties:

enter image description here

After that you can see the library in your Project:

enter image description here

Utgardloki answered 11/12, 2018 at 8:26 Comment(0)
G
0

The next solution worked for me:

Edit server.xml and remove (near the end of the file):

<Context docBase="xxx" path="/xxx" reloadable="true" source="org.eclipse.jst.j2ee.server:xxx"/>

That was a reference to a removed application.

Gilstrap answered 10/5, 2019 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.