![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
解决错误
公众号Java3y
公众号:Java3y
展开
-
java: Multiple encodings set for module chunk test "GBK" will be used by compiler
IDEA 进行编译代码的时候,特别是新项目 特别容易出现 编码错误,但是 File-Encoding中设置的又没有问题,而且maven 是能打包的,就是用 idea 自带的 编译的时候 就会出现提示 找不到字符,错误开头会提示java: Multiple encodings set for module chunk test "GBK" will be used by compiler 但是转载 2017-03-08 16:29:02 · 627 阅读 · 0 评论 -
Could not execute JDBC batch update; SQL [delete from role where roleId=?]; constraint [null]; neste
今天在写多个删除功能的时候出现了这么一个错误:意思是删除操作的时候,没有找到对应的外键。Cannot delete or update a parent row: a foreign key constraint fails (`ssh03`.`role_privilege`, CONSTRAINT `FK45FBD628F05C38CB` FOREIGN KEY (`role_id`) REFE原创 2017-06-02 13:46:17 · 2762 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector
在使用C3P0连接池的时候,发现了这个错误….原来要使用C3P0的使用,不仅仅要导入c3p0-0.9.2-pre1.jar这个jar包,还要导入mchange-commons-0.2.jar这个jar包反正我用Oracle使用C3P0连接池就出现了这种情况!原创 2017-07-17 19:20:32 · 609 阅读 · 0 评论 -
org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably du
如果出现类似下面的错误,原因就是JDK版本太高了,我换成1.7就没事了Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported原创 2017-08-08 15:27:06 · 2273 阅读 · 0 评论 -
java.lang.IllegalArgumentException: Result Maps collection already contains value for
如果在SSM整合的时候出现以下的错误:留意一下是不是既在Mybatis配置文件中加载了映射文件,又在Spring配置文件中使用扫描式去加载映射文件了。两者是不能够重合使用的!Caused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\SSM\out\produc原创 2017-08-08 15:33:07 · 1042 阅读 · 0 评论 -
IDEA导入Eclipse项目 【未结束的注释、非法类型的开始、缺少符号】
如果我们导入Eclipse项目的使用出现了未结束的注释、非法类型的开始、缺少符号这么一些编译时期的错误,而我们的代码明明看起来就是正常的….我们去检查一下是否编码的问题:把FileEncoding全部改成是UTF-8试试,然后对IDEA进行重启,再次编译看看是否能通过…我就是这样解决了….原创 2017-08-04 14:59:28 · 591 阅读 · 0 评论 -
mysql不能插入中文数据
上次遇到的是向mysql插入中文数据,中文数据乱码了。这次直接就不能插入中文数据了!!!!参考博文:http://blog.csdn.net/generalyy0/article/details/7598027总结:①: 检查数据表所有字段的状态 show full columns from 表名; ②:发现Collation项非utf8,修改它! alter table 表名c转载 2017-03-08 16:55:22 · 2081 阅读 · 1 评论 -
idea下使用Maven找不到类
当我们配置好pom文件的时候,准备启动Tomcat,Tomcat缺报找不到类的错误..可是明明我们的pom文件是没有问题的,在web.xml中也是可以ctrl+鼠标左键把类找到…为啥就报这么一个错误呢??另我百思不得其解,我开始思考的是不是pom错了,可是折腾一番缺没发现错误…后来去找了相关的参考博文:参考博文1参考博文2我就尝试根据他们说讲的,把maven所依赖的jar包导入到我的web工程的l原创 2017-08-25 10:02:02 · 6173 阅读 · 1 评论 -
idea下使用autowire注解注入对象,结果初始化不到类
如果idea下使用autowire注解注入对象,结果初始化不到类,明明使用快捷键alt+insert是可以找到该注入的对象的。而我们在使用的时候,缺报错了???注意,当我们在注入对象的时候,我们留意在编辑面板上是否有对应的对象:如果没有这个标识的话,我们就查查我们是否把其他模块中的spring配置文件加载了。原创 2017-09-04 17:58:03 · 2720 阅读 · 0 评论 -
returned a response status of 403 OR 409
当我们使用jersy把图片上传到我们的图片服务器中【tomcat】,我们可能会有以下的错误:returned a response status of 403 OR 409403和409我都遇到过,不过都是把我们的配置文件修改成可写即可! <servlet> <servlet-name>default</servlet-name> <servlet-cla原创 2017-09-04 18:43:24 · 2293 阅读 · 0 评论 -
Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class
如果在使用SpringMVC中使用文件上传的MultipartFile对象时,出现了以下的错误:Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class那么就在参数前加入: @RequestParam注解即可…原因我也不知道,我明明在JSP页面的name原创 2017-09-04 17:55:02 · 661 阅读 · 0 评论 -
上传文件 返回值带 <pre style="word-wrap:break-word;white-space:prewrap;"></pre>
这次在上传的时候发现JSON返回的值是这样子的:而后台明明返回的是原生的JSON数据:{"realPath":"http://localhost:8081/file/upload/20170904190650266529.png","relativePath":"/upload/20170904190650266529.png"}在前端我们可以把无关的数据删除了,因此,解析的JSON代码如下:原创 2017-09-04 19:10:43 · 6443 阅读 · 2 评论 -
java.io.IOException: Stream closed
今天在做SSH项目的时候,出现了这个错误。百思不得其解,网上的答案都不能解决我的问题…..后来,一气之下就重新写,写了之后发现在JSP遍历集合的时候出错了。 <s:iterator value="rolePrivilegeSet"> <s:property value="#privilegeMap[compositeKey.code]"/> </原创 2017-05-31 12:45:33 · 2587 阅读 · 2 评论 -
Intellij idea插入表数据【在UI界面插入出错】
使用Intellij idea向数据库插入表数据的时候,如果该表是联合主键的,那么不能使用UI界面来进行插入……必须通过SQL语句才能插入……至于为什么?我也不知道….搞了大半天……想省时间不写SQL,结果插入不了数据…还以为是创建表的时候出错了…..原创 2017-04-25 20:12:20 · 1579 阅读 · 1 评论 -
java.lang.IllegalArgumentException: object is not an instance of declaring class
今天在使用反射的时候,出现了java.lang.IllegalArgumentException: object is not an instance of declaring class错误…具体是invoke()调用的时候 String returnFlag = (String) m.invoke(t, request, response);第一个参数应该是调用该方法的对象,而我粗心直接把C原创 2017-04-26 13:41:54 · 15061 阅读 · 0 评论 -
java.lang.RuntimeException: java.sql.SQLException: Too many parameters: expected 0, was given 1 Quer
如果出现类似这样的错误,检查一下是否sql语句和参数的位置对调了。java.lang.RuntimeException: java.sql.SQLException: Too many parameters: expected 0, was given 1 Query: 1 Parameters: [SELECT COUNT(*) FROM book WHERE category_id=?]原创 2017-04-14 22:55:04 · 5561 阅读 · 0 评论 -
Mysql中文乱码
在使用JDBC连接Mysql数据库,向Mysql数据库插入一条带有中文的记录,在查询的时候,发现全都是??????查询了一些资料,最简单的解决办法如下:①:设置当前库的编码 ALTER DATABASE zhongfucheng CHARACTER SET utf8;②:设置当前表的编码 ALTER TABLE customer CHARACTER SET ut原创 2017-02-27 09:35:42 · 339 阅读 · 0 评论 -
TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
今天在使用SSH框架做项目的时候出现了这个错误,找了我非常非常多的时间!!!!!!!Struts Problem ReportStruts has detected an unhandled exception: Messages: 1.Provided id of the wrong type for class zhongfucheng.user.entity.User. Expected:原创 2017-05-23 20:25:20 · 1119 阅读 · 0 评论 -
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zhongfucheng.user' does
编写第一个Hibernate程序的时候,就发现出现了错误Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not insert: [zhongfucheng.domain.User] at org.hibernate.exception.SQLStateConverter.conver原创 2017-05-06 11:15:55 · 1456 阅读 · 0 评论 -
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not a
如果出现了这个错误,看看在使用Hibernate的时候有没有在事务的环境下执行操作!原创 2017-05-15 19:31:38 · 548 阅读 · 0 评论 -
Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual tha
使用了数据库的关键字index,如果有类似的错误,看看自己有没有使用关键字!原创 2017-05-06 19:55:53 · 4050 阅读 · 0 评论 -
Exception in thread "main" org.hibernate.TransientObjectException: object references an unsaved tran
今天在使用一对多,多对一保存数据的时候出现了这个错误Hibernate错误:Exception in thread "main" org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing:原创 2017-05-06 20:57:17 · 323 阅读 · 0 评论 -
java.lang.IllegalArgumentException: node to traverse cannot be null!
查看HQL的语句是否写错了,是否有在From后面加空格。我就是没有加空格报了错误! return sessionFactory.getCurrentSession().createQuery("from " + " "+clazzName).list();原创 2017-05-16 20:25:19 · 203 阅读 · 0 评论 -
java.lang.NoSuchMethodException
今天做动态代理的时候,出现了java.lang.NoSuchMethodException错误…..主要是我使用method反射方法的时候,忘记把参数带上了,于是一直就出现这个错误……总结起来其实就是一句话:反射的时候要记得参数!!!!//反射真实具体方法的时候,要把参数带上!!!! Method method1 = t.getClass().getMethod(methodName,metho原创 2017-04-25 19:38:43 · 421 阅读 · 0 评论 -
eclipse复制到IDEA中文不匹配,编译失败
今天使用把eclipse的包复制到Intellij Idea下,结果在编译的时候,它说我的数据是GBK,而Idea默认的数据是UTF-8,因此出错了。。。解决:在项目中直接把对象的encoding.xml配置文件删除了就行了原创 2017-05-08 12:30:51 · 490 阅读 · 0 评论 -
Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root <cl
如果出现类似下面的错误:Exception in thread "main" org.hibernate.MappingException: You may only specify a cache for root <class> mappings at org.hibernate.cfg.Configuration.getRootClassMapping(Configuration.j原创 2017-05-08 17:31:02 · 338 阅读 · 0 评论 -
ajax中的suceess函数使用this
今天在写ajax的时候,后台返回数据给前台,可是总是不能把数据正常显示在页面上...明明已经进入了success函数了,并且在该代码的前后都能够正常执行.. success: function (responseTest) { if (responseTest == "no") { alert("进来no");原创 2017-09-04 21:08:43 · 479 阅读 · 0 评论