Results 1 to 5 of 5

Thread: Probleme with the demo\IceGrid for python

  1. #1
    Gilles is offline Registered User
    Name: Gilles LINDECKER
    Organization: ISIS MPP
    Project: Systeam (tests benches software)
    Join Date
    Oct 2008
    Posts
    10

    Probleme with the demo\IceGrid for python

    Hi,

    I have several problemes:
    * I don't have IceGrid.py, but I don't need if I import ice.py. I don't understand.
    * I don't try to connect with the next instruction (except error), but If I use the sample example in C++, I don't have any problem, I see to the IceGrid Admin my connection.
    registry = ceGrid.RegistryPrx.checkedCast(communicator.string ToProxy("DemoIceGrid/Registry"))

    thanks,

  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'm sorry, but I don't understand what problems you are having...

    Hi,

    I have several problemes:
    * I don't have IceGrid.py, but I don't need if I import ice.py. I don't understand.
    What do you mean you dont have IceGrid.py? It should be part of the Ice 3.3 distribution. As to the second part of your question, you only need IceGrid.py if you are using the IceGrid definitions (for example, IceGrid.Query). Are you using that?

    * I don't try to connect with the next instruction (except error), but If I use the sample example in C++, I don't have any problem, I see to the IceGrid Admin my connection.
    registry = ceGrid.RegistryPrx.checkedCast(communicator.string ToProxy("DemoIceGrid/Registry"))

    thanks,
    What exactly are you trying to do? Without more information it is hard to guess... Sample code would be good.

  3. #3
    Gilles is offline Registered User
    Name: Gilles LINDECKER
    Organization: ISIS MPP
    Project: Systeam (tests benches software)
    Join Date
    Oct 2008
    Posts
    10

    Thumbs up

    I want to use Icegrid to run my server with my client application.
    I use :
    icegridnode --Ice.Config=config.grid
    icegridadmin --Ice.Config=config.grid -e "application add 'application.xml'"


    For my problems

    I have ICE 3.3.0 and I don't have Icegrid.py, but I have the follow files:
    IceGrid_Query_ice.py
    IceGrid_Registry_ice.py
    IceGrid_Session_ice.py
    ....

    When I run the sample demo\IceGrid\simple\client.py I have a error, icegrid.py not found.

    #!/usr/bin/env python
    # ************************************************** ********************
    #
    # Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
    #
    # This copy of Ice is licensed to you under the terms described in the
    # ICE_LICENSE file included in this distribution.
    #
    # ************************************************** ********************

    import sys, traceback, Ice, IceGrid

    Ice.loadSlice('Hello.ice')
    import Demo


    def menu():
    print """
    usage:
    t: send greeting as twoway
    s: shutdown server
    x: exit
    ?: help
    """

    class Client(Ice.Application):
    def run(self, args):
    if len(args) > 1:
    print self.appName() + ": too many arguments"
    return 1

    hello = None
    try:
    hello = Demo.HelloPrx.checkedCast(self.communicator().stri ngToProxy("hello"))
    except Ice.NotRegisteredException:
    query = IceGrid.QueryPrx.checkedCast(self.communicator().s tringToProxy("DemoIceGrid/Query"))
    hello = Demo.HelloPrx.checkedCast(query.findObjectByType(" :emo::Hello"))
    .........





    In a second time, I try other test with a other script
    import sys, traceback, Ice

    try:
    print "SYSTEAM/Registry"
    re=self.communicator().stringToProxy("DemoIceGrid/Registry")
    registry = IceGrid.RegistryPrx.checkedCast(re)

    session = registry.createAdminSession("user", "passord")
    admin = session.getAdmin()

    print admin.getAllServerIds()

    session.destroy()
    communicator.destroy()
    except:
    print "Error"
    erreur=True

    I don't import IceGrid.py and I don't have any error with
    registry = IceGrid.RegistryPrx.checkedCast(re)
    but the function go to the except section. If a run the sample code with C++ I dont have any error.

    I hope my new Explanation is better

    Thanks

  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
    Quote Originally Posted by Gilles View Post
    I want to use Icegrid to run my server with my client application.
    I use :
    icegridnode --Ice.Config=config.grid
    icegridadmin --Ice.Config=config.grid -e "application add 'application.xml'"


    For my problems

    I have ICE 3.3.0 and I don't have Icegrid.py, but I have the follow files:
    IceGrid_Query_ice.py
    IceGrid_Registry_ice.py
    IceGrid_Session_ice.py
    ....
    IceGrid is a package, not a .py file. It sounds to me like your PYTHONPATH is not setup correctly. In order for this demo to work you must be able to do something like this:

    Code:
    $ python
    >>> import Ice
    >>> import IceGrid
    If you cannot do that without error, then your system is configured incorrectly.

    ...
    I don't import IceGrid.py and I don't have any error with
    registry = IceGrid.RegistryPrx.checkedCast(re)
    but the function go to the except section. If a run the sample code with C++ I dont have any error.

    I hope my new Explanation is better

    Thanks
    I suggest you configure your system correctly, and if you are still having problems please report back. You also need to tell us more information, as as the versions of Ice, Python and the operating system you are using, and the exact error messages or exceptions you are encountering.

  5. #5
    Gilles is offline Registered User
    Name: Gilles LINDECKER
    Organization: ISIS MPP
    Project: Systeam (tests benches software)
    Join Date
    Oct 2008
    Posts
    10
    Thanks for your informations, I resolve my problem.

    Gilles

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. iceGrid/simple demo with replication
    By prettyMan in forum Help Center
    Replies: 8
    Last Post: 06-10-2010, 04:32 PM
  2. Request For IceGrid/IcePatch2 Demo Example
    By afcarl in forum Help Center
    Replies: 20
    Last Post: 09-03-2009, 03:59 AM
  3. Replies: 7
    Last Post: 06-19-2008, 05:15 PM
  4. IceStorm Counter Demo in an IceGrid
    By bigtim in forum Help Center
    Replies: 6
    Last Post: 08-14-2007, 01:06 PM
  5. Trouble with Python demo code
    By pellis in forum Help Center
    Replies: 1
    Last Post: 02-07-2005, 05:30 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
  •