This discussion is archived
3 Replies Latest reply: May 11, 2011 12:00 PM by 861243 RSS

Problem with findme example shipped with OCCAS

738374 Newbie
Currently Being Moderated
Hi,


I have got OCCAS and x-lite installed on my machine.

I have deployed findme example on server after which I am able to register the X-lite clients on the server. ( I am getting the message registered on X-Lite)

When I try to get the list of registered user using jsp provided with example the list is not getting displayed.

After doing some research I came to know the length of array returned by getAddressOfRecords is zero in jsp. Even though it has non zero length in the method. Not sure what happing when array is returned to Jsp . Can anybody help on this.

The method which is accessed from UI :

Java class:

public SipURI[] getAddressOfRecords() {

log("entries.size() >>> "+entries.size());
SipURI[] aors = new SipURI[entries.size()];
log("aors >>> "+aors.toString());
log("aors >>> "+aors.length); --------------------------------------------- gives value 2
log("entries.keySet().toArray(aors) "+entries.keySet().toArray(aors).length);

SipURI[] xyz = entries.keySet().toArray(aors);

for(SipURI a : xyz){
log("a.getUser() >>> "+ a.getUser());
log("a.getHost() >>> "+ a.getHost()); // All value are listed
log("a.toString() >>> "+ a.toString());

}
return xyz;

}



Code on jsp:


<%
InitialContext ctx = new InitialContext();
LocationService locationService = (LocationService)
ctx.lookup(LocationService.JNDI_NAME);
if (locationService != null) {
SipURI[] aors = locationService.getAddressOfRecords();
out.print(aors.length); ------------------------------------------------- gives value 0

for (SipURI aor : aors) {
Address[] contacts = locationService.getContacts(aor);
int i=0;
for (Address address : contacts) {
%> <tr>
<td class="addressofRec"><%=aor %></td>
<td>
<%
StringBuffer buf = new StringBuffer();
if (address.getDisplayName() != null) {
buf.append("\"").append(address.getDisplayName()).append("\"");
}
buf.append(" &lt ").append(address.getURI());
buf.append(" &gt");
out.print(buf.toString());
%>
</td>
<td class="expires"><%=contacts[i++].getExpires() %></td></tr> <%
}
}
}
%>


Regards,
Deepak

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points