热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

JavaWEB开发中的部分常见异常

2019独角兽企业重金招聘Python工程师标准[java]1、nestedexceptionisjava.lang.OutOfMemoryError:Javaheapspa

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

[java]

1、nested exception is java.lang.OutOfMemoryError: Java heap space:list

[hibernate]

1、should be mapped with insert="false" update="false":存在重复映射的字段;

2、Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]:

配置文件与实体文件映射错误,多了字段或少了字段或少些了getter 方法;

3、org.hibernate.LazyInitializationException: could not initialize proxy - no Session:映射关系中加上 lazy="false";

4、org.hibernate.ObjectNotFoundException: No row with the given identifier exists:根据外键id查询不到映射表的相应数据;

5、Could not determine type for: String, for columns: [org.hibernate.mapping.Column(XXX)]:type指的是*.hbm.xml配置文件中的类型,string要小写;

6、nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists:映射表中数据的主键id不匹配;

7、org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of XXX:配置文件与实体类字段类型不一致;

8、org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1:级联新增,打印出来的sql语句显示主表为insert,从表为update  可以将配置文件中自增id设置 unsaved-value="0";

9、ConstraintViolationException: Could not execute JDBC batch update:两个表建立了外键约束,删除约束后操作成功;

10、 nested exception is org.springframework.beans.NotWritablePropertyException:

11、org.springframework.beans.factory.BeanCreationException:Spring中的“asm-2.2.3.jar”和Hibernate中的“asm.jar”包冲突。解决办法是移除Spring2.0 AOP Libraries中的“asm-2.2.3.jar”即可

12、org.springframework.beans.MethodInvocationException: 在classes目录有一个以前的类,但现在的类的路径已经发生了变化,发生变化的类全部封装在 jar 里面,但class loader 是优先装载 classes 目录下的类,所以存在装载时发生“NoClassDefFoundError”错误!只要把classes下的class文件删除即可。

13、com.sun.faces.mgbean.ManagedBeanCreationException:数据问题

14、a different object with the same identifier value was already associated with the session:getHibernateTemplate().merge(object);http://chenying.blog.51cto.com/614874/134702

15、MySQLSyntaxErrorException: SELECT command denied to user 'XXX'@'XXX.XXX.XXX.XXX' for table 'XXX':http://ganhaitian.blog.sohu.com/198205957.html

[spring]

1、org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [classes/config/spring/beans/DataSource.xml]:路径不对

2、spring未注入引起的NullPointException

ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");     //source目录(一般是在src目录下) 第一种获取配置文件的方式//ApplicationContext context = new FileSystemXmlApplicationContext("D:\\applicationContext.xml"); //绝对路径  第二种获取配置文件的方式

 IDao dao = (Dao)context.getBean("dao");  //获取bean
 //dao.add(obj);//正常调用方法

路径问题

3、 java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required:配置文件未配置sessionFactory

4、com.sun.faces.mgbean.ManagedBeanCreationException: 无法设置受管 bean buildingBean 的属性 buildingBo:实体类和配置文件映射错误

5、启动 org.springframework.beans.factory.BeanCreationException:asm.jar包冲突

6、

[MySql]

1、mysql 内存表 #1114: The table is full  

修改tmp_table_size(set tmp_table_size=314572800;);

修改max_heap_table_size(Set max_heap_table_size=314572800;);

查询命令: show variables like '%tmp_table_size%'; show variables like '%max_heap_table_size%';

2、Warning: World-writable config file '/etc/my.cnf' is ignored:http://blog.sina.com.cn/s/blog_71261a2d0100yjj1.html

3、mysql Starting MySQL..The server quit without updating PID file:http://www.phpufo.com/?p=560

4、Can't start server: Bind on TCP/IP port: Permission denied  Do you already have another mysqld server running on port: 3308http://blog.csdn.net/daodan988/article/details/8378893

