Home Bug Reports

Ice 3.5.1 java client needs user factory to instantiate class with no operations

rowanwrowanw Member Rowan WorthOrganization: DownUnder GeosolutionsProject: Abstraction layer for multiple data sources
Hi,

I have a slice definition like:
module Samples {
    sequence<float> FloatArray;

    class OrderedSequence {
    };

    /* a numeric sequence with a regular interval */
    class RegularSequence extends OrderedSequence {
        float min;
        float max;
        float step;
    };

    /* a numeric sequence with arbitrary intervals */
    class SampledSequence extends OrderedSequence {
        FloatArray samples;
    };

    /* a series of 'y' samples, measured along some sequence 'x' */
    struct Samples {
        OrderedSequence x;
        FloatArray y;
    };

    interface Graph {
        Samples getSamples(int id);
    };
}

When my java client calls getSamples(), ICE bails with a message like "compact format prevents slicing (the sender should use the sliced format instead)".

Eventually I figured out what that meant and added ["format:sliced"] to the getSamples operation, only to have ICE bail with NoObjectFactoryException.

If I register an ObjectFactory with the client's Communicator for the RegularSequence/SampledSequence types everything works.

The documentation suggests that the runtime should be able to instantiate this class without my intervention, since my classes do not define any operations -- yes?

Observed with both C++ and C# servers. Sorry I don't have concrete code to reproduce, already spent too much time tracking this down.

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Are you using the
    java:package
    
    metadata for your Slice definitions? If you do, you need to configure the appropriate
    Ice.Package.<module>=<package>
    
    property. See Package Configuration Properties for more information on this configuration property.

    Without this property, Ice can't figure out the package where the classes were generated. The message you get from the exception is a bit mis-leading, we'll look into improving it for the next release!

    Cheers,
    Benoit.
  • rowanwrowanw Member Rowan WorthOrganization: DownUnder GeosolutionsProject: Abstraction layer for multiple data sources
    Ah! Yes, I am using java:package, and setting Ice.Package.<module> does the trick. Sorry I failed to mention that detail initially.

    Thanks for the quick response Benoit!
    -Rowan
Sign In or Register to comment.