Results 1 to 10 of 10

Thread: reply status = 2 (object not exist)

  1. #1
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    reply status = 2 (object not exist)

    I write a similar icebox service like newsletter,when debug it,always report "object not exist",
    snippet:
    UserServiceI.cpp:
    namespace NW
    {
    namespace Users
    {
    class UserServiceI : public ::IceBox::Service
    {
    public:
    virtual void
    start(const string& name, const CommunicatorPtr& communicator, const StringSeq&)
    { _adapter = communicator->createObjectAdapter("UserManager");
    IdIndexPtr index = new IdIndex("userid");
    vector<Freeze::IndexPtr> indices;
    indices.push_back(index);
    UserManagerIPtr manager = new UserManagerI(index,_adapter);
    UserFactoryPtr userfactory = new UserFactory(manager);
    communicator->addObjectFactory(userfactory,"::NW::Users::User") ;
    Freeze::EvictorPtr evictor =Freeze::createEvictor(_adapter,name,"users",0,ind ices);
    _adapter->addServantLocator(evictor,"users");
    manager->SetEvictor(evictor);
    _adapter->add(manager,Ice::stringToIdentity("UserManager")) ;
    _adapter->activate();
    }
    virtual void
    stop()
    {
    _adapter->deactivate();
    }
    private:
    Ice::ObjectAdapterPtr _adapter;
    };
    }
    }
    UserManagerI.cpp:
    UserManagerI::UserManagerI(const IdIndexPtr& idIndex,
    const Ice::ObjectAdapterPtr& adapter)
    {
    _adapter = adapter;
    _index =idIndex;
    }
    UserPrx UserManagerI::AddUser(const string& user,const string& passwd,
    OperatorType optype,const Ice::Current&)
    {
    try
    {
    cout << "start adduser!" << endl;
    vector<Ice::Identity> identities;
    identities =_index->find(user);
    if(identities.size()!=0)
    {
    cout << user << " exist! " << endl;
    throw new UserExistException();
    }
    Ice::Identity ident ;
    ident.category ="users";
    ident.name =IceUtil::generateUUID();
    UserIPtr userI = new UserI(this,user,passwd,optype);
    cout <<"1!" <<endl;
    _evictor->add(userI,ident);
    return UserPrx::uncheckedCast(_adapter->createProxy(ident));

    }
    catch(DatabaseException ex)
    {
    cout << "Database inner error!" << endl;
    DatabaseException e;
    e.reason = ex.reason;
    throw e;
    }
    I create UserManagerPrx in SessionService,like this :
    UserManagerPrx usermanager =UserManagerPrx::checkedCast(ic->stringToProxy("UserManager")); then return usermanager to client,
    when client run
    "UserPrx user = _usermanager->AddUser(userid,passwd,OpType);"
    protocal trace return "object not exist",like this:

    [ Protocol: sending request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 62
    request id = 9
    identity = UserManager
    facet =
    operation = AddUser
    mode = 0 (normal)
    context = ]
    [ Protocol: received reply
    message type = 2 (reply)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 41
    request id = 9
    reply status = 2 (object not exist)
    identity = UserManager
    facet =
    operation = AddUser ]
    E

    my chatapp.xml snippet:
    <icebox id="UserManager" exe="icebox" activation="on-demand">
    <service name="UserManager" entry="Users:create">
    <dbenv name="${service}"/>
    <adapter name="UserManager" endpoints="tcp -h 127.0.0.1">
    <object identity="UserManager" type="::NW::Users::UserManager"/>
    </adapter>
    </service>
    </icebox>
    I run icegridadmin,object list,UserManager exist!,what is problem?
    who can give me a hand?


    regards!
    ewiniar
    Last edited by ewiniar; 05-20-2006 at 12:22 AM.
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  2. #2
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    object not exist!

    I run icegridadmin command,
    >>> object describe UserManager
    proxy = `UserManager -t @ UserManager.UserManager.UserManager'
    type = `::NW::Users::UserManager'

    my config.icegrid config Ice.Default.Locator:
    Ice.Default.Locator=NwIceGrid/Locator:default -p 12000

    my chatapp.xml snippet

    <node name ="Chat">
    Ice.Default.Locator=NwIceGrid/Locator:default -p 12000
    <server-instance template="Glacier2"
    client-endpoints="ssl -h 10.5.0.1 -p 10005"
    server-endpoints="tcp -h 127.0.0.1"
    instance-name="Glacier2"
    session-timeout="30"
    permissions-verifier="verifier"
    session-manager="ChatSessionManager"
    add-user-to-allow-categories="2"
    client-sleep-time="500"
    server-sleep-time="500"
    ssl-plugin="IceSSL:create"
    ssl-client-cert-path="../certs"
    ssl-client-config="sslconfig.xml"
    ssl-server-cert-path="../certs"
    ssl-server-config="sslconfig.xml"
    />
    <icebox id="UserManager" exe="icebox" activation="on-demand">
    <service name="UserManager" entry="Users:create">
    <dbenv name="${service}"/>
    <adapter name="UserManager" endpoints="tcp -h 127.0.0.1">
    <object identity="UserManager" type="::NW::Users::UserManager"/>
    </adapter>
    </service>
    </icebox>

    </node>
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  3. #3
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    Ice::ConnectionLostException

    I debug it,snippet:
    Breakpoint 3, NwCom::AddUser (this=0x901dab8, userid=@0xbf997e3c, passwd=@0xbf997e34,
    OpType=NW::Users::Administrator) at src/NwCom.cpp:36
    36 UserPrx user = _usermanager->AddUser(userid,passwd,OpType);
    (gdb) s
    IceUtil::HandleBase<IceProxy::NW::Users::UserManag er>:perator-> (this=0x901dabc)
    at /usr/include/IceUtil/Handle.h:37
    37 if(!_ptr)
    (gdb) p _ptr
    $1 = (class IceProxy::NW::Users::UserManager *) 0x90490b0
    (gdb) n
    warning: connection exception:
    SslTransceiver.cpp:336: Ice::ConnectionLostException:
    connection lost: recv() returned zero
    local address = 10.5.0.1:56541
    remote address = 10.5.0.1:10005
    [ Network: closing ssl connection
    local address = 10.5.0.1:56541
    remote address = <not connected> ]
    42 return _ptr;

    I search ConnectionLostException in forum ,Server return _usermanager to client ,I try to set "_usermanager->ice_router();",but error always is these :
    warning: connection exception:
    SslTransceiver.cpp:336: Ice::ConnectionLostException:
    connection lost: recv() returned zero
    local address = 10.5.0.1:56541
    remote address = 10.5.0.1:10005
    [ Network: closing ssl connection
    local address = 10.5.0.1:56541
    remote address = <not connected> ]

    why?
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  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
    Its very hard to follow what is going on from your posts. Could you post the example as a complete compilable archive? Then we can take a look at it.

  5. #5
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    example

    This is a example,please take a look at it,thanks!
    maybe it can't compile,but it should explain code's meaning,
    Attached Files Attached Files
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  6. #6
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    Ice::ConnectionLostException

    Could anybody explain it for me ? Thanks!
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  7. #7
    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
    Hi,

    The Ice::ConnectionLostException exception means that the connection with the server was lost. Since your client is connecting through Glacier2, the most likely reason is that Glacier2 rejected the request and closed the connection. I can't see anything obviously wrong with your code and configuration but I might have missed something.

    Could you enable tracing on the Glacier2 router with the properties below? This might give us some clues on why you get this exception.

    • Glacier2.Trace.Session=1
    • Glacier2.Client.Trace.Reject=1

    Benoit.

  8. #8
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    Glacier2: rejecting request

    I enable tracing on the Glacier2 router ,it report:

    [ Glacier2: Glacier2: created session
    user-id = Operator
    category = 5W>2dhNc^nTD_]at/jID
    local address = 10.5.0.1:10005
    remote address = 10.5.0.1:42282 ]

    [ Glacier2: Glacier2: rejecting request
    identity: UserManager ]
    [ Glacier2: Glacier2: expiring session
    user-id = Operator
    category = 5W>2dhNc^nTD_]at/jID
    local address = 10.5.0.1:10005
    remote address = 10.5.0.1:42282 ]
    Protocal tracer report:
    [ Protocol: sending request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 62
    request id = 9
    identity = UserManager
    facet =
    operation = AddUser
    mode = 0 (normal)
    context = ]
    [ Protocol: received reply
    message type = 2 (reply)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 41
    request id = 9
    reply status = 2 (object not exist)
    identity = UserManager
    facet =
    operation = AddUser ]
    E
    icegridadmin report:
    >>> object list
    FwSession-FwSessionManager
    FwSession-verifier
    UserManager
    NwIceGrid/Admin
    NwIceGrid/Query
    NwIceGrid/SessionManager
    >>> object describe "UserManager"
    proxy = `UserManager -t @ UserManager.UserManager.UserManager'
    type = `::NW::Users::UserManager'
    >>>
    In Ice-3.0.1 manual,It says:
    If a server returns a proxy as the result of an operation, that proxy contains the server’s endpoints in the private network, as usual. (Remember, the server is unaware of Glacier2’s presence, and therefore assumes that the proxy is usable by the client that requested it.) Of course, those endpoints are not accessible to the client and, in the absence of a router, the client would receive an exception if it were to use the proxy. When that proxy is configured with a router, however, the client ignores the server’s endpoints and only sends requests to the router’s client endpoints.
    In my program,I return a proxy to client from server,If I should do some differrent work in my client?
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

  9. #9
    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
    Ok, from the traces, it's clear that Glacier2 rejects the request to the object with the identity "UserManager". That's because you have configured the Glacier2 router to only allow requests to objects with the category "_<user id>" by setting the Glacier2.AddUserToAllowCategories property to 2 (see the Ice manual for more information on this property).

    So either you should set this property to 0 but then clients will be able to invoke on any objects or change the category of the "UserManager" object and configure Glacier2 to allow invocations on objects with this category (see the documentation of the Glacier2.AllowCategories property for more information).

    Cheers,
    Benoit.

  10. #10
    ewiniar is offline Registered User
    Name: ewiniar
    Organization: soho
    Project: ssl vpn
    Join Date
    Jan 2006
    Posts
    30

    It works!

    Thanks Benoit,thanks a lot ,you are right,I neglect the Glacier2.AddUserToAllowCategories property ,
    I set the property to 0,It works well,
    thanks again!


    Regards

    ewiniar
    ------------------


    ewiniar Lee
    Software Engineer
    Company:THP Ltd.Co
    Project:Communication lib project

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 06-23-2007, 07:19 AM
  2. Sometimes long reply time for proxy generation
    By HpGisler in forum Help Center
    Replies: 6
    Last Post: 04-18-2007, 05:54 AM
  3. Freeze due to unheard reply
    By Ric in forum Help Center
    Replies: 2
    Last Post: 12-13-2005, 09:05 AM
  4. How can I know disconnection status ?
    By laotee in forum Help Center
    Replies: 6
    Last Post: 06-02-2005, 05:29 AM
  5. about the status of client
    By simpley in forum Help Center
    Replies: 1
    Last Post: 04-27-2005, 04:04 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
  •