5、mysqldump备份数据库时出现when using LOCK TABLEShttp://hi.baidu.com/ttianmy/item/236ec32161c8bc9ab6326377

[tomcat]

1、IOException while loading persisted sessions: java.io.EOFException:清理一下tomcat的work目录

[primefaces][jsf]

1、javax.faces.FacesException: Cannot find component "xxx" in view.:jsf调不到html页面中"xxx"这个id。

2、javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String:使用标签

3、com.sun.faces.config.ConfigManager initialize  

  • 信息: Unsanitized stacktrace from failed start...

http://feuyeux.iteye.com/blog/751439

4、viewExpiredException 无法恢复视图http://wenku.baidu.com/view/cf325dd433d4b14e852468c5.html

[dwr]

1、session error :web.xml需要配置 http://nshg.iteye.com/blog/1513181

?

 
    crossDomainSessionSecurity  
    false  
  

  

code

faces-config.xml:

sceneConvertercn.ac.sim.ilec.utils.SceneConverter

SceneConverter.java:


import javax.faces.component.UIComponent;import javax.faces.context.FacesContext;

import javax.faces.convert.Converter;import cn.ac.sim.ilec.model.Scene;

/** *@description Scene是一个实体类 */

publicclass SceneConverter  implements Converter {    

@Override    

public Object getAsObject(FacesContext context, UIComponent component, String value) {        

Scene scene =new Scene();        

scene.setId(Integer.parseInt(value));        

return scene;  

}    

@Override    

public String getAsString(FacesContext context, UIComponent component, Object value) {        

return String.valueOf(((Scene) value).getId());  

}

}


xhtml:

converter="sceneConverter" var="scene"                                    

itemLabel="#{scene.name}" itemValue="#{scene}" showSourceControls="true" showTargetControls="true"                                showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" />


转:https://my.oschina.net/ministyle/blog/313958



推荐阅读
  • eclipse学习(第三章:ssh中的Hibernate)——11.Hibernate的缓存(2级缓存,get和load)
    本文介绍了eclipse学习中的第三章内容,主要讲解了ssh中的Hibernate的缓存,包括2级缓存和get方法、load方法的区别。文章还涉及了项目实践和相关知识点的讲解。 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • YOLOv7基于自己的数据集从零构建模型完整训练、推理计算超详细教程
    本文介绍了关于人工智能、神经网络和深度学习的知识点,并提供了YOLOv7基于自己的数据集从零构建模型完整训练、推理计算的详细教程。文章还提到了郑州最低生活保障的话题。对于从事目标检测任务的人来说,YOLO是一个熟悉的模型。文章还提到了yolov4和yolov6的相关内容,以及选择模型的优化思路。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 使用Ubuntu中的Python获取浏览器历史记录原文: ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 本文详细介绍了Spring的JdbcTemplate的使用方法,包括执行存储过程、存储函数的call()方法,执行任何SQL语句的execute()方法,单个更新和批量更新的update()和batchUpdate()方法,以及单查和列表查询的query()和queryForXXX()方法。提供了经过测试的API供使用。 ... [详细]
  • ASP.NET2.0数据教程之十四:使用FormView的模板
    本文介绍了在ASP.NET 2.0中使用FormView控件来实现自定义的显示外观,与GridView和DetailsView不同,FormView使用模板来呈现,可以实现不规则的外观呈现。同时还介绍了TemplateField的用法和FormView与DetailsView的区别。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 开发笔记:实验7的文件读写操作
    本文介绍了使用C++的ofstream和ifstream类进行文件读写操作的方法,包括创建文件、写入文件和读取文件的过程。同时还介绍了如何判断文件是否成功打开和关闭文件的方法。通过本文的学习,读者可以了解如何在C++中进行文件读写操作。 ... [详细]
  • 本文介绍了如何使用python从列表中删除所有的零,并将结果以列表形式输出,同时提供了示例格式。 ... [详细]
author-avatar
KNN
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有