javax.servlet.jsp.el.ELException: Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type

Spring JIRA | Alex Savitsky | 1 decade ago
  1. 0

    This bug happens when trying to inject a Spring bean into a JSF one, like this: <managed-bean> <managed-bean-name>regionList</managed-bean-name> <managed-bean-class> com.tdsecurities.app.view.RegionListBackingBean </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>persistenceService</property-name> <value>${persistenceService}</value> </managed-property> </managed-bean> In DelegatingVariableResolver.resolveVariable(), it first delegates to the original resolver (in my case, it's Apache MyFaces 1.1.3): Object originalResult = getOriginalVariableResolver().resolveVariable(facesContext, name); if (originalResult != null) { return originalResult; } However, since the JSF bean definition being passed to the MyFaces resolver is not a "normal" one, but contains a reference to a Spring bean, the MyFaces resolver throws an exception, claiming it cannot convert a String into the bean's property type: javax.servlet.jsp.el.ELException: Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type at org.apache.commons.el.Logger.logError(Logger.java:481) at org.apache.commons.el.Logger.logError(Logger.java:498) at org.apache.commons.el.Logger.logError(Logger.java:566) at org.apache.commons.el.Coercions.coerceToObject(Coercions.java:769) at org.apache.commons.el.Coercions.coerce(Coercions.java:343) at org.apache.myfaces.shared_impl.util.ClassUtils.convertToType(ClassUtils.java:301) at org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(ManagedBeanBuilder.java:189) at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:56) at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311) ... etc. Now, I'm not sure whether it's a MyFaces problem or not (the exception is legitimate, however, I'm not sure whether the spec allows exceptions in this case or not) - but in any case, wouldn't it be helpful to build some additional safeguards for such a case in DelegatingVariableResolver.resolveVariable() ?

    Spring JIRA | 1 decade ago | Alex Savitsky
    javax.servlet.jsp.el.ELException: Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type
  2. 0

    This bug happens when trying to inject a Spring bean into a JSF one, like this: <managed-bean> <managed-bean-name>regionList</managed-bean-name> <managed-bean-class> com.tdsecurities.app.view.RegionListBackingBean </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>persistenceService</property-name> <value>${persistenceService}</value> </managed-property> </managed-bean> In DelegatingVariableResolver.resolveVariable(), it first delegates to the original resolver (in my case, it's Apache MyFaces 1.1.3): Object originalResult = getOriginalVariableResolver().resolveVariable(facesContext, name); if (originalResult != null) { return originalResult; } However, since the JSF bean definition being passed to the MyFaces resolver is not a "normal" one, but contains a reference to a Spring bean, the MyFaces resolver throws an exception, claiming it cannot convert a String into the bean's property type: javax.servlet.jsp.el.ELException: Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type at org.apache.commons.el.Logger.logError(Logger.java:481) at org.apache.commons.el.Logger.logError(Logger.java:498) at org.apache.commons.el.Logger.logError(Logger.java:566) at org.apache.commons.el.Coercions.coerceToObject(Coercions.java:769) at org.apache.commons.el.Coercions.coerce(Coercions.java:343) at org.apache.myfaces.shared_impl.util.ClassUtils.convertToType(ClassUtils.java:301) at org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(ManagedBeanBuilder.java:189) at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:56) at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311) ... etc. Now, I'm not sure whether it's a MyFaces problem or not (the exception is legitimate, however, I'm not sure whether the spec allows exceptions in this case or not) - but in any case, wouldn't it be helpful to build some additional safeguards for such a case in DelegatingVariableResolver.resolveVariable() ?

    Spring JIRA | 1 decade ago | Alex Savitsky
    javax.servlet.jsp.el.ELException: Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type
  3. 0

    jstl reformat date exception

    Coderanch | 9 years ago | Shilpa Tendulkar
    javax.servlet.jsp.el.ELException: Attempt to convert String "2007-08-13" to type "java.util.Date", but there is no PropertyEditor for that type
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Tomcat 5 compiles jsp with wrong argument type for a tag on a Mac OSX

    Coderanch | 5 years ago | Jimi Brankenberg
    javax.servlet.jsp.el.ELException: Attempt to coerce a value of type "neo.xredsys.presentation.PresentationArticleImpl" to type "neo.xredsys.api.Article"
  6. 0

    Oozie EL function: An exception occured trying to convert String to type "java.lang.Double"

    Stack Overflow | 2 years ago
    javax.servlet.jsp.el.ELException: An exception occured trying to convert String "hdfs://nameNode:8020" to type "java.lang.Double"

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.servlet.jsp.el.ELException

      Attempt to convert String "${persistenceService}" to type "com.tdsecurities.common.persistence.IPersistenceService", but there is no PropertyEditor for that type

      at org.apache.commons.el.Logger.logError()
    2. EL
      Coercions.coerce
      1. org.apache.commons.el.Logger.logError(Logger.java:481)
      2. org.apache.commons.el.Logger.logError(Logger.java:498)
      3. org.apache.commons.el.Logger.logError(Logger.java:566)
      4. org.apache.commons.el.Coercions.coerceToObject(Coercions.java:769)
      5. org.apache.commons.el.Coercions.coerce(Coercions.java:343)
      5 frames
    3. Impl
      VariableResolverImpl.resolveVariable
      1. org.apache.myfaces.shared_impl.util.ClassUtils.convertToType(ClassUtils.java:301)
      2. org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(ManagedBeanBuilder.java:189)
      3. org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:56)
      4. org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311)
      4 frames