Results 1 to 5 of 5

Thread: IceRuby: Ice::ObjectPrx arguments bug?

  1. #1
    ctennis is offline Registered User
    Name: Caleb Tennis
    Organization: AEI
    Project: Project GINA
    Join Date
    Mar 2006
    Posts
    123

    IceRuby: Ice::ObjectPrx arguments bug?

    I have a server with a definition like this:

    Code:
      interface IndicatorBase {
         void setForwardingProxy(Object* proxy);
      };
    From a Ruby, if I establish a connection to the IndicatorBase and attempt to pass an Ice::ObjectPrx as the argument, I get this error:

    Code:
    >> t1.setForwardingProxy( $ic.stringToProxy("Foo") )
    NameError: uninitialized constant Ice::ObjectPrx::ICE_TYPE
            from (eval):657:in `invoke'
            from (eval):657:in `setForwardingProxy'
            from (irb):12
    ($ic is my Ice::Communicator instance)



    Note that it works fine if I pass a derived type:

    Code:
    >> t1.setForwardingProxy( $cs )
    => nil
    >> $cs.class
    => Gina::DerivedClassPrx
    I downgraded to 3.2.0 to see it might be a regression, but I get the same thing in both 3.2.0 and 3.2.1 IceRuby.

    Thanks!
    Last edited by ctennis; 08-24-2007 at 04:33 PM.
    Caleb Tennis
    Analytical Engineering, Inc.
    http://www.aei-tech.com
    Project: Our facility infrastructure heavily utilizes Ice

    Gentoo ebuild maintainer for Ice, IceRuby, etc.

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    I tried to duplicate your problem with the hello demo and I cannot. However, this is with the Ice current mainline not the 3.2.1 version. What I did was add to the hello interface

    Code:
    void foo(Object* proxy);
    And an implementation that printed the proxy. Then I put near the start of the demo/Ice/hello/Client.rb:

    Code:
            o = Ice::Application::communicator().stringToProxy('foo:tcp -p 10000')
            puts o
            twoway.foo(o)
    This worked as expected. Can you post a complete test case that demonstrates your error please? Also what platform are you using?

  3. #3
    ctennis is offline Registered User
    Name: Caleb Tennis
    Organization: AEI
    Project: Project GINA
    Join Date
    Mar 2006
    Posts
    123
    Thanks for the response, Matthew. This is on Linux, and Ice and IceRuby are basically self compiled.

    I did what you did, adding the foo method to the hello demo, and started the server (after adding the necessary implementation methods for foo(), of course). When I add those lines to the Client.rb client and run it, I get:

    Code:
    foo -t:tcp -h 127.0.0.1 -p 10000
    foo -t:tcp -h 127.0.0.1 -p 10000
    #<NameError: uninitialized constant Ice::ObjectPrx::ICE_TYPE>
    (eval):61:in `invoke'
    (eval):61:in `foo'
    Client.rb:64:in `run'
    /usr/lib/ruby/site_ruby/1.8/Ice.rb:234:in `main'
    Client.rb:168
    Where Hello.ice is:

    Code:
    module Demo
    {
    
    interface Hello
    {
        void foo(Object* prx);
        ["cpp:const"] idempotent void sayHello(int delay);
        void shutdown();
    };
    
    };
    and here are the lines I added to Client.rb starting at line 62:

    Code:
            o = Ice::Application::communicator().stringToProxy("foo:tcp -p 10000")
            puts o
            twoway.foo(o)
    Let me know if I can provide any more information.

    Thanks,
    Caleb
    Caleb Tennis
    Analytical Engineering, Inc.
    http://www.aei-tech.com
    Project: Our facility infrastructure heavily utilizes Ice

    Gentoo ebuild maintainer for Ice, IceRuby, etc.

  4. #4
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    I've verified this bug. Please apply the following patch to ruby/Ice.rb in the distribution. That should sort out your problem.

    Code:
    index 9ee3d44..d904eca 100644
    --- a/rb/ruby/Ice.rb
    +++ b/rb/ruby/Ice.rb
    @@ -43,7 +43,10 @@ module Ice
         end
     
         T_Object.defineClass(nil, true, nil, [], [])
    +    Object_mixin::ICE_TYPE = T_Object
    +
         T_ObjectPrx.defineProxy(ObjectPrx, T_Object)
    +    ObjectPrx::ICE_TYPE = T_ObjectPrx
     
         #
         # LocalObject.

  5. #5
    ctennis is offline Registered User
    Name: Caleb Tennis
    Organization: AEI
    Project: Project GINA
    Join Date
    Mar 2006
    Posts
    123
    Thanks, Matthew. I can confirm this does indeed fix the issue.

    Caleb
    Caleb Tennis
    Analytical Engineering, Inc.
    http://www.aei-tech.com
    Project: Our facility infrastructure heavily utilizes Ice

    Gentoo ebuild maintainer for Ice, IceRuby, etc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. AMD callback - using arguments after ice_response()
    By Andrew S in forum Help Center
    Replies: 4
    Last Post: 01-15-2009, 04:23 AM
  2. How to get the arguments of remote method ?
    By pinusmugo in forum Help Center
    Replies: 1
    Last Post: 10-15-2008, 09:12 AM
  3. IceRuby bug with propertyToProxy
    By ctennis in forum Bug Reports
    Replies: 2
    Last Post: 03-21-2007, 02:50 PM
  4. using Ice::ObjectPrx as a slice datatype
    By gumshoe in forum Help Center
    Replies: 1
    Last Post: 01-29-2007, 05:35 PM
  5. Possible IceRuby bug?
    By jesse@mind.net in forum Bug Reports
    Replies: 2
    Last Post: 01-04-2007, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •