Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console crashes when strategy is initialized via Spring bean #22

Closed
arsenaid opened this issue Oct 9, 2014 · 3 comments
Closed

Console crashes when strategy is initialized via Spring bean #22

arsenaid opened this issue Oct 9, 2014 · 3 comments
Assignees

Comments

@arsenaid
Copy link

arsenaid commented Oct 9, 2014

ConsoleServlet generates exception on renderPage method when a custom strategy is configured as Spring bean.
Attached is the screenshot.
2014-10-09_14-33-28

Here is my config in Spring xml:

<bean id="ff4j" class="org.ff4j.FF4j" >
    <property name="store" ref="ff4j.store.inmemory" />
</bean>
<bean id="ff4j.store.inmemory" class="org.ff4j.store.InMemoryFeatureStore" >
    <constructor-arg type="java.util.Map">
        <map key-type="java.lang.String" value-type="org.ff4j.core.Feature">
            <entry key="myFeature" value-ref="myFeatureRef/>
        </map>
    </constructor-arg>
</bean>
<bean id="myFeatureRef class="org.ff4j.core.Feature">
    <constructor-arg name="uid" value="myFeature"/>
    <property name="enable" value="true"/>
    <property name="description" value="Feature description"/>
    <property name="flippingStrategy" ref="myReleaseStrategy"/>
    <property name="group" value="myFeatureGroup"/>
</bean>
<bean id="myReleaseStrategy" class="com.mycompany.feature.ReleaseDateFlipStrategy">
    <constructor-arg type="java.lang.String" value="${effectiveDate}"/>
</bean>
@clun
Copy link
Collaborator

clun commented Oct 10, 2014

I do not reproduce the problem. I create a new project with your sample, it's available here and working :
https://github.com/clun/ff4j-extra/tree/master/ff4j-samples/ff4j-arsenaid
Could you try ?

This kind of error occurs when a "replaceall" met some '$' character.
Do you register your propertyPlaceholder bean in you context ?

@clun clun added the invalid label Oct 10, 2014
@clun clun added this to the Issuer Investigate milestone Oct 10, 2014
@clun clun self-assigned this Oct 10, 2014
@arsenaid
Copy link
Author

Yes, I use propertyPlaceholder bean. Here is a sample:

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreResourceNotFound" value="true" /> <property name="locations"> <list> <value>classpath*:MyConfig.properties</value> </list> </property> </bean>

My class name will be a proxy class created by CGlib, so the name is appended with $$EnhancerByCGLIB$$68801926 suffix which causes the problem. Once it's escaped it loads up fine.

@clun
Copy link
Collaborator

clun commented Jan 4, 2015

I escape the '$' caracters during rendition of rows so that next replaceAll do not failed. Will be available for next imminent release.

@clun clun closed this as completed Jan 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants