title: Error creating bean with name '..' defined in file ..xml
body: <p>can you help me please? 1.My Dao</p>
  
  <pre><code>package user.dao.impl;
  
  import java.sql.ResultSet;
  import java.sql.SQLException;
  
  import javax.sql.DataSource;
  import org.springframework.jdbc.core.JdbcTemplate;
  import org.springframework.jdbc.core.RowCallbackHandler;
  import org.springframework.jdbc.datasource.DataSourceTransactionManager;
  import user.domain.DboBean;
  
  public class DboDao {
      private DataSourceTransactionManager transactionManager;
      private JdbcTemplate jdbcTemplate;
  
      public DboDao() {
          // TODO Auto-generated constructor stub
          super();
          DataSource datatSource = transactionManager.getDataSource();
          jdbcTemplate = new JdbcTemplate(datatSource);
      }
  
  //Spring setter injector used
  public void setTransactionManager(DataSourceTransactionManager transactionManager){
      this.transactionManager = transactionManager;
  }
  
  
  public DboBean read() {//String dboId
      // TODO Auto-generated method stub
      String sql = "SELECT ins_ID, ins_name FROM da_tracking "
              + "WHERE ins_ID = 3";
      final Object[] params = new Object[] {};//dboId
  
      //Creating object being queried
      final DboBean dboBean = new DboBean();      
      //Process query Results
      jdbcTemplate.query(sql, params, new RowCallbackHandler(){
          public void processRow(ResultSet rs) throws SQLException{
              dboBean.setDboId(rs.getString("dboId"));    
          }
  
      });
      return dboBean;//returns queried objects
  }
  }
  </code></pre>
  
  <p><br/>
  2. My Bean:</p>
  
  <pre><code> package user.domain;
  
   public class DboBean {
  
      private String dboId;
      private String dboDevName;
  
      public DboBean(){
          this.setDboId(dboId);
          this.setDboDevName(dboDevName);     
      }
  
      public String getDboId() {
          return dboId;
      }
  
      public void setDboId(String dboId) {
          this.dboId = dboId;
      }
  
      public String getDboDevName() {
          return dboDevName;
      }
  
      public void setDboDevName(String dboDevName) {
          this.dboDevName = dboDevName;
      }
   }
  </code></pre>
  
  <p>My spring:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang"
  xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
  http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsd"&gt;
  
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close"&gt;
      &lt;property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" /&gt;
      &lt;property name="url"
          value="jdbc:jtds:sqlserver://localhost:1433;databaseName=XYDB" /&gt;
      &lt;property name="username" value="user" /&gt;
      &lt;property name="password" value="xyz" /&gt;            
  &lt;/bean&gt;
  
  &lt;bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="objDbo" class="user.dao.impl.DboDao"&gt;
      &lt;property name="transactionManager" ref="transactionManager" /&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt; 
  </code></pre>
  
  <p>And my Junit:</p>
  
  <pre><code>package user.dao.JUnitTest;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.log4j.xml.DOMConfigurator;
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.FileSystemXmlApplicationContext;
  import java.lang.Object;
  
  import user.dao.impl.DboDao;
  import user.domain.DboBean;
  
  
  public class JUnitDaoTest extends TestCase {
  private static final String OID = "dboId";
  private static final String DDN = "dboDevName";
  protected static ApplicationContext appContext;
  private DboDao objDao;
  
  public JUnitDaoTest(String arg) {
      super(arg);
  }
  
  public static Test suite(){
      TestSuite suite = new TestSuite();
      suite.addTest(new JUnitDaoTest("testDboDAO"));
      return suite;       
  }
  
  public void setUp() throws Exception{
      init();
      objDao =  (DboDao) getBean("objDao");
  }
  
  public static void main(String[] args){
      junit.textui.TestRunner.run(suite());
  }
  //@Override
  public synchronized void init(){
      if (appContext == null){
          try{
              String path = System.getProperty("user.dir");
              String slash = System.getProperty("file.separator");
  
              String configDir = path + slash + "config" + slash;
              DOMConfigurator.configure(configDir +  "log4j.xml");
  
              appContext = new FileSystemXmlApplicationContext(new String[] {configDir + "appContext.xml"});
          }catch(Exception e){
              System.err.println(e.getMessage());
          }
      }
  }
  
  protected Object getBean(String beanName){
      return appContext.getBean(beanName);
  }
  
  
  public void testDboDAO(){
      DboBean record = new DboBean();
      record.setDboId(OID);//setDboId(dboId);
      record.setDboDevName(DDN);
  
  
  
      DboBean bean = objDao.read();
      assertEquals(DDN, bean.getDboDevName());
      System.out.println("User selected [" + bean.getDboId() + ", " + bean.getDboDevName() + 
              "]");
  
      //objDao.delete(dboId);
      //bean = objDao.read(dboId);
      //assertEquals(null, bean.getDboDevName());
      //System.out.println("User is deleted [" + bean.getDboId() + ", " + bean.getDboDevName() + 
          //  "]");
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I get this Error:
  Error creating bean with name 'objDbo' defined in file [...\config\appContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [user.dao.impl.DboDao]: Constructor threw exception; nested exception is java.l</p>
  
  <p>Have you an idea??
  blob</p>