Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2007
ctennis ctennis is offline
Registered User
 
Name: Caleb Tennis
Organization: AEI
Project: Project GINA
 
Join Date: Mar 2006
Posts: 120
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!
__________________
Caleb Tennis
Analytical Engineering, Inc.
http://www.aei-tech.com
Project: Our facility infrastructure heavily utilizes Ice

Gentoo ebuild maintainer for Ice, IceRuby, etc.

Last edited by ctennis : 08-24-2007 at 05:33 PM.
Reply With Quote
  #2 (permalink)  
Old 08-25-2007
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,055
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?
Reply With Quote
  #3 (permalink)  
Old 08-25-2007
ctennis ctennis is offline
Registered User
 
Name: Caleb Tennis
Organization: AEI
Project: Project GINA
 
Join Date: Mar 2006
Posts: 120
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.
Reply With Quote
  #4 (permalink)  
Old 08-27-2007
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,055
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.
Reply With Quote
  #5 (permalink)  
Old 08-27-2007
ctennis ctennis is offline
Registered User
 
Name: Caleb Tennis
Organization: AEI
Project: Project GINA
 
Join Date: Mar 2006
Posts: 120
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
IceRuby bug with propertyToProxy ctennis Bug Reports 2 03-21-2007 03:50 PM
using Ice::ObjectPrx as a slice datatype gumshoe Help Center 1 01-29-2007 06:35 PM
Possible IceRuby bug? jesse@mind.net Bug Reports 2 01-04-2007 05:55 PM
generated C# classes don't have constructors with arguments for fields kovacm Bug Reports 1 08-07-2005 08:00 PM
Adding ProxyToString to ObjectPrx DeepDiver Comments 6 07-21-2005 04:50 AM


All times are GMT -4. The time now is 08:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.