Forum Discussion

harryulrich's avatar
harryulrich
New Contributor
16 years ago

Issue with Java enums and AMF

I am having an issue sending a complex AMF request.  I need to send a model object that contains an enum type.  I am getting a flex messaging error stating that the enum must have a no args constructor.  Naturally this all works fine from Flex and BlazeDS, did I miss a setting or an option.
  • Hi,

    can you send your project file here , and also error log stack trace so we can try to help you out

    regards
    nebojsa
    eviware.com
  • Hi,

    seems that there is no setStatus method in your SudentDTO class but setModelStatus.
    So , I think that is typing error .

    Change your line in groovy script

    student.setStatus(status); // instead of this

    student.setModelStatus( status);// use this



    hope that helps

    regards
    nebojsa
    eviware.com
  • Hi

    I have an issue with enums when invoking a AMF service via SOAPUI 3.5.1

    I get the following error message

    11:42:56,080 INFO [STDOUT] [BlazeDS]Unable to create a new instance of type 'com...EnumType'.
    flex.messaging.MessageException: Unable to create a new instance of type 'com...EnumType'. Types cannot be instantiated without a public, no arguments constructor.

    Here is an the enum definition

    INTRODUCTION("INTRODUCTION", "Introduction stage")

    This works when invoked via the flex client.

    Did anyone encounter this issue previously?

    Thanks,
    Ollie
  • chumster's avatar
    chumster
    Occasional Contributor
    I am seeing the same issue. I assume this issue was never resolved. If so, it's a complete blocker for me, ugh.
  • Hi All,

    Did anyone find a solution to this issue ? Like it was mentioned above - it's a blocker for testing invocations with complext objects having enum variables.

    Best Regards,
  • cadiolis wrote:
    I was able to get this working using this reference: https://bugs.adobe.com/jira/browse/BLZ-17

    Basically download EnumProxy.java, then use the following code which will register all enums
    static {
    PropertyProxyRegistry.getRegistry().register(Enum.class, new EnumProxy());
    }

    Please, tell me, where should I put this code ? Onto the server somewhere or into SoapUI somewhere ?