0、 需要标识符 a) 不在函数内
1、 非法表达式开始 b) 可能:丢失括号 .
2. no data found a) 可能:setInt(1,100)中,没有 100 这个值
3. 找不到符号 a) 可能:没导入包
4. 指定了无效 URL a) 可能:数据库名或 IP 错误,即连接出错
5. 类路径没有找到 a) 可能: ClassNotFoundException: oracle.jdbc.driver.OracleDriver b) 原因: 一般是指包名写错,或者没有 import 包,或者没有在类路径中找到 jar 文件 c) 解决: 没有加载 Oracle 驱动 jar,在.bash_profile 中把 ojdbc14.jar 加进来
6. 空指针异常 a) 可能: 数据源错误 比如数据库名或 IP 错误
7. 不能执行查询 a) 可能: 数据库中表的问题,比如列名不存在
8. invalid identity a) 可能: 列名出错
9. 若在数据库中创建了 两个 sequence ,运行时出现异常可能是先后执行了多次 select 语句, 导致与原有的序列号产生冲突
10. 表名或列名不存在 a) 可能:表不存在或者没有插入数据到表中
11. 不支持的类,类的版本错误 a) 可能:没有导入 jdk5.0,或者编译器仍为 1.4
12. MappingNotFoundException a) Maybe: In the Eclipse Not refersh , or not exist in the dirctory
13. HibernateException: /hibernate.cfg.xml not found a) Maybe1: hibernate.cfg.xml not in the root directory b) Maybe2: Could not parse configuration . c) resolve: database not connect or use another database
14. ConstraintViolationException a) Maybe: used a not true database
15. 驱动没有找到 或者 JDBC Driver not found 可能:连接数据库的驱动 jar 包不存在或者版本不一致,比如将旧的版本换成新的会造成该 类错误 16. 空指针异常 , java.lang.NullPointerException a) 可能 1:数据库连接出错,比如在 hibernate.cfg.xml 中的数据错误会导致异常。
17. 数据插入异常 ,GenericJDBCException: could not insert a) 可能 1:没有建立表或者表中没有任何数据 b) 可能 2:插入数据后没有执行提交语句:commit
18. LazyInitializationException 或者延迟加载异常 a) 可能 1:没有在
查询语句中加 fetch
19. IdentifierGenerationException a) 可能 1:高位表没有初始化(比如 hi_value 中没有记录)
20. could not initialize a collection: [hibernate.entity.Role.modules#32768] Syntax error: Encountered "-" at line 1, column 132. a) 错误原因:
红色字部分中“-” 为非法字符,替换为 module_role
21. could not insert collection rows: [hibernate.entity.Module.roles#1] 在 Module.hbm.xml 文件的如下配置中加入 inverse=”true”
22.在部署 Struts 时,出现如下错误信息: HTTP Status 404 - Servlet action is not available
type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. 问题原因: 1.、web.xml 文件中未配置 Acti
onServlet。 2、struts-config.xml 文件未配置你要访问的 Action。 3、你的 jsp 文件 form 标记中 action 属性的路径名称错误。 4、非以上三种情况。 针对以上 4 种情况相应的解决方案如下: 1、在 web.xml 文件中加上 ActionServlet 的配置信息 ?????? /WEB-INF/struts-config.xml? ?2、在 struts-config.xml 文件检查你要访问的 Action 配置文件。 3、 检查 jsp 文件 form 标记中 action 属性的路径名称是否与 struts-config.xml 文件中 action 标记的 path 属性的路径名称一致。 4、非以上情况的解决办法就是检查 web 容器的 log 日志,如果时 tomcat 则检查下 logs 目 录下的 localhost_log 文件, 看里边是否记录有错误信息, 然后根据错误信息提示将其纠正。
23.java.lang.NoClassDefFoundError: org/apache/commons/beanutils/Converter 缺少 spring-framework-2.0.