Archived

This forum has been archived. Please start a new discussion on GitHub.

Python Destroy questions

I get the following error when I try to call the destroy method on my python server. In addition is there a way to get a more detailed description than Ice:UnknownException?

Server Error:
Session Factory Created
The session test is now created.
test Tue Oct 4 20:57:50 2005
Hey you!
SessionTestServer.py: warning: dispatch exception: Util.cpp:615: Ice::UnknownException:
unknown exception:
exceptions.TypeError: 'bool' object is not callable
identity: 89358001-324F-4580-998D-B91F232F889E
facet:
operation: destory

Client:
Ice.UnknownException: UnknownException
at Ice.ObjectPrxHelperBase.__rethrowException(LocalException ex)
at SessionTest.SessionPrxHelper.destory(Context __context) in C:\Documents and Settings\jeinhorn\My Documents\Visual Studio 2005\Projects\IcePrintClient\SessionTestClient\Printer.cs:line 348
at SessionTest.SessionPrxHelper.destory() in C:\Documents and Settings\jeinhorn\My Documents\Visual Studio 2005\Projects\IcePrintClient\SessionTestClient\Printer.cs:line 331
at SessionTestClient.TestMenu.handleChoice(String userinputselection) in C:\Documents and Settings\jeinhorn\My Documents\Visual Studio 2005\Projects\IcePrintClient\SessionTestClient\Client.cs:line 105


import SessionTest
import time
import threading
from PrinterI import *

class SessionI(SessionTest.Session):
def __init__(self, name_):
self.name = name_
self.timestamp = time.ctime()
self.destory = False;
self.nextId = 0;
self.lock = threading.Lock()
self.objects = []
print "The session " + self.name + " is now created."

def getnextId(self):
self.nextId += 1
return self.nextId

def createHello(self, IceCurrent_):
object = PrinterI(self.name, self.getnextId())
hello = SessionTest.PrinterPrx.uncheckedCast(IceCurrent_.adapter.addWithUUID(object))
self.objects.append(hello)
return hello;

def refresh(self, IceCurrent_):
self.timestamp = time.ctime()

def getName(self, IceCurrent_):
return self.name

def destory(self, IceCurrent_):
print "destory called"
#for sprinter in self.objects:
# IceCurrent_.adapter.remove(sprinter.ice_getIdentity())
#self.objects = []

def getTimestamp(self, IceCurrent_):
return self.timestamp

Comments

  • mes
    mes California
    jeinhorn wrote:
    I get the following error when I try to call the destroy method on my python server.
    I'll bet the problem is caused by the following line in your constructor:
            self.destory = False;
    
    Since there is also a method named "destory" (I'm assuming you meant this to be "destroy" :) ), your code is replacing the method destory with a boolean member value. When the Ice run time attempts to call this method, it gets the error message "'bool' object is not callable".
    In addition is there a way to get a more detailed description than Ice:UnknownException?
    The next release of Ice for Python will include a stack trace of the exception in the "unknown" member of UnknownException, which will make it easier to track down server errors like this.

    Take care,
    - Mark