Spring applicationContext (not servlet context) is loaded twice - spring

I created spring config where applicationContext has all 'heavy' beans and
servlet context only controllers. My problem is that applicationContext with all 'big' beans is loaded twice. What I am doing wrong?
I read this and this but not helps:
my web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-conf/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-conf/dispatcher.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
applicationContext.xml
<context:annotation-config/>
<context:component-scan base-package="kkl.server.error" />
<context:component-scan base-package="kkl.server.services" />
<context:component-scan base-package="kkl.server.log" />
<context:component-scan base-package="kkl.server.model" />
<context:component-scan base-package="kkl.server.security" />
<context:component-scan base-package="kkl.server.utils" />
<context:component-scan base-package="kkl.server.validation" />
<!-- ///////////////// properties ///////////////////// -->
<context:property-placeholder
location="classpath:spring-conf/properties/application.properties"
order='0' ignore-resource-not-found="false" />
<context:property-placeholder
location="classpath:spring-conf/properties/local.properties" order='-1'
ignore-unresolvable='true' ignore-resource-not-found="true"/>
<import resource="classpath:spring-conf/spring-aop_and_transactions.xml" />
<import resource="classpath:spring-conf/spring-security.xml" />
<import resource="classpath:spring-conf/spring-database.xml" />
dispatcher.xml
<context:annotation-config />
<mvc:annotation-driven>
<mvc:message-converters>
<bean
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean class="kkl.fireRpg.server.controllers.utils.json.JsonObjectMapper" />
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- ///////////////// scanned packages //////////////////// -->
<context:component-scan base-package="kkl.server.controllers" />
Update
After when I comment every thing in applicationContext and in web.xml (without listener and context-param) my tomcat output looks like this:
`maj 24, 2016 1:13:54 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:firerpg' did not find a matching property.
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.18
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jan 23 2015 11:56:07 UTC
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.18.0
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files (x86)\Java\jdk1.8.0_60\jre
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_60-b27
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\endorsed
maj 24, 2016 1:13:54 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
maj 24, 2016 1:13:54 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.8.0_60\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre1.8.0_60/bin/client;C:/Program Files (x86)/Java/jre1.8.0_60/bin;C:/Program Files (x86)/Java/jre1.8.0_60/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Bitvise SSH Client;D:\programy\java\apache-maven-3.3.9\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\programy\java\eclipseluna\eclipse;;.
maj 24, 2016 1:13:55 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
maj 24, 2016 1:13:55 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
maj 24, 2016 1:13:55 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
maj 24, 2016 1:13:55 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
maj 24, 2016 1:13:55 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 676 ms
maj 24, 2016 1:13:55 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
maj 24, 2016 1:13:55 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.18
maj 24, 2016 1:13:59 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
maj 24, 2016 1:13:59 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
maj 24, 2016 1:13:59 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
maj 24, 2016 1:13:59 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Tue May 24 01:13:59 CEST 2016]; root of context hierarchy
maj 24, 2016 1:13:59 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring-conf/applicationContext.xml]
maj 24, 2016 1:13:59 AM org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [spring-conf/properties/local.properties]
maj 24, 2016 1:13:59 AM org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [spring-conf/properties/application.properties]
maj 24, 2016 1:13:59 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 655 ms
maj 24, 2016 1:14:00 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [265] milliseconds.
maj 24, 2016 1:14:00 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\docs
maj 24, 2016 1:14:00 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\docs has finished in 31 ms
maj 24, 2016 1:14:00 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\examples
maj 24, 2016 1:14:00 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
maj 24, 2016 1:14:00 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
maj 24, 2016 1:14:00 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\examples has finished in 375 ms
maj 24, 2016 1:14:00 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\firerpg
maj 24, 2016 1:14:03 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
maj 24, 2016 1:14:03 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
maj 24, 2016 1:14:03 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
maj 24, 2016 1:14:04 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Tue May 24 01:14:04 CEST 2016]; root of context hierarchy
maj 24, 2016 1:14:04 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring-conf/applicationContext.xml]
maj 24, 2016 1:14:04 AM org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [spring-conf/properties/local.properties]
maj 24, 2016 1:14:04 AM org.springframework.context.support.PropertySourcesPlaceholderConfigurer loadProperties
INFO: Loading properties file from class path resource [spring-conf/properties/application.properties]
maj 24, 2016 1:14:04 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 561 ms
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\firerpg has finished in 3,932 ms
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\host-manager
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\host-manager has finished in 16 ms
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\manager
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\manager has finished in 16 ms
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\ROOT
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\programy\java\apache-tomcat-8.0.18-windows-x86\apache-tomcat-8.0.18\webapps\ROOT has finished in 15 ms
maj 24, 2016 1:14:04 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
maj 24, 2016 1:14:04 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
maj 24, 2016 1:14:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 9413 ms`
this line:
INFO: Loading XML bean definitions from class path resource [spring- conf/applicationContext.xml]
shows twice.

I fight a lot with this problem. I disabled almost everything but it still exist.
Then I back to my eclipse tomcat config where I set up 'use real installtion'.
After when I change setting to use 'use workspace metadata' problem disappears.
I am using eclipse luna release 2 and tomcat 8
I hope this will spare someones time.
UPDATE
After few tries I see that eclipse is breaking my tomcat installation.
(I tried on a new one to be sure).When I set up 'use real installation'
problem occurs again. After this, it still exist even when I run tomcat without eclipse.
Solution is: delete yours tomcat installation.Setup a new one and never change 'use workspace metadata'

Related

Unable to start thredds under tomcat7

I've seen similar posts, but none that seem to be similar enough to help. I'm running Tomcat 7.0.68 and Java 1.8.0_231 on CentOS 6.10 and so far have been unable to install thredds successfully. I followed the instructions at https://www.unidata.ucar.edu/software/tds/current/tutorial/GettingStarted.html#deploying, dropping the thredds.war file into the /opt/tomcat7/webapps directory, and while the thredds directory structure was unpacked, I could not hit localhost:8080/thredds, nor did the /opt/tomcat7/content directory get created.
Here's the pertinent snippet from catalina.out:
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.68
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Feb 8 2016 20:25:54 UTC
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 2.6.32-754.23.1.el6.x86_64
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/java/jre1.8.0_231-amd64
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_231-b11
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/tomcat7
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/tomcat7
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/tomcat7/conf/logging.properties
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx36864m
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xms16384m
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/tomcat7/endorsed
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/tomcat7
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/tomcat7
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/tomcat7/temp
Nov 14, 2019 4:11:43 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Nov 14, 2019 4:11:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 14, 2019 4:11:43 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 780 ms
Nov 14, 2019 4:11:43 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 14, 2019 4:11:43 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68
Nov 14, 2019 4:11:43 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /opt/apache-tomcat-7.0.68/webapps/thredds.war
Nov 14, 2019 4:11:43 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(/opt/tomcat7/webapps/thredds/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Nov 14, 2019 4:11:47 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 14, 2019 4:11:49 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
Nov 14, 2019 4:12:16 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/thredds] startup failed due to previous errors
Nov 14, 2019 4:12:16 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [/thredds] appears to have started a thread named [Log4j2-TF-6-Scheduled-2] but has failed to stop it. This is very likely to create a memory leak.
Nov 14, 2019 4:12:16 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /opt/apache-tomcat-7.0.68/webapps/thredds.war has finished in 33,195 ms
Nov 14, 2019 4:12:16 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7.0.68/webapps/ROOT
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7.0.68/webapps/ROOT has finished in 31 ms
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7.0.68/webapps/manager
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7.0.68/webapps/manager has finished in 27 ms
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7.0.68/webapps/host-manager
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7.0.68/webapps/host-manager has finished in 22 ms
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7.0.68/webapps/docs
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7.0.68/webapps/docs has finished in 18 ms
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/apache-tomcat-7.0.68/webapps/examples
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/apache-tomcat-7.0.68/webapps/examples has finished in 90 ms
Nov 14, 2019 4:12:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 14, 2019 4:12:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 14, 2019 4:12:17 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 33435 ms
I should note that I haven't been able to find the referenced "container log file", so I've run into somewhat of a roadblock. Thanks in advance for any help.
THREDDS Data Server: Deployment fails in Tomcat 8 gave me the hint to look for a log file named "localhost.2019-11-14.log". In it I noticed this line:
"tds.content.root.path" property isn't defined.
Sure enough, thredds started successfully when I added this line to /opt/tomcat7/webapps/thredds/WEB-INF/classes/thredds/server/tds.properties:
tds.content.root.path=/opt/apache-tomcat-7.0.68/webapps/

