内存溢出,Java使用Tom启动的时候直接崩溃。

Main_csdn_String Java攻城狮  2017-11-28 04:48:33


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个方法都试过了,而且是一起试的。可是项目还是没办法启动。
...全文
184 2 点赞 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
Main_csdn_String 2017-11-30
已近解决。
jdk版本错误,一般在别的电脑运行内存够的情况下,只有自己电脑出的问题。
后面的话跟换好jdk的版本就可以了

  • 打赏
  • 举报
回复
kampoo 2017-11-29
你的电脑是穿越来的 通常我都是开到 -Xmx4096m
  • 打赏
  • 举报
回复
相关推荐
发帖
Java
加入

4.8w+

社区成员

Java相关技术讨论
申请成为版主
帖子事件
创建了帖子
2017-11-28 04:48
社区公告
暂无公告