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.energyManagementS erviceimpl 解决的方法是:因为多了一个空格。 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/collecti ons/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\W EB-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.getPerson