Can't get WebApp to initialize on Eclipse's Tomcat [was working previously]

I cannot initialize my app on Eclipse's tomcat. It was working fine 8 hours ago. I left it unattended.
Upon my return I had some unrelated issues where a type from the same package could not be resolved so I: 1. Cleaned Maven, 2. Updated project 3. Deleted / RE-added server 4. Rebooted Eclipse
After this the app will not initialize on tomcat. I ran maven build and that built .war if that makes any difference.
Please see server initialization log, servlet initializer, web.xml below.
Some notes:
- I did not edit my pom.xml
App runs on annotations not xml
The sysout's on servlet initializer don't get printed so it doesn't get to that stage.
Servlet Init
package domain.config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class ServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
#Override
protected Class<?>[] getRootConfigClasses() {
System.out.println("Security Servlet init");
return new Class[] { SecurityConfig.class };
}
#Override
protected Class<?>[] getServletConfigClasses() {
System.out.println("Config Servlet init");
return new Class[] { ConfigClass.class };
}
#Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
}
Tomcat log
Nov 29, 2018 4:42:06 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:applicationform' did not find a matching property.
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.10
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 20 2018 17:32:21 UTC
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.10.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_144\jre
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_144-b01
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\endorsed
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Nov 29, 2018 4:42:06 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_144\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files (x86)/Java/jre1.8.0_161/bin/client;C:/Program Files (x86)/Java/jre1.8.0_161/bin;C:/Program Files (x86)/Java/jre1.8.0_161/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Acer\Remote Files\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\PuTTY\;C:\WINDOWS\System32\OpenSSH\;C:\Users\OUYanis\AppData\Local\Microsoft\WindowsApps;C:\sts-3.9.5.RELEASE;;.]
Nov 29, 2018 4:42:07 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Nov 29, 2018 4:42:07 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 29, 2018 4:42:07 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Nov 29, 2018 4:42:07 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 29, 2018 4:42:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2540 ms
Nov 29, 2018 4:42:07 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Nov 29, 2018 4:42:07 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.10
Nov 29, 2018 4:42:21 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 29, 2018 4:42:21 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Nov 29, 2018 4:42:21 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Nov 29, 2018 4:42:21 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13723 ms
Edit, Deployment Assembly
Yanis, I'm glad that did work for you, I actually had the same issue on my side and it did take me a time to figure out that the setting that I had to change was the Deployment Assembly like the screenshot you've posted there.

404 error org.springframework.web.servlet.PageNotFound noHandlerFound

