XML-free Spring not setting up - spring

I've run this project previously in STS but am trying to replicate it in Eclipse 4.2 to no luck. I'm running the same Spring XML-free base setup as described http://blog.codeleak.pl/2011/06/spring-31-mvc-xml-free-configuration-in.html .
I'm using maven 3 embedded in Eclipse 4.2 and an embedded tomcat 7.
When I start the project up on tomcat 7.0.12...
Aug 05, 2013 1:04:29 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:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin/client;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/lib/i386;C:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Dell\DW WLAN Card;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\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\Security Innovation\SI TSS\bin\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Apache\apache-maven-3.0.5\bin;C:\Program Files (x86)\Git\cmd;C:\Development\eclipse-4.2_x86;;.
Aug 05, 2013 1:04:29 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:inst_tdcsim_server' did not find a matching property.
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 422 ms
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 259 ms
No mention of mappings being registered and no URL works, just 404s.
I tried changing the context root in Eclipse and the Tomcat server xml to '/' and that dind't help either.
I tried setting debug points in the code and nothing stops.
I tried setting all logging to 'ALL' after I brought in log4j, nothing shows.
I tried creating a blatant nullpointerexception on the first line of the onStartup method and nothing.
How is this spring app not responding to anything I try to do to get a response?
Any help would be hugely appreciated.

The solution involved Eclipse not deploying the assembly correctly.
Goto properties on the project -> Deployment Assembly -> Added "/src/main/java" deployed to "WEB-INF/classes" and then it picked up my Initializer. Not sure why this wasn't there to begin with.

Related

Spring context is not loading after deploying on tomcat

Am trying to load spring batch job context file on deployment of war.
I have added contextConfigLocation as below but not working.Even added spring-web in pom.xml but still when i deploy my war application onto tomcat spring is not being initialized.Please help me since i have referred to most of SO and spring forums answers,i dont want to use dispatcher servlet since this is not a web application as of now .It is just a batch job but in future it will be a batch job + web application ,at that time i will have a dispatcher servlet .Please let me know how to load spring on server start up.
My git repository where full code is present
https://github.com/sumateja/patternfinder
https://github.com/sumateja/patternfinder.git
tomcat logs
Dec 25, 2015 12:20:59 AM 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.7.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;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\Java\jdk1.7.0_45\bin;C:\Development\apache-maven-3.1.1\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\MySQL\MySQL Enterprise Backup 3.12\;C:\Program Files\Git\cmd;C:\Ruby21-x64\bin;C:\Users\Tejas\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Tejas\AppData\Local\Programs\Python\Python35-32\;C:\Users\Tejas\AppData\Local\Programs\Python\Launcher\;C:\Users\Tejas\AppData\Roaming\npm;C:\Program Files\Git\bin;.
Dec 25, 2015 12:20:59 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:patternfinder' did not find a matching property.
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9090"]
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-9009"]
Dec 25, 2015 12:20:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 548 ms
Dec 25, 2015 12:20:59 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 25, 2015 12:20:59 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9090"]
Dec 25, 2015 12:20:59 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-9009"]
Dec 25, 2015 12:20:59 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 547 ms
web.xml
<web-app version="3.0" 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_3_0.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:equity-eod-job.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
I cloned your project on my machine. I did "mvn clean package". When I was about to copy the war file from target folder to tomcat webapps folder, I noticed that you are packaging it as jar instead of war. :)
change in your pom.xml, value of packaging from jar to war :
<modelVersion>4.0.0</modelVersion>
<groupId>patternfinder</groupId>
<artifactId>patternfinder</artifactId>
<packaging>war</packaging> <!-- This line from jar to war-->
<version>1.0</version>
<name>patternfinder</name>
After this do:
mvn clean package
copy target/patternfinder-1.0.war to tomcat webapp folder
start tomcat
now you can see that your application will start loading. seems there is a wrong file path, in logs you can find FileNotFoundException occurring. I hope you can resolve this.
Yes finally this got solved . It seems that my web.xml was not being picked up ,since openshift had put the web.xml in webapps folder.Hence deleted this folder after copying WEB-INF folder to WebContent.When we download a project created in openshift into our workspace ,web.xml is present in webapps folder.Thanks prem for your help.

Tomcat errors when we starting Spring MVC project

