0 Replies Latest reply on Oct 4, 2011 2:20 AM by nitinkhekare

    Getting errors in spring xml

    nitinkhekare

      Hi

       

      In my application I am using spring 2.5.6 and I have xmls like

       

      1.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"

          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"

          default-lazy-init="true">

       

          <import resource="/com/test/impl/*.xml" />

       

          <bean id="test1" class="com.test.a.TestClass" scope="singleton">

              <property name="b1" ref="b1" />

          </bean>

       

      </beans>

       

      2.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"

          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"

          default-lazy-init="true">

       

      <bean id="b1" class="com.test.b.TestBClass"/>

       

      </beans>

       

      While deploying the application I am getting an Exception NoSuchBeanDefinitionException for bean b1.

       

      But when I change the 1.xml file import statement like

       

        <import resource="/com/test/impl/2.xml" />

       

      Then it works fine.

       

      This application works fine in jboss 4.2.3

       

       

      Can anybody help me in this ?

       

       

      Thanks