0

Im getting this exception,but im not sure where exactly the exception occured,Please help me in this guys.I know there are lot of posts on this related topic but none i found gives solution to my question.

HTTP Status 500 - Servlet.init() for servlet search threw exception

type Exception report

message Servlet.init() for servlet search threw exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet search threw exception
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.CronJobController] for bean with name 'cronJobController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/CronJobController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/CronJobController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.CronJobController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.WordSearchController] for bean with name 'wordSearchController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/WordSearchController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/WordSearchController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.WordSearchController)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.CronJobService] for bean with name 'cronjobservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/CronJobService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.CronJobService)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.ProgramUpdateService] for bean with name 'programupdateservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/ProgramUpdateService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.ProgramUpdateService)
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.service.WordSearchService] for bean with name 'wordsearchservice' defined in ServletContext resource [/WEB-INF/search-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/service/WordSearchService : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.service.WordSearchService)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    javax.servlet.GenericServlet.init(GenericServlet.java:158)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
root cause

org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.lukup.smr.word.controller.ProgramUpdateController] for bean with name 'programUpdateController' defined in file [/usr/share/apache-tomcat-7.0.63/webapps/search/WEB-INF/classes/com/lukup/smr/word/controller/ProgramUpdateController.class]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
    org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1354)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
    org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1444)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:423)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:409)
    org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1141)
    org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:178)
    org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:163)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:133)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    javax.servlet.GenericServlet.init(GenericServlet.java:158)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
root cause

java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 (unable to load class com.lukup.smr.word.controller.ProgramUpdateController)
    org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2963)
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1212)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1692)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
    org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
    org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)
    org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1396)
    org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1343)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
    org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1444)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:423)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:409)
    org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1141)
    org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:178)
    org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:163)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:133)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    javax.servlet.GenericServlet.init(GenericServlet.java:158)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.63 logs.

Apache Tomcat/7.0.63
Cœur
  • 37,241
  • 25
  • 195
  • 267
Manoj venk
  • 823
  • 1
  • 8
  • 12
  • 3
    Possible duplicate of [Unsupported major.minor version 52.0](http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0) – Jens Aug 19 '16 at 06:52
  • @Jens Hello friend,Is it occuring because of version mismatch of spring or jdk? Due to version mismatch im getting this big hella error? Please do reply:) – Manoj venk Aug 19 '16 at 06:54
  • It Comes because `com/lukup/smr/word/controller/ProgramUpdateController` was compiles with Java 8 and your runtime Environment is a Version less then java8 – Jens Aug 19 '16 at 06:56
  • Yes, if you look at the logs, it clearly states so: `nested exception is java.lang.UnsupportedClassVersionError: com/lukup/smr/word/controller/ProgramUpdateController : Unsupported major.minor version 52.0 ` – dubes Aug 19 '16 at 06:58
  • Oh thank you so much guys.:) So does that mean i have lower version of java which is less than java 8? So to resolve this issue i do have to update my system to version 8 or greater? – Manoj venk Aug 19 '16 at 07:01
  • Thanks a lot guys!! I forgot to change the version of jdk in tomcat which caused me this issue.Since my system was using jdk newer version.Damn How did i miss that...Thanks a lot again guys. – Manoj venk Aug 19 '16 at 07:10

1 Answers1

0

Recommended Options

  1. Unsupported major.minor version 52.0 means you have JDK version compatibility issue with your Web/Application server.
  2. Change it to higher JDK preferably JDK 1.8 (recommended) and re-compile your code will resolve your issue.
  3. In this scenario it is highly recommended to use tomcat 8.X + JDK 1.8 to fix your problem.
Praveen Kumar K S
  • 3,024
  • 1
  • 24
  • 31