title: SEVERE : Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
body: <p>I'm new to spring and i'm not able to figure out the problem.please help me on this.I m getting classnotfound exeption even there is package defined in my src location.</p>
  
  <p>and i have added a listener as you can see it is commented in web.xml contextListener class.it is also defined in the src code but it is giving classNotFound exception.please suggest and help me on this</p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance
    of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating
  bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.org.promo.beans]
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4738)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5181)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  Caused by: org.springframework.beans.TypeMismatchException: Failed to    convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.org.promo.beans]
  at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)
  at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)
  at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
  ... 20 more
   Caused by: java.lang.IllegalArgumentException: Cannot find class   
   [com.org.promo.beans]
  at
  org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:272)
  at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
  at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)
  at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)
  at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)
  at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:128)
  at org.springframework.beans.TypeConverterDelegate.convertToTypedArray(TypeConverterDelegate.java:441)
  at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:198)
  at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)
  ... 26 more
   Caused by: java.lang.ClassNotFoundException: com.org.promo.beans
   at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
  at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
  at org.springframework.util.ClassUtils.forName(ClassUtils.java:236)
  at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:269)
  ... 34 more
  </code></pre>
  
  <p>and here is my web.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com
  /xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
  
  
  
  &lt;display-name&gt;Archetype Created Web Application&lt;/display-name&gt;
  
  &lt;listener&gt;
          &lt;listener-class&gt;
          org.springframework.web.context.ContextLoaderListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;!--    &lt;listener&gt;
            &lt;listener-class&gt;
             com.org.promo.properties.ContextListener
            &lt;/listener-class&gt;
  &lt;/listener&gt;  --&gt;   
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/dispatcher-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>`</p>
  
  <p>And this is my dispatcher-servlet.xml file </p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:context="http://www.springframework.org/schema/context"
  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-3.0.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;!-- Base package for checking the annoted classes --&gt;
  &lt;context:component-scan base-package="com.org." /&gt;
  
  &lt;context:annotation-config&gt;&lt;/context:annotation-config&gt;
  &lt;bean
  class="org.springframework.web.servlet.view.InternalResourceViewResolver"
    &gt; 
      &lt;property name="prefix"&gt;
          &lt;value&gt;/WEB-INF/views/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix"&gt;
          &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
   &lt;!-- Configure JDBC Connection--&gt;
    &lt;bean id="dataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/SAMPLE_DB" /&gt;
          &lt;property name="username" value="admin_user" /&gt;
          &lt;property name="password" value="admin" /&gt;
    &lt;/bean&gt;
  
  
    &lt;!-- Configure Hibernate 4 Session Facotry --&gt;
    &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
  
          &lt;property name="dataSource"&gt;
            &lt;ref bean="dataSource" /&gt;
          &lt;/property&gt;
  
          &lt;property name="hibernateProperties"&gt;
            &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
            &lt;/props&gt;
          &lt;/property&gt;
          &lt;property name="annotatedClasses"&gt;
          &lt;list&gt;
                &lt;value&gt;com.org.promo.beans&lt;/value&gt; &lt;!-- Entity classes--&gt;
          &lt;/list&gt;
          &lt;/property&gt;
  
    &lt;/bean&gt;
  </code></pre>
  
  <p></p>