Skip to content

Output a warning log when 'mapperLocations' was specified but matching resources are not found #12

Closed
@lmiroslaw

Description

@lmiroslaw

I found out someting interesting. mapperLocations property in my xml configuration file points to non-existing path:

 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="typeAliasesPackage" value="com.ucware.ucpo.statemachine.model"/> <!-- Register the short names of beans as aliases -->
    <property name="configLocation" value="classpath:mybatis-config.xml"/>
    <property name="mapperLocations" value="classpath*:/com/state/persistence/mapper/*.xml" />
</bean>

Still org.mybatis.spring.SqlSessionFactoryBean reports no exception.
this.mapperLocations is empty and execution continues.

In my case the correct link to the mapper is:
classpath_:/com/missing_entry/state/persistence/mapper/_.xml

Should not the exception be thrown ?

I use mybatis-spring.1.2.0.

Metadata

Metadata

Assignees

Labels

enhancementImprove a feature or add a new feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions