java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy7 implem
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy7 implementing com.rs.common.core.service.SearchCriteria,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [pack.java.jsf.service.RequisitionBillCriteria] for property 'requisitionBillCriteria': no matching editors or conversion strategy found
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
java.security.AccessController.doPrivileged(Native Method)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:302)
org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
org.springframework.web.context.request.SessionScope.get(SessionScope.java:90)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
org.springframework.web.jsf.DelegatingVariableResolver.resolveSpringBean(DelegatingVariableResolver.java:138)
org.springframework.web.jsf.DelegatingVariableResolver.resolveVariable(DelegatingVariableResolver.java:111)
com.sun.faces.el.VariableResolverChainWrapper.getValue(VariableResolverChainWrapper.java:107)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
如果在Spring配置檔案中配置的事務是通過AOP標籤實現的,那就在中增加proxy-target-class=”true”屬性。就異常顯示的資訊可以看到,Spring在轉換時,主要是將代理類轉換成介面,反而不能轉換成實際類。
如果是通過bean方式增加事務控制,則在配置檔案中增加如下程式碼:(注意紅色部分)
解決方案:
<bean id="transaction" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:advice id="advice" transaction-manager="transaction"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="*" propagation="SUPPORTS" read-only="true"/> </tx:attributes> </tx:advice> <!--加入proxy-target-class="true" 即可,預設是false;--> <aop:config proxy-target-class="true"> <aop:pointcut id="cut" expression="execution(* pack.java.jsf.service.*.*(..))" /> <aop:advisor advice-ref="advice" pointcut-ref="cut" /> </aop:config>
即可.重啟伺服器..錯誤即可解決..
相關文章
- cannot convert (type interface {}) to type int: need type assertion
- Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseSer
- 解決java.lang.IllegalArgumentException: 'Content-Type' cannot contain wildcard type '*'異常(真實有效)...JavaExceptionAI
- Value Type vs Reference Type in SwiftSwift
- JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from StringJSONErrorJavaLDA
- The type List is not generic; it cannot …
- Cannot infer type arguments for PageImpl
- Golang Cannot use ss(type AAA) as type AAA in map indexGolangIndex
- Cannot set property ‘type‘ of null(vue)NullVue
- LOW_VALUE、HIGH_VALUE、ENDPOINT_VALUE轉換--UTL_RAW、DBMS_STATS.CONVERT_RAW_VALUE
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value forJavaExceptionAPPAI
- xxx cannot be resolved to a type
- Unable to convert MySQL date/time value to System.DateTimeMySql
- golang,interface轉換型別 cannot convert t (typGolang型別
- C# return dynamic/anonymous type value as function resultC#Function
- 從C++的Return Value Optimization (RVO)到C#的value type (轉)C++C#
- How to convert a numeric value or currency to English words using C#C#
- 解決 TypeError: Type aliases cannot be used with isinstance(). 辦法Error
- err Invalid input of type: 'dict'. Convert to a byte, string or number first
- 452 Error writing file: A file cannot be larger than the value set by ulimit.ErrorMIT
- 解決javax.servlet.jsp.JspException cannot be resolved to a typeJavaServletJSException
- Material type ROH cannot be used with item category L (plant T001)Go
- The type XXX cannot be resolved.It is indirectly referenced from required .classUI
- ORACLE utl_raw函式與dbms_stats.convert_raw_value函式使用Oracle函式
- a type "complete deletion of data target contents process cannot follow process" Excute Infopacakge
- 解決Tensorflow ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)ErrorAIObject
- eclipse中:The type java.lang.object cannot be resolved錯誤(jdk配置錯誤)EclipseJavaObjectJDK
- java.lang.IllegalArgumentException: Wrong state classsJavaException
- Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’None
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- AndroidStudio之自定義輸出包名報錯 Cannot set the value of read-only property 'outputFile' forAndroid
- Excel匯入資料異常Cannot get a text value from a numeric cell解決辦法Excel
- ora-30004:when using sys_connect_by_path function,cannot have seperator as part of column valueFunction
- tomcat使用cookies快取的時候中文報錯解決辦法 java.lang.IllegalArgumentException: Control character in cookie value or attribute.TomcatCookie快取JavaException
- variable: Type 與 Type variable
- java.lang.IllegalArgumentException at java.sql.Date.getHoursJavaExceptionSQL
- Caused by: java.lang.IllegalArgumentException: port out of range:-1JavaException
- BottomSheetBehavior之java.lang.IllegalArgumentException:TheviewisnotassociatedwithBottomSheetBehaviorJavaExceptionView