tomcat 部署多个工程 内在溢出

在部署多个web project时,有时会出现在以下错误。
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MessageDAO' defined in ServletContext resource [/WEB-INF/applicationContext_beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: PermGen space
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: PermGen space

如:web project1和web project2,这两个项目所引用的包都为如下所示,
[img]http://dl.iteye.com/upload/attachment/0083/2365/16b3b60a-33c8-33ff-943f-70164e37698f.png[/img]
这样,将它们一同部署到tomcat后,就会报错。但是,单独部署任何一个工程都可以成功启动。找了一些资料,有的说是得修改eclipse的内存配置,甚至修改相应注册表上的信息,而修改了也未必能够解决。其实大可不必,只需将“Tomcat 6.0\webapps\web project1\WEB-INF\lib”和“Tomcat 6.0\webapps\web project2\WEB-INF\lib”下的包
[img]http://dl.iteye.com/upload/attachment/0083/2375/b9438c2c-a9ce-3991-9680-44de80854238.png[/img]
都剪切到“Tomcat 6.0\lib”下即可,
[img]http://dl.iteye.com/upload/attachment/0083/2379/f2d03238-d565-3eb6-b28e-273484452e90.png[/img]
如果遇到重复,替换一下就行,最后启动tomcat就可以运行了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值