I am new to learning Spring MVC. My program listings are below. I have a controller in my src/MySpringMVCProjects folder. I get multiple markers of errors in the controller class, on the Exception, String and getParameter lines.
Controller
package MySpringMVCProjects;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HelloController implements Controller {
public ModelAndView handleRequest(HttpServletRequest req,
HttpServletResponse res) throws Exception {
String name = req.getParameter("name");
Map m = new HashMap();
m.put("msg", "Hello" + name);
ModelAndView mav = new ModelAndView("success", m);
return mav;
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<display-name>FirstMVCHelloWorld</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- default -->
<servlet>
<servlet-name>HelloController</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloController</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
</web-app>
Servlet xml : helloWorld-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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!-- default handler mapping -->
<!-- handler -->
<bean class = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<!-- controller -->
<bean name = "/hello.htm" class = "MySpringMVCProjects.HelloController" />
<!-- view resolver -->
<bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name = "prefix" value ="/" />
<property name = "suffix" value =".jsp" />
</bean>
</beans>
index.jsp:
<h1>HelloWorld</h1>
<form action = "./hello.htm">
NAME:<input type="text" value="name"/>
<input type="submit" value="sayHello"/>
</form>
success.jsp:
${msg}
Directory structure:
Apache Tomcat error logs when running server:
Oct 09, 2015 1:25:15 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SimpleWebService' did not find a matching property.
Oct 09, 2015 1:25:15 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:FirstMVCHelloWorld' did not find a matching property.
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.64
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Aug 19 2015 17:18:06 UTC
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.64.0
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 8.1
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.3
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre7
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_75-b13
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\gafg\Desktop\IVP\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 7.0
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\gafg\Desktop\IVP\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 7.0
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\gafg\Desktop\IVP\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 7.0\endorsed
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Oct 09, 2015 1:25:15 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/Java/jre7/bin/server;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/amd64;C:\app\gafg\product\11.2.0\client_1\BIN;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 (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Symantec\VIP Access Client\;C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\;C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer\;C:\Microsoft SQL Server Migration Assistant for Oracle\bin\;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 (x86)\Skype\Phone\;C:\jdk1.7\bin;.;;C:\Users\gafg\Documents\Eclipse - Kepler\Eclipse-Kepler\eclipse;;.
Oct 09, 2015 1:25:15 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8001"]
Oct 09, 2015 1:25:15 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Oct 09, 2015 1:25:15 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 852 ms
Oct 09, 2015 1:25:15 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Oct 09, 2015 1:25:15 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.64
Oct 09, 2015 1:25:15 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\gafg\Desktop\IVP\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\FirstMVCHelloWorld\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Oct 09, 2015 1:25:16 AM 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.
Oct 09, 2015 1:25:16 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [111] milliseconds.
Oct 09, 2015 1:25:16 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\gafg\Desktop\IVP\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\SimpleWebService\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Oct 09, 2015 1:25:17 AM 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.
Oct 09, 2015 1:25:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8001"]
Oct 09, 2015 1:25:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Oct 09, 2015 1:25:18 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2439 ms
What is the error? How i can resolve this?
Seems the server started properly.
From the project structure it looks like as you are unable to compile the project: Reason being your have added Source files not the actual lib.
You can check out some already available tutorial like:
http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example-annotation/
http://crunchify.com/simplest-spring-mvc-hello-world-example-tutorial-spring-model-view-controller-tips/
If you still face any problem, please paste the log entries from your log file
Can you please paste the error from Log4j or slf4j.

Spring application is not loading in tomcat 7.0.47 but is loading in Tomcat 7.0.34 within Eclipse Kepler

Till now i was using tomcat 7.0.34 and my spring application was loading perfectly. Yesterday i decided to use 7.0.47 and the container is not loading anymore my application. If i switch back to 34 version it works again. I tested on 7.0.52 and the same problem is there.
Not sure what can be the issue.
StackTrace
Mrz 28, 2014 11:03:28 AM 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;d:\imagemagick-6.3.9-q8;C:\Program Files\ImageMagick-6.8.8-Q16;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM FILES\THINKPAD\BLUETOOTH SOFTWARE\;C:\PROGRAM FILES\THINKPAD\BLUETOOTH SOFTWARE\SYSWOW64;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\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 (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Microsoft Network Monitor 3\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Services\IPT\;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 (x86)\Java\jdk1.7.0_51;D:\apache-cassandra-2.0.5;D:\maven/bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;.
Mrz 28, 2014 11:03: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:daydiary' did not find a matching property.
Mrz 28, 2014 11:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mrz 28, 2014 11:03:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mrz 28, 2014 11:03:28 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 756 ms
Mrz 28, 2014 11:03:28 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mrz 28, 2014 11:03:28 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Mrz 28, 2014 11:03:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mrz 28, 2014 11:03:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mrz 28, 2014 11:03:30 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2201 ms
The problem i see is my WebApplicationInitializer implementation is not detected somehow. What can be the cause for this.?
I am using JDK 7 , spring 4.0.2
Oh man !.... I just deleted the web.xml file and the WebApplicationInitializer is now loaded.
Previously i had both of them. Just not sure if you can have both with this kind of configuration but looks like you cannot....

classNotFoundException DispatcherServlet Exception

I am trying to learn spring 3 MVC.
I downloaded sample project from the below link
http://javapapers.com/spring/spring-mvc-hello-world/
I am getting classNotFoundException
I am using eclipse IDE, Toamcat 7.0. I attached my project here.
http://www.sendspace.com/file/4twdy6
Could someone please help me what I am missing.
As per the comments: Exception log is below:
Sep 06, 2013 6:33:52 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;.
Sep 06, 2013 6:33:52 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringMVC' did not find a matching property.
Sep 06, 2013 6:33:53 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 06, 2013 6:33:53 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 06, 2013 6:33:53 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 997 ms
Sep 06, 2013 6:33:53 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 06, 2013 6:33:53 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 06, 2013 6:33:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet springDispatcher as unavailable
Sep 06, 2013 6:33:53 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /SpringMVC threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Sep 06, 2013 6:33:53 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 06, 2013 6:33:53 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 06, 2013 6:33:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 601 ms
Thanks

Tomcat 7, cannot disable web application autoDeploy

After deploying a web application, my Tomcat 7 server doesn't start anymore, signaling an exception during startup process.
So I tried to configure Tomcat to avoid to deploy the webapps at startup.
To do so, I've modified my ${CATALINA_BASE}/conf/server.xml and add an autoDeploy="false" attribute to the Host node. (I've also verified that there are no liveDeploy attributes):
<Host appBase="webapps" autoDeploy="false" name="localhost" unpackWARs="true">
...
then I read about liveDeploy attribute with a slightly different behaviour, and to be sure I disabled it too:
<Host appBase="webapps" autoDeploy="false" liveDeploy = "false" name="localhost" unpackWARs="true">
...
The problem is that it seems to do nothing, and in the outuput I still see "Deploying configuration descriptor" lines, till the one that crashes Tomcat.
Here there is the server output; I've include the startup, a first application (MyFirstApplication) that is deployed correctly, and the last one that crashses the server.
Using CATALINA_BASE: "C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11"
Using CATALINA_TMPDIR: "C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\temp"
Using JRE_HOME: "C:\Program Files (x86)\Java\jdk1.7.0"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin\tomcat-juli.jar"
gen 14, 2013 3:08:28 PM org.apache.catalina.core.AprLifecycleListener init
Informazioni: 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.7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files (x86)\CollabNet\Subversion Client;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files\Java\jdk1.6.0_23\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Program Files (x86)\spring-roo-1.1.4.RELEASE\bin;C:\Program Files\NetBeans 6.9.1\java\ant\bin;C:\Program Files (x86)\GNU\GnuPG\pub;C:\Program Files (x86)\QuickTime\QTSystem\;c:\Program Files\NetBeans 7.2\java\maven\bin;C:\Program Files (x86)\Nmap;C:\cmdutilities;.
gen 14, 2013 3:08:28 PM org.apache.coyote.AbstractProtocolHandler init
Informazioni: Initializing ProtocolHandler ["http-bio-8084"]
gen 14, 2013 3:08:28 PM org.apache.coyote.AbstractProtocolHandler init
Informazioni: Initializing ProtocolHandler ["ajp-bio-8009"]
gen 14, 2013 3:08:28 PM org.apache.catalina.startup.Catalina load
Informazioni: Initialization processed in 411 ms
gen 14, 2013 3:08:28 PM org.apache.catalina.core.StandardService startInternal
Informazioni: Starting service Catalina
gen 14, 2013 3:08:28 PM org.apache.catalina.core.StandardEngine startInternal
Informazioni: Starting Servlet Engine: Apache Tomcat/7.0.11
gen 14, 2013 3:08:28 PM org.apache.catalina.startup.HostConfig deployDescriptor
Informazioni: Deploying configuration descriptor MyFirstWebApp.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
gen 14, 2013 3:08:38 PM org.springframework.web.context.ContextLoader initWebApplicationContext
Informazioni: Root WebApplicationContext: initialization started
[...]
Informazioni: Deploying configuration descriptor manager.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
gen 14, 2013 3:08:40 PM org.apache.catalina.startup.HostConfig deployDescriptor
Informazioni: Deploying configuration descriptor MavenSpringHibernate.xml from C:\Users\Jack\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.11.0_base\conf\Catalina\localhost
Exception in thread "main" Exception in thread "Thread-1"
You want set deployOnStartup, not autoDeploy (or possibly both). There is no such setting of liveDeploy.
From the Tomcat 7 docs for Host [1]
autoDeploy
This flag value indicates if Tomcat should check periodically for new
or updated web applications while Tomcat is running. If true, Tomcat
periodically checks the appBase and xmlBase directories and deploys
any new web applications or context XML descriptors found. Updated web
applications or context XML descriptors will trigger a reload of the
web application. The flag's value defaults to true. See Automatic
Application Deployment for more information.
deployOnStartup
This flag value indicates if web applications from this host should be
automatically deployed when Tomcat starts. The flag's value defaults
to true. See Automatic Application Deployment for more information.
[1] http://tomcat.apache.org/tomcat-7.0-doc/config/host.html

Resources