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
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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

    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