最近完成一个网站,使用了Spring+Struts2+Hibernate3.2框架,spring整合了struts2和hibernate,由spring管理struts的Action类和heibernate.
在项目完成后,部署上线,在前几天运转正常,但在昨天,突然发现tomcate服务器会不定时的自动关闭,查看日志,没有发生大的错误,但服务器就是莫名其妙的自动关闭了.
仔细查看日志,发现了这样一段:
Closing Spring root WebApplicationContext
support.XmlWebApplicationContext (doClose:823) -
Closing org.springframework.web.context.support.XmlWebApplicationContext
@1a6684f: display name [Root WebApplicationContext]; startup date [Sat Jun 14 14:32:40 CST 2008];
root of context hierarchy
support.DefaultListableBeanFactory (destroySingletons:340) -
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory
@24de7d: defining beans [dataSource,sessionFactory,
transactionManager,org.springframework.aop.config.internalAutoProxyCreator,
ServiceMethods,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,
txAdvice,hibernateTemplate,commonService,
baseService,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,
purviewService,staticService,complainService,userService,linkService,departmentService,
sequenceService,newsService,categoryService,imageService,GovpubService,TypeService,
WorkGuideService,ApplyService,AddonsService,
QyxxService,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#2,
mailSender,mailMessage,mailService,indexAction,newsAction,complainAction,complainMngAction,
staticAction,loginAction,linkAction,sysmngAction,movmentAction,creditPubAction,speTopicAction,
partPoliticAction,conAlertAction,govCultureAction,workStudyAction,departmentAction,userAction,
imageAction,noticeAction,GovpubAction,OfficeAction,WorkGuideAction,GovpubIndexAction,ApplyAction,
qyxxAction,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#3,newsDwr,
categoryDwr,deptDwr,userDwr,linkDwr]; root of factory hierarchy
hibernate3.LocalSessionFactoryBean (destroy:981) - Closing Hibernate SessionFactory
impl.SessionFactoryImpl (close:769) - closing
显然是spring自动关闭了web容器,并将其管理的hibernate的session关闭,日志最后的关闭的bean类都是网站配置使用的action和service类.
在google了这方面的问题,没有找到类似的,只有在javaeye上找到一篇问题相同的提问blog,没有人留言解答.十分郁闷.
初步猜测,是服务器资源紧张导致tomcat自动关闭,在其中的一个service类中,找到了一个查询方法,使用了synchronized修饰关键字,这个方法根据用户输入的条件数据,大概就几万的数据量,且该功能在网站上使用非常频繁,是不是这个原因导致资源用尽服务器自动关闭?
把方法都去掉这个修饰关键字,网站运行没有发生以上错误,但发生错误的环境已经不再了(发生错误的时候,网站后台用户正在频繁点击录入数据),不知道是否解决这个问题,还会不会再次发生.
不知道有没有人遇到在ssh开发框架web应用中,发生过tomcat莫名关闭的问题,希望有哪位大虾给予回答.
分享到:
相关推荐
Tomcat5.5+struts2+Spring2.0.6+Hibernate3图书进行管理的系统
该示例使用MyEclipse 5.5 IDE用来整合四个技术(Struts 1.2, Spring 2.0, Hibernate 3.2和Ajax技术)的轻量级的JavaEE。 操作步骤如下: 1. 下载并解压之后,使用MyEclipse导入工程 2. 找到demo目录中的.sql数据库...
这是一个struts 1.2 + spring 2.5 + hibernate 3.2框架demo, 运行环境为eclipse 3.2 + tomcat 5.5 + oracle 11g
12.6 整合Struts、Spring和Hibernate实现用户管理 12.6.1 Struts、Spring和Hibernate的整合方式 12.6.2 编写用户注册画面regedit.jsp 12.6.3 编写用户登录画面login.jsp 12.6.4 编写注册控制器RegeditAction.java ...
MyEclipse6.0:Struts+Spring+Hibernate整合练习 用的工具Tomcat 5.5,MyEclipse6.0,sqlserver2005 适用于初学者学习之用
12.6 整合Struts、Spring和Hibernate实现用户管理 12.6.1 Struts、Spring和Hibernate的整合方式 12.6.2 编写用户注册画面regedit.jsp 12.6.3 编写用户登录画面login.jsp 12.6.4 编写注册控制器RegeditAction.java ...
开发环境为 MyEclipse6.0 + Tomcat 5.5 +jkd 1.6 解压后导入项目,即可运行
开发环境:Windows XP sp3、SQL Server 2005、JDK 1.6、Struts2.1.6、Spring 2.0、Hibernate3.1、MyEclipse 5.5、Tomcat 6.0 使用步骤: 1、下载解压之后,使用IDE导入工程 2、把工程中的“演示数据脚本.sql”导入到...
关于学习javaEE的资料,里面包括了三个框架的jar,以及免费mysql5.5以及mysql管理工具,以及Tomcat服务器6.0和7.0.基本整合了你需要的资料。不再为了找这些东西而费力了,虽然有点小贵,都是很值得
e拍的功能没有全部写完,但是ssh+ajax在上面了,有上传文件功能,信息一样的不能重复提交。 由于jar包多,上传的文件大小有限...注:一定要和我标明的jar包,运行环境MyEclipse6.0,Tomcat5.5(6.0),SQL2000(2005)
一个集成jbpm的demo WEB应用框架,需在tomcat5.5下部署。
Struts2,Spring,Hibernate,DWR,JavaMail,以及少部分正则表达式。其实都是非常基础简单的应用,目的就是让大家看看这些框架是如何协同工作的。开发平台为:Winxp2+JDK1.5+Tomcat5.5+MySQL5.0。
基于myeclipse5.5.1的ssh配置,MyEclipse5.5.1+Struts1.2+Sprint2+hibernate3.1+tomcat5.5
12.6 整合Struts、Spring和Hibernate实现用户管理 12.6.1 Struts、Spring和Hibernate的整合方式 12.6.2 编写用户注册画面regedit.jsp 12.6.3 编写用户登录画面login.jsp 12.6.4 编写注册控制器RegeditAction.java ...
Struts2,Spring,Hibernate,DWR,JavaMail,以及少部分正则表达式。其实都是非常基础简单的应用,目的就是让大家看看这些框架是如何协同工作的。开发平台为:Winxp2+JDK1.5+Tomcat5.5+MySQL5.0。 以下是本例子的...
jar包:项目中除了使用了struts2,hibernate3.0和spring1.8以外(用spring2.0的包也可以.不能低于1.8的包.)还是用了junit,ajax,第三方的table组件.等等.所以需要下载相对应的包. 为了上传jar.我专门申请了一个网盘.所有...
Struts2.0_Hibernate3_spring2.0 部署Web应用请按如下步骤进行: 1. 进入reg_login路径下,将mysql.sql脚本中的语句导入MySQL数据库。 2. 修改reg_login\WEB-INF路径下的applicationContext.xml文件,将其中的...
这里介绍一下怎样采用开源的Spring,Hibernate以及Struts构建一个轻量级的架构 实例说明:一个网站登录的例子,比较简单,但能说明各层是如何协调工作的。 工具:jdk1.5,eclipse3.2,myeclipse5.0GA,mysql5.0,...
开发环境 MyEclipse5.5 JDK 1.6 Java EE 5.0 Tomcat6.0 Struts2.1.6 Spring2.5.6 Hibernate3.3.1 2