You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-dev@portals.apache.org by "Woonsan Ko (JIRA)" <br...@portals.apache.org> on 2007/08/01 12:16:53 UTC

[jira] Updated: (PB-72) ClassCastException in PortletApplicationModelImpl since Spring Framework 2.0.5

     [ https://issues.apache.org/jira/browse/PB-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Woonsan Ko updated PB-72:
-------------------------

    Attachment: pamodel-diff.txt

This problem occurs after Spring Framework was upgraded to 2.0.5.
Since Spring Framework 2.0.3, the value of PropertyValue from BeanDefinition is changed from value object to TypedStringValue object. ( See http://springframework.cvs.sourceforge.net/springframework/spring/src/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java?r1=1.27&r2=1.28 )

Also, according to javadoc of SpringFramework for org.springframework.beans.PropertyValue, it says:
    "Note that type conversion will not have occurred here. It is the responsibility of the BeanWrapper implementation to perform type conversion."

The default implementation of BeanWrapper of Spring Framework uses o.sf.factory.config.BeanDefinitionVisitor, which checks if the attribute value is instance of TypedStringValue or instance of String.
Therefore, PortletApplicationModelImpl should use this technique also.

I'm attaching a patch for this after testing.

> ClassCastException in PortletApplicationModelImpl since Spring Framework 2.0.5
> ------------------------------------------------------------------------------
>
>                 Key: PB-72
>                 URL: https://issues.apache.org/jira/browse/PB-72
>             Project: Portals Bridges
>          Issue Type: Bug
>          Components: frameworks
>    Affects Versions: 1.0.3
>            Reporter: Woonsan Ko
>             Fix For: 1.0.4
>
>         Attachments: pamodel-diff.txt
>
>
> The following lines in o.a.p.b.frameworks.spring.PortletApplicationModelImpl has throws ClassCastException:
> PropertyValue value = bd.getPropertyValues().getPropertyValue("lookupKey");
> if (value != null)
> {
>     lookup = (String)value.getValue();         // ClassCastException here: getValue does not return String object any more.
>     // ...
> }
> I found this problem when I tried to integrate a customized j2-admin's PortalSiteDetails portlet with Jetspeed-2.1.2.
> The portlet is customized from the old j2-admin::SiteDetailsPortlet, which is out-of-date in Jetspeed-2.1.2.
> Anyway, this problem can occur when a portlet utilizes framework bridge.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org