`
热开水
  • 浏览: 70340 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类

将我学习的东西做一下总结

阅读更多
1 Cannot find class [ com.qj.example.service.impl.energyManagementServiceimpl] for bean with name 'energyManagementService' defined in class path resource [beans_energy_service.xml]; nested exception is java.lang.ClassNotFoundException:  com.qj.example.service.impl.energyManagementServiceimpl

解决的方法是:因为多了一个空格。

2 Invalid property 'energyQuery' of bean class [com.qj.example.service.impl.energyManagementServiceimpl]: Bean property 'energyQuery' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

解決:沒有給他set和get方法。

3 Caused by: org.hibernate.hql.ast.QuerySyntaxException: energy is not mapped [select count(*) from com.qj.example.model.RelationUserMeter rum, energy e,operators o where rum.operatorId=e.operatorId and e.operatorId=o.operatorId]

解決的方法是:沒有用到类 而是用的是表


4 Exception in thread "main" java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!
Hibernate出现的变态数据:解决的方案是:问题发生的原因是:hql语句里不需要参数,却添加了一个参数,删掉添加参数的语句就可以了!

5  严重: line 1:183: unexpected token: en
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover(Lantlr/RecognitionException;Lantlr/collections/impl/BitSet;)V

解决;在进行多条件查询的时候出的错。有可能含有空值的。原来我写的and之前少写了个空格。

6  严重: Could not find action or result
There is no Action mapped for action name getEnergyModes. - [unknown location]
解决:原来是把strus.xml中没有写路径。



7java.lang.NoSuchMethodException: com.qj.example.action.HubManageAction.getEnergyModes()
解决;类中没有这个方法:


8 Exception in thread "main" org.springframework.orm.hibernate3.HibernateQueryException: Expected positional parameter count: 1, actual parameters: [] [select count(*) from RelationUserMeter rum, Energy en,Operators o where rum.operatorId=en.operatorId and en.operatorId=o.operatorId and en.cashLeft<=?]; nested exception is org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [select count(*) from RelationUserMeter rum, Energy en,Operators o where rum.operatorId=en.operatorId and en.operatorId=o.operatorId and en.cashLeft<=?]
问题:有一个参数需要指定。

9 严重: Conversion registration error
java.lang.ClassNotFoundException: com.qj.example.tools.DateConverter

解决:找不到注册的类。局部注册和全局的注册。有时候写的注册的时候空格也会影响它会找不到。所需要的类。
10 class not found [括号中的是找不到的类] D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\energy\WEB-INF\classes\struts.xml

解决的方案:是将D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina路径下

11 energy is not mapped [select o.operatorId,o.name,e.name,e.energyLeft,e.cashLeft from energy e,operators o where o.operatorId=e.operatorId and e.operatorId=?]

解决:找不到,对应的map  那么就是表没有换成对象。

12  There is no Action mapped for namespace / and action name getPersonEnery. - [unknown location]
java.lang.NoSuchMethodException: com.qj.example.action.energyManagementAction.getPersonEngry()


解决struts2的action中写的方法有参数了

13 org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: com.qj.example.model.Energy; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: com.qj.example.model.Energy

这个异常产生的主要原因是DAO采用了Spring容器的事务管理策略,如果操作方法的名称和事务策略中指定的被管理的名称不能够匹配上,spring 就会采取默认的事务管理策略(PROPAGATION_REQUIRED,read only).如果是插入和修改操作,就不被允许的,所以包这个异常


原因是我操作的是游离态的对象,根本就没有获得本省的对象,要load、原来的,才能修改。要更更新的主键还没有传过去。没有找到要更改的用户信息。

14  Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
   解决:批量更新实际为0  应该为一  是因为写的Object[]对象与数据的传递不是一样的

15 我放在lib下的jar 包不被认可 
解决:你需要手工把这些jar加到Eclipse的Build Path中。
3 【metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\t does not exist or is not a readable directory 】该问题是WEB项目作了不恰当的重命名相关文件夹,或则误删除某些目录又重新创建后导致eclipse无法在使用热部署时候自动同步相关配置。


16 想想韩老师解决问题的方式,方法我学到的:
      1 查东西的时候如果是导入的类的异常  我们可以直接是将类名 异常 例如: javamail 异常。
      2 serivece中的一个方法可以有多个dao的调用。Dao中也可以有调用多个对象。Action中也可以调用多个service  这是一个方法中可以有多个调用的东西。并不是有一个方法中只是调用一个。
      3 还没有从他那里学到  如何利用英文的页面解决问题。
17 org.hibernate.PropertyValueException: not-null property references a null or transient value: com.qj.example.model.Energy.name
注意:原来始终是有一个值是获得不了的,就是Double让我写成了double
在action中必须要写成所有的都是类 如果有double或者是int的 就不行了。

18 No result defined for action com.qj.example.action.EneryPersonUpdateAction and result input - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/energy/WEB-INF/classes/struts.xml:55:96


解决告诉没有找到要返回的result  说明返回的是不正确的  他要找input


注意如果s:iterator中的值做为条件不是利用超链接的形式传递过去的,而是作为表单的一部分的时候,那么<s:hidden name="operatorId" required="operatorId">  只要有一个required就可以了,如果加了values就不行了,直接只是有required就ok了
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics