Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1100
  • Last Modified:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.tlrg.clear.web.GrepController' is defined

Hi,

Am getting the following exception when i start my server.  Am using Spring mvc 3.0.5 with hibernate.  I dont know what is wrong in the SpringApp-servlet.xml which looks like the following:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


      <!--  ================================================ -->
                        <!-- Hibernate related mappings  -->
      <!--  ================================================ -->
      
      <bean id="tremorDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
            <property name="url" value="jdbc:oracle:thin:@XXX:1521/abc.def.com"/>
            <property name="username" value="abc"/>
            <property name="password" value="abc"/>
      </bean>
      
      <bean id="TremorSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <property name="dataSource" ref="tremorDataSource" />
            <property name="packagesToScan" value = "com.tlrg.clear.web.domain" />
            <!-- property name="annotatedClasses">
                  <list>
                        <value>com.domain.VerticalTransaction</value>
                        <value>com.domain.VerticalTransactionQtr</value>
                        <value>com.domain.VerticalTransactionQtrKey</value>
                        <value>com.domain.Api</value>
                  </list>
            </property -->
            <property name="hibernateProperties">
                  <props>
                        <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
                        <prop key="hibernate.default_schema">myschema</prop>
                        <prop key="hibernate.show_sql">true</prop>
                        <prop key="hibernate.hbm2ddl.auto">none</prop>
                        <prop key="connection.pool_size">10</prop>
                        <!-- prop key="current_session_context_class">thread</prop -->
                        <!-- prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop -->  
                        <prop key="cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
                  </props>
            </property>
      </bean>
      
      <!--  ================================================ -->
        <!-- DAO to Controller Mapping at Persistence Layer -->
      <!--  ================================================ -->
      
      <!-- Vertical Transaction Qtr bean injection -->
      
      <bean id="tremorVtqDao" class="com.tlrg.clear.web.dao.VerticalTransactionQtrDAOimpl">
            <property name="sessionFactory" ref="TremorSessionFactory"/>
      </bean>
      
      <!--  ================================================ -->
                        <!-- Jsp view resolver mappings -->
      <!--  ================================================ -->
      
      <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
            <property name="prefix" value="/WEB-INF/jsp/"/>
            <property name="suffix" value=".jsp"/>
      </bean>
      
      <!-- URL Mapping through proper controller -->
      
      <bean id="urlHandler" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" >
            <property name="mappings">
                  <map>
                        <entry key="/tremorEntry.do" value="multiActionController"/>
                  </map>
            </property>
      </bean>
      
      <!--  ========================================================================================= -->
                        <!-- A Reference mapping to a class that extends MVC's MultiActionController -->
                        <!-- & able to handle multiple different request's with the help of              -->
                        <!-- PropertiesMethodNameResolver Class                                                        -->
      <!--  ========================================================================================= -->
      
      <bean id="multiActionController" class="com.tlrg.clear.web.VerticalTransactionQtrController" >
             <property name="methodNameResolver" ref="urlResolver" />
             <property name="vtqDao" ref="tremorVtqDao" />
       <!--       <property name="apiDao" ref="tremorApiDao" /> -->
       </bean>
      
      <!-- Mapping of incoming URL to method of MultiActionController -->
      
      <bean id="urlResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver" lazy-init="default">
            <property name="mappings">
                  <props>
                        <prop key="/tremorEntry.do">validateAndDelegateRequest</prop>
                  </props>
            </property>
      </bean>
      
      <!-- the application context definition for the springapp DispatcherServlet -->
      <bean id="environmentBean" name="/clearapp/environment.htm" class="com.tlrg.clear.web.EnvironmentController" />
      
      <!-- Controller Mappings -->      
      <!-- do not change the /clearapp.htm mapping -->      
      <bean name="/index.htm" class="com.tlrg.clear.web.PRSToolsController" />
      <bean name="/clearapp/grep.htm" class="com.tlrg.clear.web.GrepController" />
      <bean name="/clearapp/entityconversion.htm" class="com.tlrg.clear.web.EntityConversionController" />
      <bean name="/clearapp/dppaconversion.htm" class="com.tlrg.clear.web.DPPAConversionController" />
      <bean name="/clearapp/sitescope.htm" class="com.tlrg.clear.web.util.SitescopeController" />
      <bean name="/clearapp/sitescope/cachechoice.htm" class="com.tlrg.clear.web.util.CacheChoiceSitescopeController"/>
      <bean name="/clearapp/sitescope/personschema.htm" class="com.tlrg.clear.web.util.PersonSchemaSitescopeController"/>
      <bean name="/clearapp/sitescope/companyschema.htm" class="com.tlrg.clear.web.util.CompanySchemaSitescopeController"/>
      <bean name="/clearapp/sitescope/synthetic.htm" class="com.tlrg.clear.web.util.SyntheticSitescopeController"/>
      <bean name="/clearapp/sitescope/currentpoolsize.htm" class="com.tlrg.clear.web.util.CurrentPoolSizeSitescopeController"/>
</beans>
0
lakkarajumurali
Asked:
lakkarajumurali
  • 2
1 Solution
 
lakkarajumuraliAuthor Commented:
Sorry, i forget to add the stacktrace and here it is, please help me to resolve this.


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlHandler' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.tlrg.clear.web.GrepController' is defined
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.tlrg.clear.web.GrepController' is defined
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:388)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:385)
      at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095)
      at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:382)
      at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
      at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
      at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
      at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
      at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
      at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)
      at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      ... 40 more
Sep 30, 2011 1:12:25 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /prstools threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'com.tlrg.clear.web.GrepController' is defined
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:388)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:385)
      at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1095)
      at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:382)
      at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
      at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
      at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
      at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
      at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
      at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)
      at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
      at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
      at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
      at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
      at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
      at javax.servlet.GenericServlet.init(GenericServlet.java:212)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
0
 
lakkarajumuraliAuthor Commented:
i solved it.  The bean id's in the end were not there and those controller were never mapped in the urlHandler.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now