- 浏览: 526707 次
- 性别:
- 来自: 广州
最新评论
-
shitouofIT:
...
Spring Autowired(required = false) 说明 -
liuchongming:
...
Spring Autowired(required = false) 说明 -
20101975liubin:
...
Spring Autowired(required = false) 说明 -
ghpaas:
orbeon作为xforms标准的实现,不论其设计器还是运行时 ...
Eclipse 下安装 Visual XForms Designer 插件 -
young.java:
[flash=200,200][url][img][list] ...
利用JS生成32位的UUID(源码)
原文引自:http://blog.sina.com.cn/s/reader_53edf7c101009gy3.html
1.
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
原因:<id>元素配置不正确,<id>元素缺少其子元素<generator></generator>的配置。解决方法:<id>元素映射了相应数据库表的主键字段,对其子元素<generator class="">,其中class的取值可以为increment、identity、sequence、hilo、native......等,一般取其值为native 。
2.
java.lang.IllegalArgumentException: id to load is required for loading
方案:Users user=(Users)this.getHibernateTemplate().get(Users.class, id);如果以用户名为参数不能用此方法
3.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
方案:sql语句有错误
4.
严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs does not exist or is not a readable directory
严重: Error in resourceStart()
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Exception during cleanup after start failed
LifecycleException: Container StandardContext[/tomcat-docs] has not been started
5.jsf+spring+hibernate
严重: 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 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
严重: Error listenerStart
2007-6-8 10:31:55 org.apache.catalina.core.StandardContext start
严重: Context [/shj01] startup failed due to previous errors
2007-6-8 10:31:55 org.apache.catalina.core.ApplicationContext log
方案:spring-framework-2.0.5\lib\jakarta-commons下的commons-collections.jar commons-dbcp.jar commons-pool.jar加载到工程去
6.
严重: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse configuration file:jar:file:/E:/工具/apache-tomcat-6.0.9/apache-tomcat-6.0.9/webapps/jsf02/WEB-INF/lib/jsf-impl.jar!/com/sun/faces/standard-html-renderkit.xml
方案:把tomcat的安装文件换了位置就没事了
7.spring MVC+hibernate
严重: StandardWrapper.Throwable
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.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
方案:
在使用Spring的AOP编程时,会用到这几个lib:
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
Hibernate使用如果lib:
asm.jar
asm-attrs.jar
其中asm-2.2.2.jar与asm.jar存在类上的冲突!!!
使用其中之一或两者都使用,可能会出现如下错误:
java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit。。。。。。
解决办法是:
1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar
8.spring MVC+hibernate
Exception in thread "main" org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
9.
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean] for bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
方案:没加 spring 2.0 aop libraries
10.
org.apache.jasper.JasperException: Unable to compile class for JSP:
方案:jsp网页中的java代码有问题
11.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CompanyController' defined in class path resource [com/company/test/company-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
控制器没继承MultiActionController
12.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'turDiffService' defined in class path resource [com/expert/test/expert-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
原因:
在定义时TurDifficultDao turDifficultDao ,把有个字母写错,后发现错误,改过来了,但没把get() set()方法中对应的改过来
13.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in class path resource [com/expert/test/expert-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
原因:
在expert-config.xml中创建
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key=""></prop>
</props>
</property>
</bean>
没有给<prop key=""></prop>赋值
14.
org.springframework.orm.hibernate3.HibernateQueryException: Instruction is not mapped
[from Instruction]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:
Instruction is not mapped [from Instruction]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Instruction is not mapped [from
Instruction]
原因:在data-config.xml中没加入<value>com/serializ/Instruction.hbm.xml</value>
15.
java.sql.SQLException: Field 'userId' doesn't have a default value
原因:把配置文件的主键改为<generator class="assigned" /> 可以进行自定义主键值,因为我在设主键时没有设成自动增长的,要求填默认值是受了配置文件里<generator class="native"/>的影响了。
16.org.apache.jasper.JasperException: Unable to compile class for JSP
原因:jsp页面中的java代码括号不对称!
1.
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():
原因:<id>元素配置不正确,<id>元素缺少其子元素<generator></generator>的配置。解决方法:<id>元素映射了相应数据库表的主键字段,对其子元素<generator class="">,其中class的取值可以为increment、identity、sequence、hilo、native......等,一般取其值为native 。
2.
java.lang.IllegalArgumentException: id to load is required for loading
方案:Users user=(Users)this.getHibernateTemplate().get(Users.class, id);如果以用户名为参数不能用此方法
3.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
方案:sql语句有错误
4.
严重: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs does not exist or is not a readable directory
严重: Error in resourceStart()
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
2007-6-6 23:32:25 org.apache.catalina.core.StandardContext start
严重: Exception during cleanup after start failed
LifecycleException: Container StandardContext[/tomcat-docs] has not been started
5.jsf+spring+hibernate
严重: 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 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
严重: Error listenerStart
2007-6-8 10:31:55 org.apache.catalina.core.StandardContext start
严重: Context [/shj01] startup failed due to previous errors
2007-6-8 10:31:55 org.apache.catalina.core.ApplicationContext log
方案:spring-framework-2.0.5\lib\jakarta-commons下的commons-collections.jar commons-dbcp.jar commons-pool.jar加载到工程去
6.
严重: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse configuration file:jar:file:/E:/工具/apache-tomcat-6.0.9/apache-tomcat-6.0.9/webapps/jsf02/WEB-INF/lib/jsf-impl.jar!/com/sun/faces/standard-html-renderkit.xml
方案:把tomcat的安装文件换了位置就没事了
7.spring MVC+hibernate
严重: StandardWrapper.Throwable
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.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
方案:
在使用Spring的AOP编程时,会用到这几个lib:
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
Hibernate使用如果lib:
asm.jar
asm-attrs.jar
其中asm-2.2.2.jar与asm.jar存在类上的冲突!!!
使用其中之一或两者都使用,可能会出现如下错误:
java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit。。。。。。
解决办法是:
1.去掉类路径上的关于Hibernate的3个lib
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
2.加入Spring中的以下4个lib
asm-2.2.2.jar
asm-commons-2.2.2.jar
asm-util-2.2.2.jar
cglib-nodep-2.1_3.jar
8.spring MVC+hibernate
Exception in thread "main" org.springframework.dao.InvalidDataAccessResourceUsageException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
9.
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean] for bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AbstractSingletonProxyFactoryBean
方案:没加 spring 2.0 aop libraries
10.
org.apache.jasper.JasperException: Unable to compile class for JSP:
方案:jsp网页中的java代码有问题
11.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CompanyController' defined in class path resource [com/company/test/company-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'methodNameResolver' of bean class [com.company.action.CompanyController]: Bean property 'methodNameResolver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
控制器没继承MultiActionController
12.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'turDiffService' defined in class path resource [com/expert/test/expert-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'turDifficultDao' of bean class [com.expert.operation.impl.TurDiffSerImpl]: Bean property 'turDifficultDao' is not writable or has an invalid setter method. Did you mean 'truDifficultDao'?
原因:
在定义时TurDifficultDao turDifficultDao ,把有个字母写错,后发现错误,改过来了,但没把get() set()方法中对应的改过来
13.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in class path resource [com/expert/test/expert-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '' is defined
原因:
在expert-config.xml中创建
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key=""></prop>
</props>
</property>
</bean>
没有给<prop key=""></prop>赋值
14.
org.springframework.orm.hibernate3.HibernateQueryException: Instruction is not mapped
[from Instruction]; nested exception is org.hibernate.hql.ast.QuerySyntaxException:
Instruction is not mapped [from Instruction]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Instruction is not mapped [from
Instruction]
原因:在data-config.xml中没加入<value>com/serializ/Instruction.hbm.xml</value>
15.
java.sql.SQLException: Field 'userId' doesn't have a default value
原因:把配置文件的主键改为<generator class="assigned" /> 可以进行自定义主键值,因为我在设主键时没有设成自动增长的,要求填默认值是受了配置文件里<generator class="native"/>的影响了。
16.org.apache.jasper.JasperException: Unable to compile class for JSP
原因:jsp页面中的java代码括号不对称!
发表评论
-
android 各种权限 permission 列举
2013-05-28 11:48 1405在Android的设计中,资源的访问或者网络连接,要得到这 ... -
java 判断程序是否正在运行
2011-08-18 18:02 4245public class ProcessBuilder ... -
Spring Autowired(required = false) 说明
2011-07-21 15:29 79325当候选 Bean 数目不为 1 时的应对方法 ... -
ProcessBuilder实现Java应用程序自我重启
2011-07-12 20:01 2737程序运行的过程中,我们可能需要更改一些配置,如果配置 ... -
Spring获取Bean常用方式
2011-07-05 16:42 1869方法一:在初始化时创建ApplicationContex ... -
Java 利用线程池创建并发线程
2011-07-05 16:25 2223import java.util.concurrent. ... -
Java 超时线程控制实现
2011-07-05 16:11 9530在Java中,如果需要设定代码执行的最长时间,即超 ... -
Java 对比两字符串的相似度
2011-07-05 16:03 4143/** * 编辑距离算法,首先由俄国科学家Levensh ... -
Oracle session process lock
2011-05-26 10:30 1785须以Oracle 数据库 system 权限账户登录 ... -
Java 识别字符编码
2011-05-26 10:25 2090public class EncodingUtils { ... -
数据库主键设置为全局唯一方案
2011-04-25 15:09 2480现在通过数据的水平切分(sharding)来实现数据库 Sca ... -
JS验证浏览器端是否安装某插件
2011-04-14 14:01 2245<HTML> <HEAD><sc ... -
利用JS生成32位的UUID(源码)
2011-02-15 16:23 17545创建 UUID.js 文件, 然后复制以下内容: // ... -
Java 日期字符串date与数字long之间的转换
2010-11-30 14:32 50564public class SimpleDateUtil { ... -
Hibernate Annotation 使用说明
2010-09-25 14:18 2458/** * 注释说明: ... -
svn 如何开启用户可编辑log message的权限
2010-07-15 15:38 55291. 首先进入svn 安装目录下找到 hooks 目录, ... -
Myeclipse 7.x/8.x 插件的安装和配置
2010-06-25 23:57 1683Myeclipse 7.x/8.x 插件的安装和配置 ... -
Proxool 连接池监控页面中文乱码异常的处理
2010-06-22 12:50 3988这几天, 在使用proxool监控连接池状态的时候, 偶然发现 ... -
小图片大尺寸预览实现代码
2010-06-11 18:35 2298<!DOCTYPE HTML PUBLIC " ... -
CSS 控制背景图片自动适应宽度和高度
2010-06-10 15:28 5317<!DOCTYPE html PUBLIC " ...
相关推荐
在分布式服务框架 Dubbo 中,异常处理是必不可少的一部分。Dubbo 提供了强大的异常处理机制,使得服务提供者能够向消费者传递自定义异常,从而帮助消费者更好地理解和处理服务调用中的错误情况。本文将深入探讨如何...
MySQL中的异常处理是数据库编程中不可或缺的一部分,它允许开发者预设对可能出现的错误或异常的响应,从而确保程序的稳定性和健壮性。在MySQL中,异常定义和处理主要是通过`DECLARE`语句来实现的。 1. **异常定义**...
* `try`、`catch` 和 `finally` 是 Java 异常处理的三个主要组成部分。 二、异常处理机制 * 异常是一种对象,继承自 `Throwable` 类。 * 异常处理的主要步骤是:抛出异常(throw) -> 捕捉异常(catch) -> 处理...
尽管提供的内容与异常处理直接相关的部分较少,但基于标题、描述以及部分上下文,我们可以深入探讨Java异常处理的相关概念。 ### Java异常概述 在Java编程语言中,异常处理是一项重要的机制,用于管理程序执行期间...
异常并不等同于错误,它是程序设计的一部分,允许我们优雅地处理错误,而不是让程序突然崩溃。 异常的概念: 1. 异常是一种事件,当它发生时,会中断正常的程序流程。这种事件可能是由于资源不足、非法操作、逻辑...
线程结构异常处理源码是易语言中处理这些异常的关键部分。当线程在执行过程中遇到问题,比如试图读取或写入无效的内存地址(SE保护内存读写异常),或者进行除以零的操作时,程序会触发一个异常。这种情况下,程序员...
对于C、C++以及基于MFC(Microsoft Foundation Classes)的开发来说,异常处理更是不可或缺的一部分。本篇文章将深入浅析C、C++中的异常处理机制以及MFC中的异常处理策略。 首先,我们来看C语言的异常处理。C语言...
finally块通常用于放置资源清理代码,无论是否发生异常,这部分代码都会被执行。 在Android中,我们可以使用全局的UncaughtExceptionHandler来捕获未被捕获的异常,这是系统默认的异常处理器。通过重写其handle...
7. 部分构造及 placement delete 8. 自动删除,类属 new 和 delete、placement new 和 placement delete 9. placement new 和 placement delete,及处理构造函数抛出的异常 10. 从私有子对象中产生的异常 11. 异常...
在Java Web开发中,异常处理是一项至关重要的任务,它确保了程序在遇到错误时能够优雅地处理并提供有用的反馈信息,而不是突然崩溃。本主题将深入探讨Java Web开发中的异常处理方式以及Aspect-Oriented Programming...
本资源是一个MATLAB源码集锦,专注于使用马氏距离来剔除异常样本。马氏距离是一种统计学上的概念,能够度量不同数据点之间的“距离”,尤其在考虑了数据的协方差结构之后,使其在处理多维数据时更加有效。下面将详细...
自定义异常是Java异常处理的一部分,允许我们创建符合特定业务需求的异常类。下面我们将深入探讨Java自定义异常及其应用。 首先,自定义异常通常是通过扩展Java内置的`Exception`类或其子类来实现的。`Exception`类...
声明异常情态需要在块的声明部分进行声明,在块的执行部分进行触发,在块的异常部分进行处理。例如: Declare e_toomanystudents exception; 用户定义类型异常情态需要程序员自己定义代码,对异常情况进行处理。...
在Java中,异常处理结构主要包括try、catch、finally和throw四个部分。try块用于包含可能抛出异常的代码,catch块用于捕获并处理异常,finally块通常用于放置资源清理代码,无论是否发生异常都会执行。throw关键字则...
RPCA的基本思想是将复杂的数据矩阵分解为两个部分:一个低秩矩阵L,代表正常或背景模式,另一个稀疏矩阵S,捕获离群值或异常行为。这种分解方法对噪声和缺失数据具有很强的鲁棒性,因此在异常检测中表现出色。 异常...
异常机制主要包含以下几个部分: 1. 异常概述:异常是程序在执行过程中发生的不正常情况,比如文件找不到、网络连接错误等。Java通过异常类来封装这些错误信息。异常对象包含了异常类型、描述信息以及异常发生时的...
在编程领域,异常处理是程序设计中的重要组成部分。异常(Exception)是程序运行时出现的错误情况,它中断了正常代码流程,提供了处理错误的机制。在Java、Python、C#等面向对象的语言中,异常处理是通过抛出(throw...
异常处理是嵌入式系统中至关重要的部分,特别是在基于ARM架构的系统中。本文将深入探讨ARM处理器的异常处理机制,包括异常类型、处理流程、异常优先级以及向量表等内容。 一、异常类型 ARM处理器支持多种类型的异常...
Java异常部分学习心得