内存溢出,Java使用Tom启动的时候直接崩溃。
Caused by: java.lang.OutOfMemoryError: Java heap space
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centerSrvAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.service.NeRedirectService com.dinstar.sim.action.CenterSrvAction.neRedirectServiceDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.service.NeRedirectService com.dinstar.sim.action.CenterSrvAction.neRedirectServiceDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: java.lang.OutOfMemoryError: Java heap space
严重: Exception sending context initialized event to listener instance of class com.dinstar.sim.action.InitListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centerSrvAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.service.NeRedirectService com.dinstar.sim.action.CenterSrvAction.neRedirectServiceDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.service.NeRedirectService com.dinstar.sim.action.CenterSrvAction.neRedirectServiceDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectServiceDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.dinstar.sim.dao.TblNeRedirectMapper com.dinstar.sim.service.impl.NeRedirectServiceImpl.neRedirectMapperDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neRedirectMapperDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Users\Administrator\Workspaces\dingxtd\.metadata\.me_tcat\webapps\web\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Caused by: java.lang.OutOfMemoryError: Java heap space
省略部分的debug
解决思路:
1. 修改eclipse文件myeclipse.ini 文件 添加
-Xmx512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=256m
已经很大了。在大的话 eclipse都打不开了。。。
2. 修改Tomcat的内存 在apache-tomcat-6.0.35\bin\catalina.bat 修改
修改Java条件
set JAVA_OPTS= -Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxNewSize=256M -XX:MaxPermSize=256M
3.修改tomcat6w.exe
-Dcatalina.base=%tomcat_home%
-Dcatalina.home=%tomcat_home%
-Djava.endorsed.dirs=%tomcat_home%\endorsed
-Djava.io.tmpdir=%tomcat_home%\temp
-XX:PermSize=256M
-XX:MaxPermSize=256M
-XX:ReservedCodeCacheSize=48M
-Duser.timezone=GMT+08
修改的条件
4.修改了 Validation 只剩下一个类路径依赖验证器 只有构造打勾了,其他的都没打勾。。
以上4个方法都试过了,而且是一起试的。可是项目还是没办法启动。