In my spring configuratin file, I have written this code <mvc:view-controller path="/results" view-name="results" /> to map '/results' to viewName 'results'. Its working fine. But the below mappings in the controller are not working.
#RequestMapping(value = "/form", method = RequestMethod.GET)
#RequestMapping(value = "/form", method = RequestMethod.POST)
Its throwing 404 error, when accessing this URL http://localhost:8090/SpringFormValidation/form.
when I removed this code <mvc:view-controller path="/results" view-name="results" />, then the mappings in the controller works fine.
I am just clueless, what is causing it?
I am posting my console output, Controller class and spring configuration file.
My controller class:
package com.github.binoybaranwal.controller;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import com.github.binoybaranwal.pojo.Person;
#Controller
public class WebController extends WebMvcConfigurerAdapter {
#Override
public void addViewControllers(ViewControllerRegistry registry){
registry.addViewController("/results").setViewName("results");
}
#RequestMapping(value = "/form", method = RequestMethod.GET)
public String showForm(Person person){
return "form";
}
#RequestMapping(value = "/form", method = RequestMethod.POST)
public String checkPersonInfo(#Valid Person person, BindingResult bindingResult){
if(bindingResult.hasErrors()){
return "form";
}
return "redirect:/results";
}
}
My spring configuration file
SpringFormValidation-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="com.github.binoybaranwal.controller" />
<tx:annotation-driven/>
<mvc:view-controller path="/results" view-name="results" />
</beans>
My console output:
Dec 14, 2015 12:18:28 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringFormValidation' did not find a matching property.
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.59
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jan 28 2015 15:51:10 UTC
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.59.0
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 8
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.2
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre7
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_79-b15
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\wtpwebapps
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\endorsed
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true
Dec 14, 2015 12:18:28 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Dec 14, 2015 12:18:28 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Sony\VAIO Improvement;C:\Program Files (x86)\Sony\VAIO BIOS Data Transfer Utility\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Git\cmd;C:\apache-maven-3.3.9\bin;.
Dec 14, 2015 12:18:29 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8090"]
Dec 14, 2015 12:18:29 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 14, 2015 12:18:29 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 982 ms
Dec 14, 2015 12:18:29 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 14, 2015 12:18:29 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.59
Dec 14, 2015 12:18:31 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 14, 2015 12:18:31 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 14, 2015 12:18:31 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Dec 14, 2015 12:18:31 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Mon Dec 14 00:18:31 IST 2015]; root of context hierarchy
Dec 14, 2015 12:18:31 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/restws-service-context.xml]
Dec 14, 2015 12:18:31 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 509 ms
Dec 14, 2015 12:18:32 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [307] milliseconds.
Dec 14, 2015 12:18:32 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'SpringFormValidation'
Dec 14, 2015 12:18:32 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'SpringFormValidation': initialization started
Dec 14, 2015 12:18:32 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'SpringFormValidation-servlet': startup date [Mon Dec 14 00:18:32 IST 2015]; parent: Root WebApplicationContext
Dec 14, 2015 12:18:32 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/SpringFormValidation-servlet.xml]
Dec 14, 2015 12:18:32 AM org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler
INFO: Mapped URL path [/results] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
Dec 14, 2015 12:18:33 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'SpringFormValidation': initialization completed in 854 ms
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\binoy
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\binoy has finished in 92 ms
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\docs
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\docs has finished in 78 ms
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\examples
Dec 14, 2015 12:18:33 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 14, 2015 12:18:33 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 14, 2015 12:18:33 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache#6c0f5c75')
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\examples has finished in 591 ms
Dec 14, 2015 12:18:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\host-manager
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\host-manager has finished in 96 ms
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\manager
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\manager has finished in 219 ms
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\ROOT
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\apache-tomcat-7.0.59-windows-x86\apache-tomcat-7.0.59\webapps\ROOT has finished in 70 ms
Dec 14, 2015 12:18:34 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8090"]
Dec 14, 2015 12:18:34 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 14, 2015 12:18:34 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5288 ms
Dec 14, 2015 12:18:36 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/SpringFormValidation/form] in DispatcherServlet with name 'SpringFormValidation'
Dec 14, 2015 12:18:38 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/SpringFormValidation/form] in DispatcherServlet with name 'SpringFormValidation'
Dec 14, 2015 12:18:54 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SpringFormValidation] has started
Dec 14, 2015 12:18:54 AM org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet 'SpringFormValidation'
Dec 14, 2015 12:18:54 AM org.springframework.web.context.support.XmlWebApplicationContext doClose
INFO: Closing WebApplicationContext for namespace 'SpringFormValidation-servlet': startup date [Mon Dec 14 00:18:32 IST 2015]; parent: Root WebApplicationContext
Dec 14, 2015 12:18:54 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Dec 14, 2015 12:18:54 AM org.springframework.web.context.support.XmlWebApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Mon Dec 14 00:18:31 IST 2015]; root of context hierarchy
Dec 14, 2015 12:18:55 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 14, 2015 12:18:55 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 14, 2015 12:18:55 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Dec 14, 2015 12:18:55 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Mon Dec 14 00:18:55 IST 2015]; root of context hierarchy
Dec 14, 2015 12:18:55 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/spring/restws-service-context.xml]
Dec 14, 2015 12:18:56 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 478 ms
Dec 14, 2015 12:18:56 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'SpringFormValidation'
Dec 14, 2015 12:18:56 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'SpringFormValidation': initialization started
Dec 14, 2015 12:18:56 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'SpringFormValidation-servlet': startup date [Mon Dec 14 00:18:56 IST 2015]; parent: Root WebApplicationContext
Dec 14, 2015 12:18:56 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/SpringFormValidation-servlet.xml]
Dec 14, 2015 12:18:56 AM org.springframework.web.servlet.handler.SimpleUrlHandlerMapping registerHandler
INFO: Mapped URL path [/results] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
Dec 14, 2015 12:18:56 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'SpringFormValidation': initialization completed in 638 ms
Dec 14, 2015 12:18:56 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SpringFormValidation] is completed
Dec 14, 2015 1:16:21 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/SpringFormValidation/form] in DispatcherServlet with name 'SpringFormValidation'
I will appreciate your help.
Fixed it by adding annotation #EnableWebMvc in my controller. Thanks

The requested resource is not available. Spring MVC

I have 5 hello world projects that have the same error:
"description: The requested resource is not available."
I'm using jdk7, tomcat7, maven3.1.1. I always use mvn clean/package.
Here is one of this projects
/WEB-INF/dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!-- the package is right( checked it twice) -->
<context:component-scan base-package="ua.abond.tutor.controller" />
<!-- without this tag I get "No mapping found for HTTP request with URI [/SecondSite/hello.htm] in DispatcherServlet with name 'dispatcher'" -->
<mvc:default-servlet-handler />
<!-- also tried mvc:annotation-driven and context:annotation-config tags
didnt help too-->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/pages/" p:suffix=".jsp">
</bean>
<!-- prefix is right, if I had permission, I would have shared my root screenshot -->
</beans>
/WEB-INF/web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>SecondSite</display-name>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
<!-- also tried /*, *, /dispatcher/*, /dispatcher/*.htm and / -->
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
controller
#Controller
public class Home {
String message = "Welcome to your 1st Maven Spring project !";
#RequestMapping(value = "/hello")//also tried: hello, /hello.htm ... no result
public ModelAndView showMessage() {
System.out.println("from controller");
return new ModelAndView("hello", "message", message);
}
}
and my pages
1)index.jsp
<html>
<head>
<title>Tutorial | Spring</title>
</head>
<body>
<h4>
Click Here
</h4>
</body>
</html>
2)WEB-INF/pages/hello.jsp ------ The page I cant reach
<html>
<head>
<title>Tutorial | Spring</title>
</head>
<body>
<h4>${message}</h4>
</body>
</html>
console
Jan 28, 2014 8:57:15 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Programmes\JRE7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\iis express\PHP\v5.4;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL ;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files (x86)\nodejs\ ;C:\Program Files\Apache Software Foundation\apache-maven-3.1.1\bin;C:\Program Files (x86)\Java\jre7\bin;C:\Users\Alex\AppData\Roaming\npm\;.
Jan 28, 2014 8:57:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SecondSite' did not find a matching property.
Jan 28, 2014 8:57:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 28, 2014 8:57:15 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 28, 2014 8:57:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 475 ms
Jan 28, 2014 8:57:15 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 28, 2014 8:57:15 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Jan 28, 2014 8:57:16 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jan 28, 2014 8:57:16 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 28, 2014 8:57:16 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Jan 28, 2014 8:57:16 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Tue Jan 28 20:57:16 EET 2014]; root of context hierarchy
Jan 28, 2014 8:57:16 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
Jan 28, 2014 8:57:17 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
Jan 28, 2014 8:57:17 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 692 ms
Jan 28, 2014 8:57:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Jan 28, 2014 8:57:17 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'dispatcher': initialization started
Jan 28, 2014 8:57:17 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Jan 28 20:57:17 EET 2014]; parent: Root WebApplicationContext
Jan 28, 2014 8:57:17 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
Jan 28, 2014 8:57:17 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
Jan 28, 2014 8:57:17 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'dispatcher': initialization completed in 178 ms
Jan 28, 2014 8:57:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 28, 2014 8:57:17 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 28, 2014 8:57:17 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2025 ms
The dispatcher servlet is only configured to handle *.htm files, so when accessing /hello it won't work.
Try this:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Try with this,
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Put the <mvc:annotation-driven /> in spring configuration.

SEVERE: Servlet threw load() exception javax.servlet.UnavailableException

I am getting the below error while deploying my application in Tomcat 6.0.26 on eclipse Juno. I am using struts for web content and spring for ORM.
I have tried cleaning up and building up the Workspace.
Mar 19, 2013 5:33:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CPCPROJ' did not find a matching property.
Mar 19, 2013 5:33:30 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_18\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_18\jre\bin;C:/Program Files/Java/jdk1.6.0_18/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_18/bin/../jre/bin;C:/Program Files/Java/jdk1.6.0_18/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.6.0_18\bin;E:\Oracle\product\10.1.0\Client_2\bin;E:\Oracle\product\10.1.0\Client_2\jre\1.4.2\bin\client;E:\Oracle\product\10.1.0\Client_2\jre\1.4.2\bin;E:\Oracle\product\10.1.0\Client_1\bin;E:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;E:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Windows Imaging\;C:\Program Files\Java\jdk1.6.0_18\bin;E:\456789\Venkat\Servers\Tomcat\bin;E:\456789\Venkat\Servers\JBoss\bin;E:\apache-maven-2.2.1\bin;E:\456789\Venkat\Servers\apache-ant-1.7.0\bin;.;C:\Documents and Settings\456789\My Documents\Downloads\eclipse-jee-kepler-M4-win32\eclipse;
Mar 19, 2013 5:33:30 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 19, 2013 5:33:30 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 769 ms
Mar 19, 2013 5:33:30 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 19, 2013 5:33:30 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Mar 19, 2013 5:33:31 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(E:\356387\Venkat\Juno\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CPCPROJ\WEB-INF\lib\j2ee-1.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Mar 19, 2013 5:33:31 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(E:\356387\Venkat\Juno\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CPCPROJ\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Mar 19, 2013 5:33:32 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger (com.tcs.framework.configuration.TCSCommonsConfigurationFactory).
log4j:WARN Please initialize the log4j system properly.
Mar 19, 2013 5:33:43 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Mar 19, 2013 5:33:43 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /CPCPROJ threw load() exception
javax.servlet.UnavailableException
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:402)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 19, 2013 5:33:44 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'CPCPROJ'
Mar 19, 2013 5:33:47 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 19, 2013 5:33:47 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 19, 2013 5:33:47 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Mar 19, 2013 5:33:47 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 16435 ms
I think the data you provided in web.xml is not proper please check it once.
see here for details

Resources