I am trying to bring up a REST Server(without UI) using jersey + grizzly. I am attempting to use spring.
My github project link: https://github.com/seshumadhav/java-projects/tree/master/grizzlySpringJersey
When I run 'MyServer', and hit a url like http://localhost:3388/smc/time, I am banged with a ServletHandler.doServletService 'java.lang.NoSuchMethodError' exception. Full server log below
Can someone help me understand reason behind this, and how to get this fixed ?
Dec 26, 2013 5:53:21 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Starting application [DEMO REST Server WebappContext] ...
Dec 26, 2013 5:53:21 PM org.glassfish.grizzly.servlet.WebappContext log
INFO: [DEMO REST Server WebappContext] Initializing Spring root WebApplicationContext
Dec 26, 2013 5:53:21 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Dec 26, 2013 5:53:21 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Thu Dec 26 17:53:21 IST 2013]; root of context hierarchy
Dec 26, 2013 5:53:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Dec 26, 2013 5:53:21 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#192d5cf3: defining beans [resourceFoo,springRunner,myBean,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Dec 26, 2013 5:53:21 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 377 ms
Dec 26, 2013 5:53:21 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
Dec 26, 2013 5:53:21 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, resourceFoo, of type com.demo.web.ResourceFoo as a root resource class
Dec 26, 2013 5:53:21 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.17.1 02/28/2013 12:47 PM'
Dec 26, 2013 5:53:22 PM org.glassfish.grizzly.servlet.WebappContext initServlets
INFO: [DEMO REST Server WebappContext] Servlet [com.sun.jersey.spi.spring.container.servlet.SpringServlet] registered for url pattern(s) [[/*]].
Dec 26, 2013 5:53:22 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Application [DEMO REST Server WebappContext] is ready to service requests. Root: [/].
Dec 26, 2013 5:53:22 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [localhost:3388]
Dec 26, 2013 5:53:22 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
In order to test the server please try the following urls:
http://localhost:3388/smc/time to see time for smc
http://localhost:3388/bsv/time to see time for bsv
Press enter to stop the server...
Dec 26, 2013 5:53:28 PM org.glassfish.grizzly.servlet.ServletHandler doServletService
SEVERE: service exception:
java.lang.NoSuchMethodError: org.glassfish.grizzly.http.server.Request.createInputStream()Lorg/glassfish/grizzly/http/io/NIOInputStream;
at org.glassfish.grizzly.servlet.ServletInputStreamImpl.initialize(ServletInputStreamImpl.java:89)
at org.glassfish.grizzly.servlet.HttpServletRequestImpl.initialize(HttpServletRequestImpl.java:208)
at org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:212)
at org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:189)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:196)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:744)
Dec 26, 2013 5:53:28 PM org.glassfish.grizzly.servlet.ServletHandler doServletService
SEVERE: service exception:
java.lang.NoSuchMethodError: org.glassfish.grizzly.http.server.Request.createInputStream()Lorg/glassfish/grizzly/http/io/NIOInputStream;
at org.glassfish.grizzly.servlet.ServletInputStreamImpl.initialize(ServletInputStreamImpl.java:89)
at org.glassfish.grizzly.servlet.HttpServletRequestImpl.initialize(HttpServletRequestImpl.java:208)
at org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:212)
at org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:189)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
at org.glassfish.grizzly.http.server.HttpHandlerChain.service(HttpHandlerChain.java:196)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:78)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:815)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:567)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:547)
at java.lang.Thread.run(Thread.java:744)
Related other question:
Can someone correct If I am using correct/latest maven dependencies
The original pom seems to be broken.
You can fix it by changing some dependencies as follows:
Demote grizzly-http-servlet from 2.3.4 to 2.2.16
This way it's compatible with the other grizzly (transitive) dependencies:
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http-servlet</artifactId>
<version>2.2.16</version>
</dependency>
Also, demote the Servlet API spec dependency from 3.1.0 to 3.0.1
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
Related
here the log file I am unable to fix the problems.
I have restarted the webserver,
cleaned the project and tried rebuilding but still no luck to understand what exactly is wrong.
I tried searching on SOF to fix the problem by removing the conflicting jar files but still no success.
Anyone out there to understand the log file which is below.
Dec 9, 2016 12:16:05 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\MyEclipse9\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;C:\MyEclipse9\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201105051700\tomcat\bin
Dec 9, 2016 12:16:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 9, 2016 12:16:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 313 ms
Dec 9, 2016 12:16:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 9, 2016 12:16:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
Dec 9, 2016 12:16:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\i\Desktop\Workspaces\MyEclipse 9\.metadata\.me_tcat\webapps\na20\WEB-INF\lib\javax.servlet-3.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 9, 2016 12:16:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\i\Desktop\Workspaces\MyEclipse 9\.metadata\.me_tcat\webapps\na20\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 9, 2016 12:16:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\i\Desktop\Workspaces\MyEclipse 9\.metadata\.me_tcat\webapps\na20\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 9, 2016 12:16:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\i\Desktop\Workspaces\MyEclipse 9\.metadata\.me_tcat\webapps\na20\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 9, 2016 12:16:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\i\Desktop\Workspaces\MyEclipse 9\.metadata\.me_tcat\webapps\na20\WEB-INF\lib\servletapi-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 9, 2016 12:16:11 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context '/na20'
Dec 9, 2016 12:16:22 PM org.icefaces.impl.push.servlet.ICEpushResourceHandler <init>
INFO: Ajax Push Resource Handling not available: java.lang.NoClassDefFoundError: org/icepush/servlet/MainServlet
Dec 9, 2016 12:16:22 PM org.icefaces.util.EnvConfig init
INFO: ICEfaces Configuration:
org.icefaces.render.auto: true [default]
org.icefaces.autoid: true [default]
org.icefaces.aria.enabled: true [default]
org.icefaces.blockUIOnSubmit: false [default]
org.icefaces.compressDOM: false [default]
org.icefaces.compressResources: true [default]
org.icefaces.connectionLostRedirectURI: null [default]
org.icefaces.deltaSubmit: false [default]
org.icefaces.lazyPush: true [default]
org.icefaces.sessionExpiredRedirectURI: null [default]
org.icefaces.standardFormSerialization: false [default]
org.icefaces.strictSessionTimeout: false [default]
org.icefaces.windowScopeExpiration = 1000 [default]
org.icefaces.mandatoryResourceConfiguration: null [default]
org.icefaces.uniqueResourceURLs: true [default]
org.icefaces.lazyWindowScope: true [default]
org.icefaces.disableDefaultErrorPopups: false [default]
Dec 9, 2016 12:16:22 PM org.icefaces.impl.push.servlet.ICEpushResourceHandler <init>
INFO: Ajax Push Resource Handling not available: java.lang.NoClassDefFoundError: org/icepush/servlet/MainServlet
Dec 9, 2016 12:16:22 PM org.icefaces.impl.renderkit.DOMRenderKit <clinit>
INFO:
ICEsoft Technologies Inc.
ICEfaces 2.0.2
Build number: 8
Revision: 24561
Dec 9, 2016 12:16:23 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.4
Dec 9, 2016 12:16:23 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
java.lang.NoSuchMethodError: org.icefaces.util.EnvUtils.isCoallesceResources(Ljavax/faces/context/FacesContext;)Z
at org.icefaces.impl.application.CoalescingResourceHandler$RegisterListener.processEvent(CoalescingResourceHandler.java:195)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2144)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:302)
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:600)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
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:566)
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)
Dec 9, 2016 12:16:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: java.lang.NoSuchMethodError: org.icefaces.util.EnvUtils.isCoallesceResources(Ljavax/faces/context/FacesContext;)Z
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
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:566)
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)
Caused by: java.lang.NoSuchMethodError: org.icefaces.util.EnvUtils.isCoallesceResources(Ljavax/faces/context/FacesContext;)Z
at org.icefaces.impl.application.CoalescingResourceHandler$RegisterListener.processEvent(CoalescingResourceHandler.java:195)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2144)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:302)
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:600)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
... 24 more
Dec 9, 2016 12:16:23 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.
Dec 9, 2016 12:16:24 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 9, 2016 12:16:24 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/na20] startup failed due to previous errors
Dec 9, 2016 12:16:24 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Dec 9, 2016 12:16:24 PM org.icefaces.impl.push.servlet.ICEpushResourceHandler notifyContextShutdown
INFO: MainServlet not found in application scope: java.lang.NullPointerException
Dec 9, 2016 12:16:24 PM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
Dec 9, 2016 12:16:25 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 9, 2016 12:16:25 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 9, 2016 12:16:25 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/20 config=null
Dec 9, 2016 12:16:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 19743 ms
Looks like it might be a class loading issue. Is the icefaces jar included at multiple levels in the Tomcat class loading hierarchy? Looking at the stack trace, the processEvent method in the org.icefaces.impl.application.CoalescingResourceHandler.RegisterListener class is calling method isCoallesceResources in the org.icefaces.util.EnvUtils class. Now, those two classes should be in the same icefaces jar file, and so should be at compatible versions. However, the called method is not in the Envutils class that is currently loaded (note that the method was added in icefaces 3.3, but also the CoelescingResourceHandler class was added then). So it would seem that the EventUtils class was loaded from an icefaces jar file earlier than version 3.3, whilst the CoalescingResourceHandler class was loaded from an icefaces jar file of version 3.3 or above.
Ensure that all icefaces.jar files in the Tomcat class loading hierarchy are of the same version or, better still, ensure that the jar file doesn't appear in more than one level of the hierarchy.
Technical Environment:-
Ubuntu 16.04 LTS
Tomcat 7
Java 7
Eclipse Luna
I have imported a webservice into my eclipse luna workspace and tried to run that service on tomcat7 server. But I'm getting the following error.
Jul 24, 2016 5:39:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:service' did not find a matching property.
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.68 (Ubuntu)
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 27 2016 18:13:17 UTC
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.4.0-28-generic
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-7-oracle/jre
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_80-b15
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /usr/share/tomcat7
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/usr/share/tomcat7
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/home/shravan/Projects/Webservices/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed
Jul 24, 2016 5:39:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Jul 24, 2016 5:39:31 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 24, 2016 5:39:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 781 ms
Jul 24, 2016 5:39:31 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 24, 2016 5:39:31 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68 (Ubuntu)
Jul 24, 2016 5:39:31 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.
Jul 24, 2016 5:39:33 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.
Jul 24, 2016 5:39:33 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 24, 2016 5:39:33 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 24, 2016 5:39:33 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Jul 24, 2016 5:39:33 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
Jul 24, 2016 5:39:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Jul 24, 2016 5:39:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dataSource.xml]
Jul 24, 2016 5:39:34 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368)
at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367)
at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:200)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:165)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
at org.apache.catalina.core.ApplicationContext.getInitParameterNames(ApplicationContext.java:368)
at org.apache.catalina.core.ApplicationContextFacade.getInitParameterNames(ApplicationContextFacade.java:367)
at org.springframework.web.context.support.WebApplicationContextUtils.registerEnvironmentBeans(WebApplicationContextUtils.java:200)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.postProcessBeanFactory(AbstractRefreshableWebApplicationContext.java:165)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Jul 24, 2016 5:39:34 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
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/service] startup failed due to previous errors
Jul 24, 2016 5:39:34 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
WARNING: Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:346)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:880)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Jul 24, 2016 5:39:34 PM org.springframework.context.support.AbstractApplicationContext doClose
WARNING: Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Sun Jul 24 17:39:33 IST 2016]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:359)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:841)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:551)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:115)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5115)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5779)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:159)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Jul 24, 2016 5:39:34 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 24, 2016 5:39:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3547 ms
Please point me out to the possible solution. Thank you so much.
I had the same problem recently.
It seems that Tomcat 7 classes were compiled using Java 8 libraries in Ubuntu 16.04, so you cannot run it using Java 7.
This is from catalina.jar (7.0.68) from repository:
# javap -verbose org/apache/catalina/core/ApplicationContext.class
Classfile /usr/share/tomcat7/lib/org/apache/catalina/core/ApplicationContext.class
Last modified 27/06/2016; size 33798 bytes
MD5 checksum b176f6c6f5854428fbfa67b298ed308a
Compiled from "ApplicationContext.java"
public class org.apache.catalina.core.ApplicationContext implements javax.servlet.ServletContext
SourceFile: "ApplicationContext.java"
InnerClasses:
public static #479= #478 of #943; //Dynamic=class javax/servlet/FilterRegistration$Dynamic of class javax/servlet/FilterRegistration
public static #479= #511 of #945; //Dynamic=class javax/servlet/ServletRegistration$Dynamic of class javax/servlet/ServletRegistration
public static #1005= #1004 of #2; //KeySetView=class java/util/concurrent/ConcurrentHashMap$KeySetView of class java/util/concurrent/ConcurrentHashMap
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_SUPER
And this is from catalina.jar (7.0.68) downloaded from Apache:
# javap -verbose org/apache/catalina/core/ApplicationContext.class
Classfile /root/apache-tomcat-7.0.68/lib/org/apache/catalina/core/ApplicationContext.class
Last modified 08/02/2016; size 33585 bytes
MD5 checksum eda7f125c1ef506be98d360f6611a717
Compiled from "ApplicationContext.java"
public class org.apache.catalina.core.ApplicationContext implements javax.servlet.ServletContext
SourceFile: "ApplicationContext.java"
InnerClasses:
public static #481= #480 of #946; //Dynamic=class javax/servlet/FilterRegistration$Dynamic of class javax/servlet/FilterRegistration
public static #481= #513 of #948; //Dynamic=class javax/servlet/ServletRegistration$Dynamic of class javax/servlet/ServletRegistration
minor version: 0
major version: 50
flags: ACC_PUBLIC, ACC_SUPER
Both are compiled to class format 50 (Java 6), but the repository class has a link to a Java 8 exclusive method:
public static #1005= #1004 of #2; //KeySetView=class java/util/concurrent/ConcurrentHashMap$KeySetView of class java/util/concurrent/ConcurrentHashMap
So if you want to run Tomcat 7 with Java 7 in Ubuntu 16.04 you have to download it directly from Apache and install it manually.
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
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
Me and my team are trying to setup a Spring project, and would like to implement REST services. But when I try to deploy it to tomcat 7, I get an error. Here is the output:
Jan 22, 2012 9:39:34 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: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Jan 22, 2012 9:39:34 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:niths' did not find a matching property.
Jan 22, 2012 9:39:34 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 22, 2012 9:39:34 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 22, 2012 9:39:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 497 ms
Jan 22, 2012 9:39:34 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 22, 2012 9:39:34 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
Jan 22, 2012 9:39:34 PM org.apache.catalina.startup.ContextConfig webConfig
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Jan 22, 2012 9:39:37 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jan 22, 2012 9:39:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 22, 2012 9:39:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 22, 2012 9:39:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3208 ms
I have tried Googling javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found without luck. I am guessing the project was not deployed at all.
The project is hosted on this GitHub repo.
Deployment descriptor
The REST controller
I have added a very simple method for testing my application: getBaz(), which I guess would be invoked at localhost:8080/niths/rest/baz.
I am having a hard time figuring out what is missing as this is my first Spring project, and would therefore be grateful if someone skilled in the arts of Spring would point out what's the problem!
From your pom.xml file, it seems that you excluded your classes and libs from the generated war :
<warSourceExcludes>WEB-INF/classes/**,WEB-INF/lib/**</warSourceExcludes>
Try again by removing this line.