powered by Jive Software

Invalid user.java.lang.ClassCastException: org.xmpp.packet.JID

hay all !

I am write a share group servlet plugin of jive-messenger , but occur this is error .

Caused by; java.lang.ClassCastException: org.xmpp.packet.JID

at org.jivesoftware.messenger.group.Group$MemberCollection.addGroup.java:268

at

org.jivesoftware.messenger.plugin.click2show.ShareGroupManagerServlet.createShar eGroup(ShareGroupManagerServlet.java:130)

thanks!

Example:


private void createShareGroup(String name, String description,

String displayname, String users, String showtype)

throws GroupAlreadyExistsException {

Group newGroup = GroupManager.getInstance().createGroup(name);

if (users.length() > 0) {

StringTokenizer tokenizer = new StringTokenizer(users, “, \t\n\r\f”);

while (tokenizer.hasMoreTokens()) {

String username = tokenizer.nextToken();

try {

if (username.indexOf(’’@’’) == -1) {

// No @ was found so assume this is a JID of a local user

username = Stringprep.nodeprep(username);

UserManager.getInstance().getUser(username);

// this is error newGroup.getMembers().add(new JID(“admin@zhuam”));

}

} catch (Exception e) {

throw new IllegalArgumentException(“Invalid user.”, e);

}

}

}

null