There is a limit of only 10 queue objects for one java application. This limit is introduced by a global container containing all queue-objects. It uses two entries in this container for each queue (send + receive).
The function to find the next free container-slot fails to handle the situation of using send-only and receive-only queue-objects:
int GetNextFreeHandleSlot()
{
int i, selected=-1;
for (i=0; (i < MAX_QUEUES) && (selected==-1); i++) {
if (qhandles[i*2] == NULL) {
selected= i;
}
}
return selected;
}
The fixed version:
int GetNextFreeHandleSlot()
{
int i, selected=-1;
for (i=0; (i < MAX_QUEUES) && (selected==-1); i++) {
if (qhandles[i*2] == NULL && qhandles[i*2+1] == NULL) {
selected= i;
}
}
return selected;
}