0 Replies Latest reply: Jan 28, 2009 10:32 AM by 843807 RSS

    "NoSuchBeanDefinitionException" in code

    843807
      Hi I'm getting " org.springframework.beans.factory.NoSuchBeanDefinitionException" in my code.

      java code:_
                     ApplicationContext mApplicationContext = null;
                     mApplicationContext = new FileSystemXmlApplicationContext(
                                                                  "mydrive\\*-applicationContext.xml");
      SomeContextFactory contextFactory = (SomeContextFactory) mApplicationContext.getBean("propertyConfigurer");



      applicationContext.xml:*
      <?xml version="1.0" encoding="utf-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:util="http://www.springframework.org/schema/util"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
      <description>
      Sets up the resources for testing purposes.
      </description>

      <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="locations">
      <list>
      <value>classpath:test/allWeb.properties</value>
      </list>
      </property>
      </bean>
      <import resource="classpath:data-context.xml" />
      </beans>