Results 1 to 7 of 7

Thread: IcePack Query and Glacier2 question

  1. #1
    aerowyn is offline Registered User
    Join Date
    Nov 2004
    Posts
    15

    IcePack Query and Glacier2 question

    Greetings..

    I am having an issue thrying to add Glacier2 support to the IcePack Simple demo. The Glacier2 service runs fine, but I can not use IcePack Queries through it. This is the error message I get:

    Code:
    C:\Dev\Test>client.exe
    .\Outgoing.cpp:359: Ice::ObjectNotExistException:
    object does not exist
    identity: IcePack/Query
    facet:
    operation: ice_isA
    I have made very few changes to the code:

    Code:
    #include <Ice/Ice.h>
    #include <Glacier2/Router.h>
    #include <IcePack/Query.h>
    #include <Hello.h>
    and

    Code:
    int
    run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
    {
        Ice::RouterPrx defaultRouter = communicator->getDefaultRouter();
    	Glacier2::RouterPrx router = Glacier2::RouterPrx::checkedCast(defaultRouter);
    
    	string username = "test";
    	string password = "test";
    
    	try 
    	{ 
    		router->createSession(username, password);
    	}
    	
    	catch(const Glacier2::PermissionDeniedException& ex)
    	{
    		cout << "permission denied:\n" << ex.reason << endl;
    	}
    
    	catch(const Glacier2::CannotCreateSessionException& ex)
    	{
    		cout << "cannot create session:\n" << ex.reason << endl;
    	}
    	
    	Ice::PropertiesPtr properties = communicator->getProperties();
    
        IcePack::QueryPrx query = IcePack::QueryPrx::checkedCast(communicator->stringToProxy("IcePack/Query"));
    	Ice::ObjectPrx base = query->findObjectByType("::Demo::Hello");
        HelloPrx twoway = HelloPrx::checkedCast(base->ice_twoway()->ice_timeout(-1)->ice_secure(false));
    Other than that all the code is identical. I made sure to link glacier2d.lib. I also made some changes to the config file for the client (config)

    Code:
    #
    # The proxy to the Glacier2 router for all outgoing connections. This
    # must match the value of Glacier2.Client.Endpoints in config.glacier2.
    #
    Ice.Default.Router=Glacier2/router:ssl -p 10005
    
    Ice.Default.Locator=IcePack/Locator:default -p 12000
    
    #
    # No active connection management is permitted with Glacier2.
    # Connections must remain established.
    #
    Ice.ConnectionIdleTime=0
    
    #
    # Ice.MonitorConnections defaults to Ice.ConnectionIdleTime, which we
    # set to 0 above. However we still want the connection monitor thread
    # for AMI timeouts (for completeness, even if this demo doesn't use
    # AMI).
    #
    Ice.MonitorConnections=60
    
    #
    # Connection retry is not possible with Glacier2. Connections must
    # remain established.
    #
    Ice.RetryIntervals=-1
    
    #
    # Other settings.
    #
    
    #Ice.Trace.Network=1
    #Ice.Trace.Protocol=1
    Ice.Warn.Connections=1
    
    Ice.Plugin.IceSSL=IceSSL:create
    IceSSL.Client.CertPath=certs
    IceSSL.Client.Config=sslconfig.xml
    IceSSL.Server.CertPath=certs
    IceSSL.Server.Config=sslconfig.xml
    #IceSSL.Trace.Security=1
    and for IcePack (config.icepack)

    Code:
    #
    # This configuration file is used to configure an icepack node with a
    # collocated registry.
    #
    
    #
    # Enable ACM.
    #
    Ice.ConnectionIdleTime=30
    
    #
    # IcePack registry configuration
    #
    IcePack.Registry.Client.Endpoints=default -p 12000
    IcePack.Registry.Server.Endpoints=default
    IcePack.Registry.Internal.Endpoints=default
    IcePack.Registry.Admin.Endpoints=default
    IcePack.Registry.Data=db/registry
    
    #
    # IcePack node configuration.
    #
    IcePack.Node.Name=node
    IcePack.Node.Endpoints=default
    IcePack.Node.Data=db/node
    IcePack.Node.CollocateRegistry=1
    #IcePack.Node.PropertiesOverride=Ice.Default.Host=127.0.0.1
    #IcePack.Node.WaitTime=360
    
    #
    # Trace properties to debug activation problems.
    #
    IcePack.Node.Trace.Activator=2
    IcePack.Node.Trace.Adapter=2
    IcePack.Node.Trace.Server=2
    
    Ice.Default.Locator=IcePack/Locator:default -p 12000
    I am not sure what is causing the error, and I was hoping you could help out. Thanks.

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    What is the configuration of the Glacier2 router?

    Note that if you want the communications between the client and IcePack to go through Glacier2, you shouldn't set the default locator property in the client configuration file. Instead you should set it in the Glacier2 router configuration file.

    Benoit.

  3. #3
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Btw, could you please fill in your signature with the information requested here? We won't be able to provide more support without this information.

    Thanks,

    Benoit.

  4. #4
    aerowyn is offline Registered User
    Join Date
    Nov 2004
    Posts
    15
    Sorry, I had forgot to change my signature. Here is the config.glacier2:

    Code:
    #
    # The client-visible endpoint of Glacier2. This should be an endpoint
    # visible from the public Internet, and it should be secure.
    # 
    Glacier2.Client.Endpoints=ssl -p 10005
    
    #
    # The server-visible endpoint of Glacier2. This endpoint is only
    # required if callbacks are needed (leave empty otherwise). This
    # should be an endpoint on an internal network (like 192.168.x.x), or
    # on the loopback, so that the server is not directly accessible from
    # the Internet.
    #
    Glacier2.Server.Endpoints=tcp -h 127.0.0.1
    
    # 
    # Configure the location of the Ice locator. This must agree with the
    # configuration information in config.icepack.
    #
    Ice.Default.Locator=IcePack/Locator:default -p 12000
    
    # 
    # The proxy of the session manager.
    #
    #Glacier2.SessionManager=ChatSessionManager
    
    # 
    # For this demo, we use a dummy permissions verifier that is
    # collocated with the session server process. This dummy permissions
    # verifier allows any user-id / password combination.
    # 
    #Glacier2.PermissionsVerifier=verifier
    
    #
    # The timeout for inactive sessions. If any client session is inactive
    # for longer than this value, the session expires and is removed. The
    # unit is seconds.
    #
    Glacier2.SessionTimeout=30
    
    #
    # We don't want to allow access to any server back-end objects
    # that do not have the _userId as their category.
    #
    Glacier2.AddUserToAllowCategories=2
    
    #
    # To prevent Glacier2 from being flooded with requests from or to one
    # particular client, Glacier2 can be configured to sleep for a certain
    # period after all current requests for this client have been
    # forwarded. During this sleep period, new requests for the client are
    # queued. These requests are then all sent once the sleep period is
    # over. The unit is milliseconds.
    #
    Glacier2.Client.SleepTime=500
    Glacier2.Server.SleepTime=500
    
    #
    # SSL Settings.
    #
    Ice.Plugin.IceSSL=IceSSL:create
    IceSSL.Client.CertPath=certs
    IceSSL.Client.Config=sslconfig.xml
    IceSSL.Server.CertPath=certs
    IceSSL.Server.Config=sslconfig.xml
    #IceSSL.Trace.Security=1

  5. #5
    aerowyn is offline Registered User
    Join Date
    Nov 2004
    Posts
    15
    I was messing around a bit, and I still can't get this to work right. I even tried using the strings "hello1@Hello" and "hello1:default -h 127.0.0.1 -p 12000" but this also did not work. I keep getting object not found errors. Is there something special I have to do to get proxy from beyond the router?
    Last edited by aerowyn; 10-15-2005 at 11:23 PM.

  6. #6
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    You have this set in your Glacier2 configuration:

    Code:
    #
    # We don't want to allow access to any server back-end objects
    # that do not have the _userId as their category.
    #
    Glacier2.AddUserToAllowCategories=2
    Therefore you can only access objects that have an identity with a category that equals "_" plus the user id ("_test" in your example). You can trace this behavior by setting Glacier2.Client.Trace.Reject=1.

    For more information, please see the Ice user manual, and our newsletter issue #1 and #2. (http://www.zeroc.com/newsletter/)

  7. #7
    aerowyn is offline Registered User
    Join Date
    Nov 2004
    Posts
    15
    Thank you marc! That fixed my problem!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IcePack and Glacier2 configuration
    By xdm in forum Help Center
    Replies: 4
    Last Post: 06-01-2005, 11:37 AM
  2. Glacier2 and IcePack
    By vsonnathi in forum Help Center
    Replies: 3
    Last Post: 04-21-2005, 10:52 AM
  3. Replies: 7
    Last Post: 02-11-2005, 02:11 PM
  4. Puzzled by IcePack/Locator and IcePack/Query
    By rc_hz in forum Help Center
    Replies: 2
    Last Post: 11-13-2004, 09:41 PM
  5. IcePack/Query documentation?
    By rbx in forum Help Center
    Replies: 13
    Last Post: 02-26-2004, 10:52 AM

Posting Permissions

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