Closed CK-PENG closed 10 years ago
Hi,
There is no limit for the number of mappers, so it is most likely a memory issue. Here's a similar report mybatis/spring#26
Excuse me,my project is the use of MyBatis3.1.1,If i can upgrade directly mybatis-spring to 1.2.2,or need to upgrade MyBatis to MyBatis3.2.X?
I am honestly not sure, but if there is any incompatibility, the doc should reflect it. And I would recommend using the latest version (3.2.7 at present) unless you have a reason not to.
If you have further questions, please use the mailing list.
Thank you, Iwao
@CK-PENG i have the same problem...
same problem here
Hi @ahzean @getter3 ,
I'm willing to help, but "same here" comment is useless. On the other issue, I showed that the number of mappers did not cause this issue by itself and suggested increasing the heap size. If you increased the heap size and it still failed, please post what you tried and share the details of your environment.
Some update after today testing: 1) searched through the net, some suggest that there is problem with mybatis auto scanning of mapper. The recursive call of injection somehow caused the problem here
Ref: http://blog.csdn.net/boling_cavalry/article/details/73071020
2) increase the heap size cannot help (e.g increase heap size by 1G) 3) we have tried increase the size of the stack and some how solved the problem, that align with suggestion in point 1) JVM setting -Xss1536k , default should be 1024k
Our project using Spring 3.2.3 with mybatis 3.0.6 mybatis-spring-1.0.2
Of course , increasing stack size is just a temporarily solution.
Hi @getter3,
If it's the same issue as the one described in the linked blog post, you may need to use newer versions of MyBatis and MyBatis-Spring because sqlSessionFactoryBeanName
was added in MyBatis-Spring 1.1.0.
http://www.mybatis.org/spring/mappers.html#MapperScannerConfigurer
If possible, please use the latest versions (MyBatis 3.4.5, MyBatis-Spring 1.3.1).
Use MapperScannerConfigurer to automatically scan mapper
If too much mapper will lead to the exception:(More than 200 mapper) Exception sending context initialized event to listener instance of class com.glaf.core.context.StartupListener java.lang.NoClassDefFoundError: Could not initialize class org.springframework.beans.factory.BeanCreationException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
but if i using the mybatis-spring-1.2.2.jar,this exception does not appear in.
Excuse me,my project is the use of MyBatis3.1.1,If i can upgrade directly mybatis-spring to 1.2.2,or need to upgrade MyBatis to MyBatis3.2.X?
thanks!!