真善美

勇于承担责任; 如果你做不到,要提前跟别人说明,不要等到事情发生后再解释。

  BlogJava :: 首页 ::  :: 联系 :: 聚合  :: 管理 ::
  55 随笔 :: 0 文章 :: 29 评论 :: 0 Trackbacks

1、启动tomcat时出现的问题:
严重: Exception during cleanup after start failed
LifecycleException:  Container StandardContext[/MAMIS.myeclipse.bak] has not been started
解决方案:
把tomcat下conf里(\Tomcat 5.0\conf\Catalina\localhost)的相应文件删了就行了。
实在不行:连同\Tomcat 5.0\webapps和\Tomcat 5.0\work下的都删了。
2、启动tomcat时出现的问题:
2007-08-01 08:53:39,562 [ContextLoader] ERROR Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ModuleInfoService' defined in ServletContext resource [/WEB-INF/bean-service.xml]: Cannot resolve reference to bean 'ModuleInfoServiceImpl' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ModuleInfoServiceImpl' defined in ServletContext resource [/WEB-INF/bean-service.xml]: Cannot resolve reference to bean 'MaModbaseinfoDAO' while setting bean property 'maModbaseinfoDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MaModbaseinfoDAO' is defined
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ModuleInfoServiceImpl' defined in ServletContext resource [/WEB-INF/bean-service.xml]: Cannot resolve reference to bean 'MaModbaseinfoDAO' while setting bean property 'maModbaseinfoDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MaModbaseinfoDAO' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'MaModbaseinfoDAO' is defined
……
解决方案:
bean-service.xml,bean-dao.xml里的配置有问题,如确定没有问题了,再看service实现类里的DAO是不是已经写get,set方法了?

3、页面提示问题
HTTP Status 404 - /MAMIS/

--------------------------------------------------------------------------------

type Status report

message /MAMIS/

description The requested resource (/MAMIS/) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28
解决方案:
404一般都为配置文件的问题。
4、tomcat报错:
ERROR Cannot create JDBC driver of class 'com.informix.jdbc.IfxDriver' for connect URL '
    jdbc:informix-sqli://?.?.?.?:****/mamis:INFORMIXSERVER=mamis;NEWCODESET=gbk,8859-1,819
解决方案:
spring配置文件有错。
正确写法:
<property name="url">
   <value>jdbc:informix-sqli://?.?.?.?:****:informixserver=mamis_ser_tcp;database=mamis</value>
 </property>
错误写法:
<property name="url">
      <value>
            jdbc:informix-sqli://?.?.?.?:****:informixserver=mamis_ser_tcp;database=mamis
      </value>
</property>
(2007-08-16:)
5、tomcat报错
2007-08-17 10:49:19,156 [ProgramAimChildAction] ERROR org.springframework.orm.hibernate3.HibernateSystemException: Illegal attempt to associate a collection with two open sessions; nested exception is org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
org.springframework.orm.hibernate3.HibernateSystemException: Illegal attempt to associate a collection with two open sessions; nested exception is org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
解决方案:将getHibernateTemplate().update(object),修改为getHibernateTemplate().merge(object)
6、tomcat报错

org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition

      at org.springframework.orm.hibernate3.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:1098)

      at org.springframework.orm.hibernate3.HibernateTemplate$18.doInHibernate(HibernateTemplate.java:692)

      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)

      at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:690)

      at com.cvicse.ks.mamis.common.dao.impl.BaseDAOImpl.updateObject(BaseDAOImpl.java:40)

解决方案:
在web.xml中加入蓝色部分
<!-- 过滤spring中对于hibernate的session关闭管理 -->
 <filter>
  <filter-name>hibernateFilter</filter-name>
  <filter-class>
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
  </filter-class>
        <init-param>
             <param-name>singleSession</param-name>
             <param-value>false</param-value>
         </init-param>
 </filter>
 <filter-mapping>
  <filter-name>hibernateFilter</filter-name>
  <url-pattern>*.do</url-pattern>
 </filter-mapping>
7、页面报错
org.apache.jasper.JasperException: /jsp/system/promaintain/proInfoEdit.jsp(2,0) File "/WEB-INF/××××.tld" not found
解决方案:
对应的标签文件在框架中的位置可能不对。
 8、tomcat报错
ERROR a different object with the same identifier value was already associated with the session:
同一个session中关联了两个同ID的实体对象 。
我的代码:
public void updateMaModbaseinfoShxx(MaModbaseinfo maModbaseinfo, String inid)
   throws IllegalAccessException, InvocationTargetException {
  // 模块基本信息结果集
  List moduleInfoList = new ArrayList();
  // 根据项目内部代号查询模块基本信息表
  moduleInfoList = queryModule(inid);
  // 存入记录
  for (int i = 0; i < moduleInfoList.size(); i++) {
   MaModbaseinfo modInfoPO = new MaModbaseinfo();
   MaModbaseinfoVO maModbaseinfoVO = new MaModbaseinfoVO();
   maModbaseinfoVO = (MaModbaseinfoVO) moduleInfoList.get(i);
   BeanUtils.copyProperties(modInfoPO, maModbaseinfoVO);
   modInfoPO.setAc(maModbaseinfo.getAc());
   modInfoPO.setAd(maModbaseinfo.getAd());
   modInfoPO.setAr(maModbaseinfo.getAr());
   modInfoPO.setAn(maModbaseinfo.getAn());
   maModbaseinfoDAO.updateObject(modInfoPO);
  }
 }
解决方案:因为传参和new的对象同在引起的问题,所以不要在此方法中重新new一个对象。
9、页面报错
java.lang.IllegalArgumentException: No bean specified
 org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:751)
 org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
 org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
 org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
 com.cvicse.ks.mamis.common.context.AppRequestEncodingFilter.doFilter(AppRequestEncodingFilter.java:40)
解决方案:
jsp页面中包含一些隐藏域出现问题。

posted on 2007-08-09 15:00 真善美 阅读(9706) 评论(1)  编辑  收藏 所属分类: 其它