syed mahboob

Greenhorn
+ Follow
since Dec 06, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by syed mahboob

LoginCommand.java





LoginController.java




LoginValidator.java





applicationContext.xml



controller-servlet.xml




web.xml


index.jsp




login.jsp




success.jsp





message.properties

username=Username
password=Password





This is error i am getting after clicking on login



HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet controller threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:238)
org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.26




















Apr 11, 2013 3:07:39 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:/Program Files (x86)/Java/jre6/lib/i386;H:\ORACLE\app\oracle\product\10.2.0\server\bin;C:\Program Files (x86)\Tomcat5.5\server\lib;C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.6.0_17/bin;C:\Program Files (x86)\Tomcat5.5\server\lib;;C:\Users\SYED\Desktop\eclipse;
Apr 11, 2013 3:07:39 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-7070
Apr 11, 2013 3:07:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 458 ms
Apr 11, 2013 3:07:39 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 11, 2013 3:07:39 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
Apr 11, 2013 3:07:39 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 11, 2013 3:07:39 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 11, 2013 3:07:39 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 11, 2013 3:07:39 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@141b571: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Thu Apr 11 15:07:39 IST 2013]; root of context hierarchy
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@141b571]: org.springframework.beans.factory.support.DefaultListableBeanFactory@e70e30
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e70e30: defining beans [urlMapping,hello]; root of factory hierarchy
Apr 11, 2013 3:07:40 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization completed in 315 ms
Apr 11, 2013 3:07:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Apr 11, 2013 3:07:40 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@b1aebf: display name [Root WebApplicationContext]; startup date [Thu Apr 11 15:07:40 IST 2013]; root of context hierarchy
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@b1aebf]: org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b: defining beans [messageSource]; root of factory hierarchy
Apr 11, 2013 3:07:40 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 298 ms
Apr 11, 2013 3:07:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 11, 2013 3:07:40 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@ab444: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Thu Apr 11 15:07:40 IST 2013]; parent: org.springframework.web.context.support.XmlWebApplicationContext@b1aebf
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@ab444]: org.springframework.beans.factory.support.DefaultListableBeanFactory@e51b2c
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e51b2c: defining beans [urlMapping,loginSettings,loginValidator]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b
Apr 11, 2013 3:07:40 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e51b2c: defining beans [urlMapping,loginSettings,loginValidator]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b
Apr 11, 2013 3:07:40 PM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 33 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 52 more
Caused by: java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:238)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 56 more
Caused by: java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
... 62 more
Apr 11, 2013 3:07:40 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 33 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 52 more
Caused by: java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:238)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 56 more
Caused by: java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
... 62 more
Apr 11, 2013 3:07:40 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /SpringMvc3 threw load() exception
java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 11, 2013 3:07:40 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 11, 2013 3:07:40 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 11, 2013 3:07:40 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@19a029e: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Thu Apr 11 15:07:40 IST 2013]; root of context hierarchy
Apr 11, 2013 3:07:41 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 11, 2013 3:07:41 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@19a029e]: org.springframework.beans.factory.support.DefaultListableBeanFactory@14d1d41
Apr 11, 2013 3:07:41 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@14d1d41: defining beans [urlMapping,loginRequest]; root of factory hierarchy
Apr 11, 2013 3:07:41 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization completed in 243 ms
Apr 11, 2013 3:07:41 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 11, 2013 3:07:41 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 11, 2013 3:07:41 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@50a649: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Thu Apr 11 15:07:41 IST 2013]; root of context hierarchy
Apr 11, 2013 3:07:41 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 11, 2013 3:07:41 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@50a649]: org.springframework.beans.factory.support.DefaultListableBeanFactory@14dd758
Apr 11, 2013 3:07:41 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@14dd758: defining beans [urlMapping,some]; root of factory hierarchy
Apr 11, 2013 3:07:41 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization completed in 299 ms
Apr 11, 2013 3:07:41 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-7070
Apr 11, 2013 3:07:41 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 11, 2013 3:07:41 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/21 config=null
Apr 11, 2013 3:07:41 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 11, 2013 3:07:41 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2269 ms
Apr 11, 2013 3:07:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 11, 2013 3:07:48 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 11, 2013 3:07:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@430b6: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Thu Apr 11 15:07:48 IST 2013]; parent: org.springframework.web.context.support.XmlWebApplicationContext@b1aebf
Apr 11, 2013 3:07:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 11, 2013 3:07:48 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@430b6]: org.springframework.beans.factory.support.DefaultListableBeanFactory@94af2f
Apr 11, 2013 3:07:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@94af2f: defining beans [urlMapping,loginSettings,loginValidator]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b
Apr 11, 2013 3:07:48 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@94af2f: defining beans [urlMapping,loginSettings,loginValidator]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@c8376b
Apr 11, 2013 3:07:48 PM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 30 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 49 more
Caused by: java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:238)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 53 more
Caused by: java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
... 59 more
Apr 11, 2013 3:07:48 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginSettings' defined in ServletContext resource [/WEB-INF/controller-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
... 30 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'commandClass'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 49 more
Caused by: java.lang.IllegalArgumentException: Error loading class [com.lara..LoginCommand]: problem with class file or dependent class.
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:238)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 53 more
Caused by: java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
... 59 more
Apr 11, 2013 3:07:48 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet controller
java.lang.NoClassDefFoundError: com/lara//LoginCommand (wrong name: com/lara/LoginCommand)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:211)
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:230)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:297)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)



11 years ago

Ayan mallick wrote:where are you putting controller-servlet.xml. It should be under WEB-INF.

Thanks
Ayan




