Menu ▾ ▴

#1 ClassCastException in HibernateConfigurer

open
nobody
None
8
2007-07-26
2007-07-26
No

I used HSE in conjunction with Spring 2.0.5 and encountered a CCE in HibernateConfigurer (line 75).
It is assumed there that SpringPropertyHelper#getList(BeanDefinition, String, String) does yield a list of String. Though, I found that an instance of org.springframework.beans.factory.config.TypedstringValue has been returned.

Discussion

  • Andreas Senft

    Andreas Senft - 2007-07-26
    • priority: 5 --> 8
     
  • Aly González

    Aly González - 2010-03-21

    IN HibernatConfigure.JAVA CHANGE THIS

    Pattern pattern = Pattern.compile((String)matchIterator.next());

    FOR THIS:

    String stringPattern ;
    Object item = matchIterator.next();
    try {
    stringPattern = (String)item; // Spring 1.2
    }
    catch(Exception e){
    TypedStringValue typedStringValue = (TypedStringValue)item; // Spring 1.2+
    stringPattern = typedStringValue.getValue();
    }
    Pattern pattern = Pattern.compile(stringPattern);

     

Log in to post a comment.