java

SEVERE: Servlet [spring] in web application threw load() exception  #angularjs #reactjs

  • ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath Jul 23, 2016 10:01:18 PM org.apache.catalina.core.
  • finally it is worked thanks @SivaKumar – sada Jul 24 at 8:46
  • DispatcherServlet initServletBean INFO: FrameworkServlet ‘spring’: initialization completed in 1283 ms Jul 23, 2016 10:01:19 PM org.apache.coyote.
  • FrameworkServlet ‘spring’: initialization started Jul 23, 2016 10:01:18 PM org.springframework.web.context.support.
  • TldScanner scanJars INFO: At least one JAR was scanned for TLDs contained no TLDs.


@ng_real_ninja: SEVERE: Servlet [spring] in web application threw load() exception #angularjs #reactjs

SEVERE: Servlet [spring] in web application [/loginDB] threw load() exception java.lang.ClassNotFoundException: org.springframework.beans.factory.Aware at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2503) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:831) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2503) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:831) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2503) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:831) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1102) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4996) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 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 23, 2016 10:01:18 PM org.apache.jasper.servlet.TldScanner scanJars INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Jul 23, 2016 10:01:18 PM org.apache.catalina.core.ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath Jul 23, 2016 10:01:18 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet ‘spring’ Jul 23, 2016 10:01:18 PM org.springframework.web.servlet.DispatcherServlet initServletBean INFO: FrameworkServlet ‘spring’: initialization started Jul 23, 2016 10:01:18 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh INFO: Refreshing WebApplicationContext for namespace ‘spring-servlet’: startup date [Sat Jul 23 22:01:18 IST 2016]; root of context hierarchy Jul 23, 2016 10:01:18 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml] Jul 23, 2016 10:01:19 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler INFO: Mapped URL path [/test] onto handler ‘welcomeController’ Jul 23, 2016 10:01:19 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler INFO: Mapped URL path [/test.*] onto handler ‘welcomeController’ Jul 23, 2016 10:01:19 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler INFO: Mapped URL path [/test/] onto handler ‘welcomeController’ Jul 23, 2016 10:01:19 PM org.springframework.web.servlet.DispatcherServlet initServletBean INFO: FrameworkServlet ‘spring’: initialization completed in 1283 ms Jul 23, 2016 10:01:19 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [“http-nio-2016”] Jul 23, 2016 10:01:19 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler [“ajp-nio-8009”] Jul 23, 2016 10:01:19 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 6529 ms Jul 23, 2016 10:01:20 PM org.apache.catalina.core.ApplicationDispatcher invoke WARNING: Servlet spring is currently unavailable

spring org.springframework.web.servlet.DispatcherServlet 1 spring *.form

package pack1.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import pack1.dao.LoginDao; @Controller public class LoginController { @Autowired private LoginDao dao; @RequestMapping(value=”/logins”,method=RequestMethod.GET) public ModelAndView getLoginPage() { return new ModelAndView(“login”); } @RequestMapping(value=”/check”,method=RequestMethod.POST) public ModelAndView checkLogin(@RequestParam(“t1”) String s1,@RequestParam(“t2”)String s2) { boolean b=dao.check(s1, s2); if(b) { return new ModelAndView(“success”); } else { return new ModelAndView(“failure”); } } }

package pack1.dao; public interface LoginDao { boolean check(String s1,String s2); }

package pack1.dao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository public class LoginDaoImpl implements LoginDao { @Autowired private JdbcTemplate jt; public boolean check(String s1, String s2) { int i=(Integer)jt.queryForObject(“select count(*) from login where username=? and password=?”,Integer.class,s1,s2); if(i==1) return true; else return false; } }

4.0.0 com.sada loginDB war 0.0.1-SNAPSHOT loginDB http://maven.apache.org javax.servlet servlet-api 2.5 provided javax.servlet.jsp jsp-api 2.1 provided org.springframework spring-jdbc 3.0.6.RELEASE org.springframework spring-webmvc 4.3.1.RELEASE com.oracle ojdbc6 11.2.0 org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.5 1.5

java