Hi all,
the ASO works fine if I instantiate it myself like

@ApplicationState
private SimpleSearchString simpleSearchString = new SimpleSearchString();

Without that the ApplicationStateHandler's "object" property is null and
this strange class cast exception is thrown.

From the docs I thought that this instantiation should not be necessary?

Regards,
Otho


2007/6/23, Otho <[EMAIL PROTECTED]>:

Hi all!
Was there a solution to this really strange ClassCastException already?

I have the same problem in the following circumstances:

public class Search extends BaseComponent
{
    @Component
    private Form simpleSearch;

    @ApplicationState
    private SimpleSearchString simpleSearchString;

    private String searchTerm; // wil be populated by the form;

    /* Form Handler */

    String onSuccess()
    {
        if (searchTerm == null)
            return null;


>>>>        getSimpleSearchString().setSearchTerm(searchTerm);
        return "ExtendedSearch";
    }

    public SimpleSearchString getSimpleSearchString()
    {
        return simpleSearchString;
    }

>>>> This line gives the following stacktrace

java.lang.ClassCastException myapp.state.SimpleSearchString cannot be cast
to myapp.state.SimpleSearchString
Stack trace

   - myapp.components.search.Search._$read_simpleSearchString(
   Search.java)
   - myapp.components.search.Search.getSimpleSearchString(Search.java
   :79)
   - myapp.components.search.Search.onSuccess (Search.java:53)
   - myapp.components.search.Search.handleComponentEvent(Search.java)


This happens regardless of if I access simpleSearchString directly or with
the getter.
Any idead what causes this somewhat puzzling behaviour?

Regards,
Otho

Reply via email to