I have put controller-servlet.xml under WEB-INF still same problem occuring..

11 years ago
HelloController.java



hello.jsp



message.jsp






web.xml





controller-servlet.xml








I am getting the following error

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet controller threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/controller-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.26













Apr 9, 2013 9:45:33 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:/Program Files (x86)/Java/jre6/lib/i386;H:\ORACLE\app\oracle\product\10.2.0\server\bin;C:\Program Files (x86)\Tomcat5.5\server\lib;C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.6.0_17/bin;C:\Program Files (x86)\Tomcat5.5\server\lib;;C:\Users\SYED\Desktop\eclipse;
Apr 9, 2013 9:45:34 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-7070
Apr 9, 2013 9:45:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 441 ms
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.26
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 9, 2013 9:45:34 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 9, 2013 9:45:34 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1d225a7: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Tue Apr 09 21:45:34 IST 2013]; root of context hierarchy
Apr 9, 2013 9:45:34 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 9, 2013 9:45:34 PM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/controller-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
... 31 more
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/controller-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
... 31 more
Apr 9, 2013 9:45:34 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /SpringMvc threw load() exception
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 9, 2013 9:45:34 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-7070
Apr 9, 2013 9:45:34 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 9, 2013 9:45:34 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18 config=null
Apr 9, 2013 9:45:34 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 9, 2013 9:45:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 706 ms
Apr 9, 2013 9:45:39 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'controller'
Apr 9, 2013 9:45:39 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'controller': initialization started
Apr 9, 2013 9:45:39 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1878144: display name [WebApplicationContext for namespace 'controller-servlet']; startup date [Tue Apr 09 21:45:39 IST 2013]; root of context hierarchy
Apr 9, 2013 9:45:39 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/controller-servlet.xml]
Apr 9, 2013 9:45:39 PM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/controller-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
... 28 more
Apr 9, 2013 9:45:39 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/controller-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
... 28 more
Apr 9, 2013 9:45:39 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet controller
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/controller-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
11 years ago




this is my login.jsp page below






java.sql.SQLException: Invalid column name
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3296)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1914)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
at com.lara.login.LoginDAO.authenticateUser(LoginDAO.java:34)
at com.lara.login.LoginAction.process(LoginAction.java:23)
at com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:112)
at com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Sir i am trying to attach file but it is neither accepting .txt file nor .java file.How can I attach?
11 years ago
i dont now thats why i am asking? what should i have to change in line 29 please tell me?
11 years ago




i am getting this errror..



HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

java.lang.NullPointerException
com.lara.login.LoginDAO.authenticateUser(LoginDAO.java:29)
com.lara.login.LoginAction.process(LoginAction.java:21)
com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:108)
com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:86)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28
11 years ago




now i am getting this exception



HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

java.lang.ClassCastException: com.lara.client.LoginBean
com.lara.servlets.controller.ControllerServlet.getActionObject(ControllerServlet.java:223)
com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:104)
com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:84)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.











Dec 9, 2012 8:56:47 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/46 config=null
Dec 9, 2012 8:56:47 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Dec 9, 2012 8:56:47 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2883 ms
/login.do
login
beanClass:com.lara.client.LoginBean,path:login,actionClass:com.lara.client.LoginBean
com.lara.client.LoginBean
com.lara.client.LoginBean@2bd3a
Dec 9, 2012 8:56:49 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet ControllerServlet threw exception
java.lang.ClassCastException: com.lara.client.LoginBean
at com.lara.servlets.controller.ControllerServlet.getActionObject(ControllerServlet.java:223)
at com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:104)
at com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
11 years ago
package com.lara.servlets.controller;

import java.io.IOException;

import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lara.db.pool.ConnectionPool;
import com.lara.model.Action;
import com.lara.model.Bean;
import com.lara.model.RequestInfo;
import com.lara.xml.ModuleConfig;

/**
* Servlet implementation class ControllerServlet
*/
public class ControllerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private ConnectionPool cp=null;
private ModuleConfig moduleConfig=null;

public ControllerServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init() throws ServletException {

String driverClass=getInitParameter("driverClass");
String url=getInitParameter("url");
String username=getInitParameter("username");
String password=getInitParameter("password");
String poolSize=getInitParameter("poolSize");
int intPoolSize=Integer.parseInt(poolSize);
cp=new ConnectionPool(driverClass,url,username,
password,intPoolSize);
cp.init();
// TODO Auto-generated method stub

String fileName=getInitParameter("config-file");
InputStream is = getClass().getResourceAsStream((new StringBuilder("/../")).append(fileName).toString());

try{
moduleConfig=new ModuleConfig(is);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
// TODO Auto-generated method stub


/**
* @see Servlet#destroy()
*/
public void destroy() {
cp.release();
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);

// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);
// TODO Auto-generated method stub
}
private void doPerform(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException

{
String path=request.getServletPath();
path=path.substring(1,path.length()-3);
Connection con=cp.checkOut();
request.setAttribute("con",con);
RequestInfo reqInfo=moduleConfig.getRequestInfo(path);
String beanClass=reqInfo.getBeanClass();
Bean beanObj=getBeanObject(beanClass,request);
String actionClass=reqInfo.getActionClass();
Action actionObj=getActionObject(actionClass);
String result=actionObj.process(request, beanObj);
String resultPath=reqInfo.getForward(result);
RequestDispatcher rd=request.getRequestDispatcher(resultPath);
rd.forward(request, response);
request.removeAttribute("con");
cp.checkIn(con);

}
private Bean getBeanObject(String beanClass,HttpServletRequest request)
{
Object obj=null;
Class cls=null;
try
{
cls=Class.forName(beanClass);
obj=cls.newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
Field all[]=cls.getDeclaredFields();
String methodName=null;
Method methodObj=null;
String fieldName;
String fieldValue;
for(Field f1:all)
{
fieldName=f1.getName();
fieldValue=request.getParameter(fieldName);
if(fieldValue!=null)
{
methodName="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1);
try
{
methodObj=cls.getDeclaredMethod(methodName,f1.getType());
if(f1.getType().equals(String.class))
{
methodObj.invoke(obj,fieldValue);
}
if(f1.getType().equals(Byte.class))
{
methodObj.invoke(obj,new Byte(fieldValue));
}
if(f1.getType().equals(Short.class))
{
methodObj.invoke(obj,new Short(fieldValue));
}
if(f1.getType().equals(Integer.class))
{
methodObj.invoke(obj,new Integer(fieldValue));
}
if(f1.getType().equals(Float.class))
{
methodObj.invoke(obj,new Float(fieldValue));
}
if(f1.getType().equals(Long.class))
{
methodObj.invoke(obj,new Long(fieldValue));
}
if(f1.getType().equals(Double.class))
{
methodObj.invoke(obj,new Double(fieldValue));
}
if(f1.getType().equals(byte.class))
{
methodObj.invoke(obj,Byte.parseByte(fieldValue));
}
if(f1.getType().equals(short.class))
{
methodObj.invoke(obj,Short.parseShort(fieldValue));
}
if(f1.getType().equals(int.class))
{
methodObj.invoke(obj,Integer.parseInt(fieldValue));
}
if(f1.getType().equals(long.class))
{
methodObj.invoke(obj,Long.parseLong(fieldValue));
}
if(f1.getType().equals(float.class))
{
methodObj.invoke(obj,Float.parseFloat(fieldValue));
}
if(f1.getType().equals(double.class))
{
methodObj.invoke(obj,Double.parseDouble(fieldValue));
}
if(f1.getType().equals(String[].class))
{
String x[]=request.getParameterValues(fieldName);
methodObj.invoke(obj,new Object[]{x});
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
fieldValue=null;
}
return (Bean)obj;

}



private Action getActionObject(String actionClass)
{
Object obj=null;
try
{
obj=Class.forName(actionClass).newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
return (Action)obj;
}

}




HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

java.lang.NullPointerException
com.lara.servlets.controller.ControllerServlet.getBeanObject(ControllerServlet.java:124)
com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:100)
com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:87)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28


package com.lara.client;

import java.sql.Connection;

import javax.servlet.http.HttpServletRequest;

import com.lara.model.Action;
import com.lara.model.Bean;

public class LoginAction extends Action {

public String process(HttpServletRequest request,Bean bean)
{
Connection con=(Connection)request.getAttribute("con");
LoginBean loginBean=(LoginBean) bean;
boolean status=LoginDAO.authenticate(con,loginBean);
if(status)
return "success";
request.setAttribute("param.username","Wrong username or password");
return "failure";
}
}




package com.lara.client;

import com.lara.model.Bean;

public class LoginBean extends Bean {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}


}




package com.lara.client;

import java.sql.Connection;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.lara.db.util.DBUtil;



public class LoginDAO {
public static boolean authenticate(Connection con,LoginBean bean)
{
String username =bean.getUsername();
String password=bean.getPassword();
Statement stmt=null;
ResultSet rs=null;
String sqlQry="";

try{
stmt=con.createStatement();
sqlQry="select * from users where username='"+username+"' and password='"+password+"'";

rs=stmt.executeQuery(sqlQry);
return rs.next();
}
catch(SQLException ex)
{
ex.printStackTrace();
}
finally{
DBUtil.closeResultSet(rs);
DBUtil.closeStatement(stmt);
}
return false;
}

}



package com.lara.model;

import javax.servlet.http.HttpServletRequest;

public class Action {
public String process(HttpServletRequest request,Bean bean)
{
return null;
}
}



package com.lara.model;

public class Bean {

}




package com.lara.model;

import java.util.HashMap;
import java.util.Map;

public class RequestInfo {
private String path;
private String beanClass;
private String actionClass;
private Map<String,String> paths=new HashMap<String,String>();
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getBeanClass() {
return beanClass;
}
public void setBeanClass(String beanClass) {
this.beanClass = beanClass;
}
public String getActionClass() {
return actionClass;
}
public void setActionClass(String actionClass) {
this.actionClass = actionClass;
}
public void putForward(String key,String value)
{
paths.put(key,value);
}
public String getForward(String name)
{
return paths.get(name);
}


}




package com.lara.xml;

import java.io.InputStream;

import java.util.HashMap;


import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import com.lara.model.RequestInfo;

public class ModuleConfig extends DefaultHandler
{
private HashMap<String,RequestInfo> reqInfos=new HashMap<String,RequestInfo>();
private String content=null;
private RequestInfo reqInfo=null;
private String reqPath=null;
private String forwardName=null;
public ModuleConfig(InputStream is) throws Exception
{
SAXParserFactory sax=SAXParserFactory.newInstance();
SAXParser sp=sax.newSAXParser();
sp.parse(is,this);
}
public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException
{
if("request-info".equals(qName))
{
reqInfo=new RequestInfo();
}
if("forward".equals(qName))
{
forwardName=attributes.getValue("name");
}
}
public void characters(char[] ch,int start,int length) throws SAXException
{
content=new String(ch,start,length);
content=content.trim();
}
public void endElement(String uri,String localName,String qName) throws SAXException
{
if("request-info".equals(qName))
{
reqInfos.put(reqPath, reqInfo);
}
if("path".equals(qName))
{
reqInfo.setPath(content);
reqPath=content;
}
if("bean-class".equals(qName))
{
reqInfo.setBeanClass(content);

}

if("action-class".equals(qName))
{
reqInfo.setActionClass(content);

}
if("forward".equals(qName))
{
reqInfo.putForward(forwardName,content);

}
}
public RequestInfo getRequestInfo(String path)
{
return reqInfos.get(path);
}
}






<app-config>
<request-info>
<path>login</path>
<bean-class>
com.lara.client.LoginBean
</bean-class>
<action-class>
com.lara.client.LoginBean
</action-class>
<forward name="success">
success.jsp
</forward>
<forward name="failure">
login.jsp
</forward>
</request-info>
<request-info>
<path>reg</path>
<bean-class>
com.lara.client.RegistrationBean
</bean-class>
<action-class>
com.lara.client.RegistrationAction
</action-class>
<forward name="success">
regSuccess.jsp
</forward>
<forward name="failure">
reg.jsp
</forward>
</request-info>
</app-config>




<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>project</display-name>
<servlet>
<description>
</description>
<display-name>ControllerServlet</display-name>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>com.lara.servlets.controller.ControllerServlet</servlet-class>
<init-param>
<description>
</description>
<param-name>driverClass</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>url</param-name>
<param-value>jdbcracle:thin:@localhost:1521:XE</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>username</param-name>
<param-value>test</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>password</param-name>
<param-value>syed</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>poolSize</param-name>
<param-value>10</param-value>
</init-param>

<init-param>
<param-name>config-file</param-name>
<param-value>
config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>


${status}
<form action="login.do?" method="post">
Username: <input type="text" name="username" value="${param.username}" />
</br> Password: <input type="password" name="password" /> </br> <input
type="submit" value="submit" />

</form>

11 years ago


package com.lara.servlets.controller;

import java.io.IOException;

import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lara.db.pool.ConnectionPool;
import com.lara.model.Action;
import com.lara.model.Bean;
import com.lara.model.RequestInfo;
import com.lara.xml.ModuleConfig;

/**
* Servlet implementation class ControllerServlet
*/
public class ControllerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private ConnectionPool cp=null;
private ModuleConfig moduleConfig=null;

public ControllerServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init() throws ServletException {

String driverClass=getInitParameter("driverClass");
String url=getInitParameter("url");
String username=getInitParameter("username");
String password=getInitParameter("password");
String poolSize=getInitParameter("poolSize");
int intPoolSize=Integer.parseInt(poolSize);
cp=new ConnectionPool(driverClass,url,username,
password,intPoolSize);
cp.init();
// TODO Auto-generated method stub

String fileName=getInitParameter("config-file");
InputStream is = getClass().getResourceAsStream((new StringBuilder("/../")).append(fileName).toString());

try{
moduleConfig=new ModuleConfig(is);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
// TODO Auto-generated method stub


/**
* @see Servlet#destroy()
*/
public void destroy() {
cp.release();
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);

// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);
// TODO Auto-generated method stub
}
private void doPerform(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException

{
String path=request.getServletPath();
path=path.substring(1,path.length()-3);
Connection con=cp.checkOut();
request.setAttribute("con",con);
RequestInfo reqInfo=moduleConfig.getRequestInfo(path);
String beanClass=reqInfo.getBeanClass();
Bean beanObj=getBeanObject(beanClass,request);
String actionClass=reqInfo.getActionClass();
Action actionObj=getActionObject(actionClass);
String result=actionObj.process(request, beanObj);
String resultPath=reqInfo.getForward(result);
RequestDispatcher rd=request.getRequestDispatcher(resultPath);
rd.forward(request, response);
request.removeAttribute("con");
cp.checkIn(con);

}
private Bean getBeanObject(String beanClass,HttpServletRequest request)
{
Object obj=null;
Class cls=null;
try
{
cls=Class.forName(beanClass);
obj=cls.newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
Field all[]=cls.getDeclaredFields();
String methodName=null;
Method methodObj=null;
String fieldName;
String fieldValue;
for(Field f1:all)
{
fieldName=f1.getName();
fieldValue=request.getParameter(fieldName);
if(fieldValue!=null)
{
methodName="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1);
try
{
methodObj=cls.getDeclaredMethod(methodName,f1.getType());
if(f1.getType().equals(String.class))
{
methodObj.invoke(obj,fieldValue);
}
if(f1.getType().equals(Byte.class))
{
methodObj.invoke(obj,new Byte(fieldValue));
}
if(f1.getType().equals(Short.class))
{
methodObj.invoke(obj,new Short(fieldValue));
}
if(f1.getType().equals(Integer.class))
{
methodObj.invoke(obj,new Integer(fieldValue));
}
if(f1.getType().equals(Float.class))
{
methodObj.invoke(obj,new Float(fieldValue));
}
if(f1.getType().equals(Long.class))
{
methodObj.invoke(obj,new Long(fieldValue));
}
if(f1.getType().equals(Double.class))
{
methodObj.invoke(obj,new Double(fieldValue));
}
if(f1.getType().equals(byte.class))
{
methodObj.invoke(obj,Byte.parseByte(fieldValue));
}
if(f1.getType().equals(short.class))
{
methodObj.invoke(obj,Short.parseShort(fieldValue));
}
if(f1.getType().equals(int.class))
{
methodObj.invoke(obj,Integer.parseInt(fieldValue));
}
if(f1.getType().equals(long.class))
{
methodObj.invoke(obj,Long.parseLong(fieldValue));
}
if(f1.getType().equals(float.class))
{
methodObj.invoke(obj,Float.parseFloat(fieldValue));
}
if(f1.getType().equals(double.class))
{
methodObj.invoke(obj,Double.parseDouble(fieldValue));
}
if(f1.getType().equals(String[].class))
{
String x[]=request.getParameterValues(fieldName);
methodObj.invoke(obj,new Object[]{x});
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
fieldValue=null;
}
return (Bean)obj;

}



private Action getActionObject(String actionClass)
{
Object obj=null;
try
{
obj=Class.forName(actionClass).newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
return (Action)obj;
}

}




HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

java.lang.NullPointerException
com.lara.servlets.controller.ControllerServlet.getBeanObject(ControllerServlet.java:124)
com.lara.servlets.controller.ControllerServlet.doPerform(ControllerServlet.java:100)
com.lara.servlets.controller.ControllerServlet.doPost(ControllerServlet.java:87)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28


package com.lara.client;

import java.sql.Connection;

import javax.servlet.http.HttpServletRequest;

import com.lara.model.Action;
import com.lara.model.Bean;

public class LoginAction extends Action {

public String process(HttpServletRequest request,Bean bean)
{
Connection con=(Connection)request.getAttribute("con");
LoginBean loginBean=(LoginBean) bean;
boolean status=LoginDAO.authenticate(con,loginBean);
if(status)
return "success";
request.setAttribute("param.username","Wrong username or password");
return "failure";
}
}




package com.lara.client;

import com.lara.model.Bean;

public class LoginBean extends Bean {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}


}




package com.lara.client;

import java.sql.Connection;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.lara.db.util.DBUtil;



public class LoginDAO {
public static boolean authenticate(Connection con,LoginBean bean)
{
String username =bean.getUsername();
String password=bean.getPassword();
Statement stmt=null;
ResultSet rs=null;
String sqlQry="";

try{
stmt=con.createStatement();
sqlQry="select * from users where username='"+username+"' and password='"+password+"'";

rs=stmt.executeQuery(sqlQry);
return rs.next();
}
catch(SQLException ex)
{
ex.printStackTrace();
}
finally{
DBUtil.closeResultSet(rs);
DBUtil.closeStatement(stmt);
}
return false;
}

}



package com.lara.model;

import javax.servlet.http.HttpServletRequest;

public class Action {
public String process(HttpServletRequest request,Bean bean)
{
return null;
}
}



package com.lara.model;

public class Bean {

}




package com.lara.model;

import java.util.HashMap;
import java.util.Map;

public class RequestInfo {
private String path;
private String beanClass;
private String actionClass;
private Map<String,String> paths=new HashMap<String,String>();
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getBeanClass() {
return beanClass;
}
public void setBeanClass(String beanClass) {
this.beanClass = beanClass;
}
public String getActionClass() {
return actionClass;
}
public void setActionClass(String actionClass) {
this.actionClass = actionClass;
}
public void putForward(String key,String value)
{
paths.put(key,value);
}
public String getForward(String name)
{
return paths.get(name);
}


}




package com.lara.xml;

import java.io.InputStream;

import java.util.HashMap;


import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import com.lara.model.RequestInfo;

public class ModuleConfig extends DefaultHandler
{
private HashMap<String,RequestInfo> reqInfos=new HashMap<String,RequestInfo>();
private String content=null;
private RequestInfo reqInfo=null;
private String reqPath=null;
private String forwardName=null;
public ModuleConfig(InputStream is) throws Exception
{
SAXParserFactory sax=SAXParserFactory.newInstance();
SAXParser sp=sax.newSAXParser();
sp.parse(is,this);
}
public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException
{
if("request-info".equals(qName))
{
reqInfo=new RequestInfo();
}
if("forward".equals(qName))
{
forwardName=attributes.getValue("name");
}
}
public void characters(char[] ch,int start,int length) throws SAXException
{
content=new String(ch,start,length);
content=content.trim();
}
public void endElement(String uri,String localName,String qName) throws SAXException
{
if("request-info".equals(qName))
{
reqInfos.put(reqPath, reqInfo);
}
if("path".equals(qName))
{
reqInfo.setPath(content);
reqPath=content;
}
if("bean-class".equals(qName))
{
reqInfo.setBeanClass(content);

}

if("action-class".equals(qName))
{
reqInfo.setActionClass(content);

}
if("forward".equals(qName))
{
reqInfo.putForward(forwardName,content);

}
}
public RequestInfo getRequestInfo(String path)
{
return reqInfos.get(path);
}
}






<app-config>
<request-info>
<path>login</path>
<bean-class>
com.lara.client.LoginBean
</bean-class>
<action-class>
com.lara.client.LoginBean
</action-class>
<forward name="success">
success.jsp
</forward>
<forward name="failure">
login.jsp
</forward>
</request-info>
<request-info>
<path>reg</path>
<bean-class>
com.lara.client.RegistrationBean
</bean-class>
<action-class>
com.lara.client.RegistrationAction
</action-class>
<forward name="success">
regSuccess.jsp
</forward>
<forward name="failure">
reg.jsp
</forward>
</request-info>
</app-config>




<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>project</display-name>
<servlet>
<description>
</description>
<display-name>ControllerServlet</display-name>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>com.lara.servlets.controller.ControllerServlet</servlet-class>
<init-param>
<description>
</description>
<param-name>driverClass</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>url</param-name>
<param-value>jdbc:oracle:thin:@localhost:1521:XE</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>username</param-name>
<param-value>test</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>password</param-name>
<param-value>syed</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>poolSize</param-name>
<param-value>10</param-value>
</init-param>

<init-param>
<param-name>config-file</param-name>
<param-value>
config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>


${status}
<form action="login.do?" method="post">
Username: <input type="text" name="username" value="${param.username}" />
</br> Password: <input type="password" name="password" /> </br> <input
type="submit" value="submit" />

</form>










11 years ago




package com.lara.servlets.controller;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lara.db.pool.ConnectionPool;
import com.lara.model.Action;
import com.lara.model.Bean;
import com.lara.model.RequestInfo;
import com.lara.xml.ModuleConfig;

/**
* Servlet implementation class ControllerServlet
*/
public class ControllerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private ConnectionPool cp=null;
private ModuleConfig moduleConfig=null;


public ControllerServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init() throws ServletException {

String driverClass=getInitParameter("driverClass");
String url=getInitParameter("url");
String username=getInitParameter("username");
String password=getInitParameter("password");
String poolSize=getInitParameter("poolSize");
int intPoolSize=Integer.parseInt(poolSize);
cp=new ConnectionPool(driverClass,url,username,
password,intPoolSize);
cp.init();
// TODO Auto-generated method stub

String fileName=getInitParameter("config-file");
InputStream is = getClass().getResourceAsStream((new StringBuilder("/../")).append(fileName).toString());

try{
moduleConfig=new ModuleConfig(is);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
// TODO Auto-generated method stub


/**
* @see Servlet#destroy()
*/
public void destroy() {
cp.release();
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);

// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);
// TODO Auto-generated method stub
}
private void doPerform(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException

{
String path=request.getServletPath();
path=path.substring(1,path.length()-3);
Connection con=cp.checkOut();
request.setAttribute("con",con);
RequestInfo reqInfo=moduleConfig.getRequestInfo(path);
String beanClass=reqInfo.getBeanClass();
Bean beanObj=getBeanObject(beanClass,request);
String actionClass=reqInfo.getActionClass();
Action actionObj=getActionObject(actionClass);
String result=actionObj.process(request, beanObj);
String resultPath=reqInfo.getForward(result);
RequestDispatcher rd=request.getRequestDispatcher(resultPath);
rd.forward(request, response);
request.removeAttribute("con");
cp.checkIn(con);

}
private Bean getBeanObject(String beanClass,HttpServletRequest request)
{
Object obj=null;
Class cls=null;
try
{
cls=Class.forName(beanClass);
obj=cls.newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
Field all[]=cls.getDeclaredFields();
String methodName=null;
Method methodObj=null;
String fieldName;
String fieldValue;
for(Field f1:all)
{
fieldName=f1.getName();
fieldValue=request.getParameter(fieldName);
if(fieldValue!=null)
{
methodName="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1);
try
{
methodObj=cls.getDeclaredMethod(methodName,f1.getType());
if(f1.getType().equals(String.class))
{
methodObj.invoke(obj,fieldValue);
}
if(f1.getType().equals(Byte.class))
{
methodObj.invoke(obj,new Byte(fieldValue));
}
if(f1.getType().equals(Short.class))
{
methodObj.invoke(obj,new Short(fieldValue));
}
if(f1.getType().equals(Integer.class))
{
methodObj.invoke(obj,new Integer(fieldValue));
}
if(f1.getType().equals(Float.class))
{
methodObj.invoke(obj,new Float(fieldValue));
}
if(f1.getType().equals(Long.class))
{
methodObj.invoke(obj,new Long(fieldValue));
}
if(f1.getType().equals(Double.class))
{
methodObj.invoke(obj,new Double(fieldValue));
}
if(f1.getType().equals(byte.class))
{
methodObj.invoke(obj,Byte.parseByte(fieldValue));
}
if(f1.getType().equals(short.class))
{
methodObj.invoke(obj,Short.parseShort(fieldValue));
}
if(f1.getType().equals(int.class))
{
methodObj.invoke(obj,Integer.parseInt(fieldValue));
}
if(f1.getType().equals(long.class))
{
methodObj.invoke(obj,Long.parseLong(fieldValue));
}
if(f1.getType().equals(float.class))
{
methodObj.invoke(obj,Float.parseFloat(fieldValue));
}
if(f1.getType().equals(double.class))
{
methodObj.invoke(obj,Double.parseDouble(fieldValue));
}
if(f1.getType().equals(String[].class))
{
String x[]=request.getParameterValues(fieldName);
methodObj.invoke(obj,new Object[]{x});
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
fieldValue=null;
}
return (Bean)obj;

}

private Action getActionObject(String actionClass)
{
Object obj=null;
try
{
obj=Class.forName(actionClass).newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
return (Action)obj;
}

}







[Post New]posted Today 12:07:26 PM
Quote Edit
view plaincopy to clipboardprint?

package com.lara.servlets.controller;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lara.db.pool.ConnectionPool;
import com.lara.model.Action;
import com.lara.model.Bean;
import com.lara.model.RequestInfo;
import com.lara.xml.ModuleConfig;

/**
* Servlet implementation class ControllerServlet
*/
public class ControllerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private ConnectionPool cp=null;
private ModuleConfig moduleConfig=null;


public ControllerServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init() throws ServletException {

String driverClass=getInitParameter("driverClass");
String url=getInitParameter("url");
String username=getInitParameter("username");
String password=getInitParameter("password");
String poolSize=getInitParameter("poolSize");
int intPoolSize=Integer.parseInt(poolSize);
cp=new ConnectionPool(driverClass,url,username,
password,intPoolSize);
cp.init();
// TODO Auto-generated method stub

String fileName=getInitParameter("config-file");
InputStream is = getClass().getResourceAsStream((new StringBuilder("/../")).append(fileName).toString());

try{
moduleConfig=new ModuleConfig(is);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
// TODO Auto-generated method stub


/**
* @see Servlet#destroy()
*/
public void destroy() {
cp.release();
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);

// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);
// TODO Auto-generated method stub
}
private void doPerform(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException

{
String path=request.getServletPath();
path=path.substring(1,path.length()-3);
Connection con=cp.checkOut();
request.setAttribute("con",con);
RequestInfo reqInfo=moduleConfig.getRequestInfo(path);
String beanClass=reqInfo.getBeanClass();
Bean beanObj=getBeanObject(beanClass,request);
String actionClass=reqInfo.getActionClass();
Action actionObj=getActionObject(actionClass);
String result=actionObj.process(request, beanObj);
String resultPath=reqInfo.getForward(result);
RequestDispatcher rd=request.getRequestDispatcher(resultPath);
rd.forward(request, response);
request.removeAttribute("con");
cp.checkIn(con);

}
private Bean getBeanObject(String beanClass,HttpServletRequest request)
{
Object obj=null;
Class cls=null;
try
{
cls=Class.forName(beanClass);
obj=cls.newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
Field all[]=cls.getDeclaredFields();
String methodName=null;
Method methodObj=null;
String fieldName;
String fieldValue;
for(Field f1:all)
{
fieldName=f1.getName();
fieldValue=request.getParameter(fieldName);
if(fieldValue!=null)
{
methodName="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1);
try
{
methodObj=cls.getDeclaredMethod(methodName,f1.getType());
if(f1.getType().equals(String.class))
{
methodObj.invoke(obj,fieldValue);
}
if(f1.getType().equals(Byte.class))
{
methodObj.invoke(obj,new Byte(fieldValue));
}
if(f1.getType().equals(Short.class))
{
methodObj.invoke(obj,new Short(fieldValue));
}
if(f1.getType().equals(Integer.class))
{
methodObj.invoke(obj,new Integer(fieldValue));
}
if(f1.getType().equals(Float.class))
{
methodObj.invoke(obj,new Float(fieldValue));
}
if(f1.getType().equals(Long.class))
{
methodObj.invoke(obj,new Long(fieldValue));
}
if(f1.getType().equals(Double.class))
{
methodObj.invoke(obj,new Double(fieldValue));
}
if(f1.getType().equals(byte.class))
{
methodObj.invoke(obj,Byte.parseByte(fieldValue));
}
if(f1.getType().equals(short.class))
{
methodObj.invoke(obj,Short.parseShort(fieldValue));
}
if(f1.getType().equals(int.class))
{
methodObj.invoke(obj,Integer.parseInt(fieldValue));
}
if(f1.getType().equals(long.class))
{
methodObj.invoke(obj,Long.parseLong(fieldValue));
}
if(f1.getType().equals(float.class))
{
methodObj.invoke(obj,Float.parseFloat(fieldValue));
}
if(f1.getType().equals(double.class))
{
methodObj.invoke(obj,Double.parseDouble(fieldValue));
}
if(f1.getType().equals(String[].class))
{
String x[]=request.getParameterValues(fieldName);
methodObj.invoke(obj,new Object[]{x});
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
fieldValue=null;
}
return (Bean)obj;

}

private Action getActionObject(String actionClass)
{
Object obj=null;
try
{
obj=Class.forName(actionClass).newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
return (Action)obj;
}

}







HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet ControllerServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
com.lara.servlets.controller.ControllerServlet.init(ControllerServlet.java:46)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28
11 years ago



config.xml
------------

<app-config>
<request-info>
<path>login</path>
<bean-class>
com.lara.client.LoginBean
</bean-class>
<action-class>
com.lara.client.LoginBean
</action-class>
<forward name="success">
success.jsp
</forward>
<forward name="failure">
login.jsp
</forward>
</request-info>
<request-info>
<path>reg</path>
<bean-class>
com.lara.client.RegistrationBean
</bean-class>
<action-class>
com.lara.client.RegistrationAction
</action-class>
<forward name="success">
regSuccess.jsp
</forward>
<forward name="failure">
reg.jsp
</forward>
</request-info>
</app-config>



web.xml
---------

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>project</display-name>
<servlet>
<description>
</description>
<display-name>ControllerServlet</display-name>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>com.lara.servlets.controller.ControllerServlet</servlet-class>
<init-param>
<description>
</description>
<param-name>driverClass</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>url</param-name>
<param-value>jdbcracle:thin:@localhost:1521:XE</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>username</param-name>
<param-value>test</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>password</param-name>
<param-value>syed</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>poolSize</param-name>
<param-value>10</param-value>
</init-param>

<init-param>
<param-name>config-file</param-name>
<param-value>
config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>




login.jsp
---------

${status}
<form action="login.do?" method="post">
Username: <input type="text" name="username" value="${param.username}" />
</br> Password: <input type="password" name="password" /> </br> <input
type="submit" value="submit" />

</form>


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet ControllerServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
com.lara.servlets.controller.ControllerServlet.init(ControllerServlet.java:46)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28
11 years ago


package com.lara.servlets.controller;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lara.db.pool.ConnectionPool;
import com.lara.model.Action;
import com.lara.model.Bean;
import com.lara.model.RequestInfo;
import com.lara.xml.ModuleConfig;

/**
* Servlet implementation class ControllerServlet
*/
public class ControllerServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private ConnectionPool cp=null;
private ModuleConfig moduleConfig=null;


public ControllerServlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init() throws ServletException {

String driverClass=getInitParameter("driverClass");
String url=getInitParameter("url");
String username=getInitParameter("username");
String password=getInitParameter("password");
String poolSize=getInitParameter("poolSize");
int intPoolSize=Integer.parseInt(poolSize);
cp=new ConnectionPool(driverClass,url,username,
password,intPoolSize);
cp.init();
// TODO Auto-generated method stub

String fileName=getInitParameter("config-file");
InputStream is = getClass().getResourceAsStream((new StringBuilder("/../")).append(fileName).toString());

try{
moduleConfig=new ModuleConfig(is);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
// TODO Auto-generated method stub


/**
* @see Servlet#destroy()
*/
public void destroy() {
cp.release();
// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);

// TODO Auto-generated method stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPerform(request,response);
// TODO Auto-generated method stub
}
private void doPerform(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException

{
String path=request.getServletPath();
path=path.substring(1,path.length()-3);
Connection con=cp.checkOut();
request.setAttribute("con",con);
RequestInfo reqInfo=moduleConfig.getRequestInfo(path);
String beanClass=reqInfo.getBeanClass();
Bean beanObj=getBeanObject(beanClass,request);
String actionClass=reqInfo.getActionClass();
Action actionObj=getActionObject(actionClass);
String result=actionObj.process(request, beanObj);
String resultPath=reqInfo.getForward(result);
RequestDispatcher rd=request.getRequestDispatcher(resultPath);
rd.forward(request, response);
request.removeAttribute("con");
cp.checkIn(con);

}
private Bean getBeanObject(String beanClass,HttpServletRequest request)
{
Object obj=null;
Class cls=null;
try
{
cls=Class.forName(beanClass);
obj=cls.newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
Field all[]=cls.getDeclaredFields();
String methodName=null;
Method methodObj=null;
String fieldName;
String fieldValue;
for(Field f1:all)
{
fieldName=f1.getName();
fieldValue=request.getParameter(fieldName);
if(fieldValue!=null)
{
methodName="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1);
try
{
methodObj=cls.getDeclaredMethod(methodName,f1.getType());
if(f1.getType().equals(String.class))
{
methodObj.invoke(obj,fieldValue);
}
if(f1.getType().equals(Byte.class))
{
methodObj.invoke(obj,new Byte(fieldValue));
}
if(f1.getType().equals(Short.class))
{
methodObj.invoke(obj,new Short(fieldValue));
}
if(f1.getType().equals(Integer.class))
{
methodObj.invoke(obj,new Integer(fieldValue));
}
if(f1.getType().equals(Float.class))
{
methodObj.invoke(obj,new Float(fieldValue));
}
if(f1.getType().equals(Long.class))
{
methodObj.invoke(obj,new Long(fieldValue));
}
if(f1.getType().equals(Double.class))
{
methodObj.invoke(obj,new Double(fieldValue));
}
if(f1.getType().equals(byte.class))
{
methodObj.invoke(obj,Byte.parseByte(fieldValue));
}
if(f1.getType().equals(short.class))
{
methodObj.invoke(obj,Short.parseShort(fieldValue));
}
if(f1.getType().equals(int.class))
{
methodObj.invoke(obj,Integer.parseInt(fieldValue));
}
if(f1.getType().equals(long.class))
{
methodObj.invoke(obj,Long.parseLong(fieldValue));
}
if(f1.getType().equals(float.class))
{
methodObj.invoke(obj,Float.parseFloat(fieldValue));
}
if(f1.getType().equals(double.class))
{
methodObj.invoke(obj,Double.parseDouble(fieldValue));
}
if(f1.getType().equals(String[].class))
{
String x[]=request.getParameterValues(fieldName);
methodObj.invoke(obj,new Object[]{x});
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
fieldValue=null;
}
return (Bean)obj;

}



private Action getActionObject(String actionClass)
{
Object obj=null;
try
{
obj=Class.forName(actionClass).newInstance();
}
catch(Exception ex)
{
ex.printStackTrace();
}
return (Action)obj;
}

}





config.xml
------------





<app-config>
<request-info>
<path>login</path>
<bean-class>
com.lara.client.LoginBean
</bean-class>
<action-class>
com.lara.client.LoginBean
</action-class>
<forward name="success">
success.jsp
</forward>
<forward name="failure">
login.jsp
</forward>
</request-info>
<request-info>
<path>reg</path>
<bean-class>
com.lara.client.RegistrationBean
</bean-class>
<action-class>
com.lara.client.RegistrationAction
</action-class>
<forward name="success">
regSuccess.jsp
</forward>
<forward name="failure">
reg.jsp
</forward>
</request-info>
</app-config>



web.xml
---------

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>project</display-name>
<servlet>
<description>
</description>
<display-name>ControllerServlet</display-name>
<servlet-name>ControllerServlet</servlet-name>
<servlet-class>com.lara.servlets.controller.ControllerServlet</servlet-class>
<init-param>
<description>
</description>
<param-name>driverClass</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>url</param-name>
<param-value>jdbc:oracle:thin:@localhost:1521:XE</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>username</param-name>
<param-value>test</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>password</param-name>
<param-value>syed</param-value>
</init-param>
<init-param>
<description>
</description>
<param-name>poolSize</param-name>
<param-value>10</param-value>
</init-param>

<init-param>
<param-name>config-file</param-name>
<param-value>
config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping>
<servlet-name>ControllerServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>




login.jsp
---------


${status}
<form action="login.do?" method="post">
Username: <input type="text" name="username" value="${param.username}" />
</br> Password: <input type="password" name="password" /> </br> <input
type="submit" value="submit" />

</form>






HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet.init() for servlet ControllerServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
com.lara.servlets.controller.ControllerServlet.init(ControllerServlet.java:46)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.28
11 years ago