I'm trying to build a simple application, which connects with database and saves some data in it, let's say once per hour. I found some tutorials on pages like baeldung, but their solutions doesn't work for me. 

Here is my configuration file:

```
<?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:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">

<context:component-scan base-package="io.github.steve"/>

        <!-- Step 4: Add support for conversion, formatting and validation support -->
<mvc:annotation-driven/>

        <!-- Step 5: Define Spring MVC view resolver -->

<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames" value="messages"/>
</bean>

<bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
      destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/articles?useSSL=false"/>
<property name="user" value="root"/>
<property name="password" value=""/>
<property name="minPoolSize" value="5"/>
<property name="maxPoolSize" value="20"/>
<property name="maxIdleTime" value="30000"/>
</bean>

<bean id="sessionFactoryXXX" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="packagesToScan" value="io.github.steve.webscraping.domain"/>
<property name="hibernateProperties">
    <props>
        <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
        <prop key="hibernate.show_sql">true</prop>
    </props>
</property>
</bean>

<bean id="myTransactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactoryXXX"/>
</bean>

<tx:annotation-driven transaction-manager="myTransactionManager"/>

        </beans>

```

ArticlesDaoImpl: 

```
@Repository
public class ArticlesDaoImpl implements ArticlesDao {
    @Autowired
    SessionFactory sessionFactory;

    @Override
    public List<Article> getAllArticles() {
        Session session = sessionFactory.getCurrentSession();
        Query<Article> query = session.createQuery("from Article order by uploadDate", Article.class);
        return query.getResultList();
    }

    @Override
    public void addArticle(Article article) {
        Session session = sessionFactory.getCurrentSession();
        session.persist(article);
    }

}

```

ArticlesServiceImpl:

```
@Service
public class ArticlesServiceImpl implements ArticlesService {
    @Autowired
    private ArticlesDao articlesDao;

    @Override
    @Transactional
    public List<Article> getAllArticles() {
        return articlesDao.getAllArticles();
    }

    @Override
    @Transactional
    public void addArticle(Article article) {
        articlesDao.addArticle(article);
    }

    @Override
    @Transactional
    public void addArticles(List<Article> articles) {
        articles.stream().forEach(articlesDao::addArticle);
    }
}

```

And now: 
First of all, I don't know where should I put my xml config file.
I have no idea how to build my Main.class. I want to Autowire ArticlesService to Main class and run a method from it. When i use just SpringApplication.run(Main.class, args), it loads and finishing with exit code 1.

Main app:

```
@SpringBootApplication
@EnableScheduling
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

```

ScheduledTasks:

```
@Component
public class ScheduledTasks {
@Autowired
ArticlesService articlesService;

private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class);

@Scheduled(cron = "* * * * *")
public void reportCurrentTime() {
    articlesService.addArticles(new MkyongWebScraper().getArticlesList());
}

```

}

I'm really new in Spring and I know this question is pretty wide, but I can't find any suitable sources for my tasks. What am I doing wrong?