NovemberEleven
NovemberEleven

Reputation: 243

Mybatis always log "Property 'configLocation' not specified"

I test Mapper with JUnit, and I get the log info bellow infinite loop.

14:07:54.040 [main] DEBUG o.m.spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration

Upvotes: 1

Views: 8177

Answers (2)

Michał Rybak
Michał Rybak

Reputation: 8706

This is just a information that you haven't included <property name="configLocation" value="path_to_mybatis_config_file.xml"/>.

Note that this message is not indicating any error, as it's not always neccessary to include this XML file, because some configuration can be performed directly using bean property tags.

Upvotes: 3

Ian Lim
Ian Lim

Reputation: 4284

In order for others to help you, please show your application context setup for org.mybatis.spring.SqlSessionFactoryBean. This is a working example:

<bean id="YOUR_BEAN_ID" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="YOUR_DATA_SOURCE"/>
    <property name="mapperLocations" value="classpath*:*Mapper.xml"/>
    <property name="configLocation" value="classpath:TO_YOUR_MYBATIS_CONFIG.XML"/>
</bean>

Upvotes: 2

Related Questions