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

Main_csdn_String 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个方法都试过了,而且是一起试的。可是项目还是没办法启动。
...全文
248 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Main_csdn_String 2017-11-30
  • 打赏
  • 举报
回复
已近解决。
jdk版本错误,一般在别的电脑运行内存够的情况下,只有自己电脑出的问题。
后面的话跟换好jdk的版本就可以了

kampoo 2017-11-29
  • 打赏
  • 举报
回复
你的电脑是穿越来的 通常我都是开到 -Xmx4096m

51,396

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