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
- 解決java.lang.IllegalArgumentException: 'Content-Type' cannot contain wildcard type '*'異常(真實有效)...JavaExceptionAI
- JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from StringJSONErrorJavaLDA
- xxx cannot be resolved to a type
- C# convert sql blob type to plain stringC#SQLAI
- Cannot set property ‘type‘ of null(vue)NullVue
- cannot access local variable where it is not associated with a value
- golang,interface轉換型別 cannot convert t (typGolang型別
- err Invalid input of type: 'dict'. Convert to a byte, string or number first
- 解決javax.servlet.jsp.JspException cannot be resolved to a typeJavaServletJSException
- 解決 TypeError: Type aliases cannot be used with isinstance(). 辦法Error
- vue Cannot find module @/xxx/xxx.ts or its corresponding typeVue
- 解決Tensorflow ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)ErrorAIObject
- [Vue warn]: Invalid prop: type check failed for prop "unlinkPanels". Expected Boolean, got String with value "true".VueAIBooleanGo
- eclipse中:The type java.lang.object cannot be resolved錯誤(jdk配置錯誤)EclipseJavaObjectJDK
- python 報錯:raise IllegalCharacterError(f"{value} cannot be used in worksheets.") openpyxl.utils.exceptions.IllegalCharacterErrorPythonAIErrorException
- 7.60 CONVERT
- SpringBoot升級到3.2.0報錯Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.StringSpring BootBeanObjectJava
- ] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin Cannot instantiate object of typeAIGoMyBatisMavenPluginObject
- AndroidStudio之自定義輸出包名報錯 Cannot set the value of read-only property 'outputFile' forAndroid
- Java更新資料庫報錯:Data truncation: Cannot create a JSON value from a string with CHARACTER SETJava資料庫JSON
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- Excel匯入資料異常Cannot get a text value from a numeric cell解決辦法Excel
- Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’None
- webstorm vue3+ts報錯:Cannot find module ‘@/views/xxx.vue‘ or its corresponding type declarationsWebORMVueView
- 解決:java.lang.IllegalArgumentException: String must not be emptyJavaException
- java.lang.IllegalArgumentException at java.sql.Date.getHoursJavaExceptionSQL
- Bug:java.lang.IllegalArgumentException: unknown document format for file:JavaExceptionORM
- Caused by: java.lang.IllegalArgumentException: port out of range:-1JavaException
- PHP 每日一函式 — 字串函式 convert_uuencode () & convert_uudecode ()PHP函式字串
- Python convert string to unicode numberPythonUnicode
- [Linux] convert .img to .iso fileLinux
- DocTo convert doc(x) to pdf
- Convert型別轉換型別
- How to Convert a Class File to a Ja
- Caused by: java.lang.IllegalArgumentException: Unable to instantiate SparkSession with Hive supportJavaExceptionSparkSessionHive
- PIL.Image convert to numpy array
- 淺析Convert,Parse和TryParse
- matlab convert to PGM P2Matlab