0

If there is a non syntax error in mybatis xml mapper like:

     <result property="pro"    column="col"     javaType="CustomObj" typeHandler="CutomObjTypeHandler"/>

where "CutomObjTypeHandler" is misspelled for example, the app will start deploying and hangs, the last tomcat log:

 Initializing Spring root WebApplicationContext

The deployment process doesn't stop, or raise exception, at least for the first 20 mins.

When that happen I go back and read the xml thoroughly to find the type-O.

Is there a better way to debug this ? or maybe my environment is not setup correctly to handle it ?

Nabil Sham
  • 2,305
  • 4
  • 26
  • 38

2 Answers2

0

Create integration test that will instantiate spring application context including mybatis mappers and will execute the query that you are modifying.

Then do small step-by-step changes introducing things to mapper incrementally running that test after each step.

Also make sure you have slf4j logging enabled so that you see errors logged by spring and mybatis. The errors caused by incorrect syntax are cryptic so the main thing is small step by step changes.

0

Sounds like this is a bug in mybatis that have been fixed recently https://jira.spring.io/browse/SPR-12397

Nabil Sham
  • 2,305
  • 4
  • 26
  • 38