Hi All,
Am having trouble getting the ice_invoke_async function to work in java.
I don't seem to see any existing example for this function, so I've modified the Client.java file in the examples to perform what ( to my mind) should be an asyncronous equivalent of the synchronous printString example. ( Option '0' has been added').
I've verified the synchronous version works. But when I try to call the asynchronous version an assertion is thrown.
Am I calling the function in the right way? Also just to understand how assertions are used in the code, to my mind an assertion should never be called in working library code and if they're called it always signifies a bug, is this the right way of thinking about them, or are there occasions when a user can cause an assertion to be raised? I'd normally expect all user mistakes to raise exceptions instead.
Any help appreciated!
A.
Using Ice-3.3.1....
Output
=========================
(Assertions enabled)
usage:
0: async pring string
1: print string
2: print string sequence
3: print dictionary
4: print enum
5: print struct
6: print struct sequence
7: print class
8: get values
9: throw exception
s: shutdown server
x: exit
?: help
==> 1 ( Here server outputs "Printing string `The streaming API works!'" as expected).
==> 0
==> Exception in thread "Ice.ThreadPool.Client-0" java.lang.AssertionError
at IceInternal.BasicStream.getReadEncapsSize(BasicStr eam.java:506)
at Ice.AMI_Object_ice_invoke.__response(AMI_Object_ic e_invoke.java:40)
at IceInternal.OutgoingAsync.__finished(OutgoingAsync .java:201)
at Ice.ConnectionI.message(ConnectionI.java:964)
at IceInternal.ThreadPool.run(ThreadPool.java:577)
at IceInternal.ThreadPool.access$100(ThreadPool.java: 12)
at IceInternal.ThreadPool$EventHandlerThread.run(Thre adPool.java:971)
( Without Assertions enabled)
==> 0
==> 14/08/09 09:34:08:569 warning: Ice.ThreadPool.Client-0: exception raised by AMI callback:
java.lang.NullPointerException
at IceInternal.BasicStream.getReadEncapsSize(BasicStr eam.java:507)
at Ice.AMI_Object_ice_invoke.__response(AMI_Object_ic e_invoke.java:40)
at IceInternal.OutgoingAsync.__finished(OutgoingAsync .java:201)
at Ice.ConnectionI.message(ConnectionI.java:964)
at IceInternal.ThreadPool.run(ThreadPool.java:577)
at IceInternal.ThreadPool.access$100(ThreadPool.java: 12)
at IceInternal.ThreadPool$EventHandlerThread.run(Thre adPool.java:971)
$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

Reply With Quote