Adding user to roster issue

Hi,

Issue with adding a contact to a roster. It throws this exception. Using Spark - I monitor the transaction going out, but the server does not seem to respond back to it. Any idea what’'s wrong ?

Server logs shows this

2006.10.04 19:38:18 [org.jivesoftware.wildfire.handler.IQRosterHandler.handleIQ(IQRosterHandler.jav a:119)

] Internal server error

org.jivesoftware.wildfire.user.UserAlreadyExistsException: rakesh@vlcserver

at org.jivesoftware.wildfire.roster.RosterItemProvider.createItem(RosterItemProvid er.java:113)

at org.jivesoftware.wildfire.roster.Roster.provideRosterItem(Roster.java:330)

at org.jivesoftware.wildfire.roster.Roster.provideRosterItem(Roster.java:291)

at org.jivesoftware.wildfire.roster.Roster.createRosterItem(Roster.java:276)

at org.jivesoftware.wildfire.handler.IQRosterHandler.manageRoster(IQRosterHandler. java:213)

at org.jivesoftware.wildfire.handler.IQRosterHandler.handleIQ(IQRosterHandler.java :104)

at org.jivesoftware.wildfire.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.wildfire.IQRouter.handle(IQRouter.java:268)

at org.jivesoftware.wildfire.IQRouter.route(IQRouter.java:96)

at org.jivesoftware.wildfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:67)

at org.jivesoftware.wildfire.net.SocketReader.processIQ(SocketReader.java:250)

at org.jivesoftware.wildfire.net.ClientSocketReader.processIQ(ClientSocketReader.j ava:51)

at org.jivesoftware.wildfire.net.SocketReader.process(SocketReader.java:216)

at org.jivesoftware.wildfire.net.BlockingReadingMode.readStream(BlockingReadingMod e.java:156)

at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java: 62)

at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:123)

at java.lang.Thread.run(Unknown Source)

Rakesh

Hi guys,

I solved this. I added users to JiveDB manually buit forgot to update the JiveID with the new value for the rosterID field. There exists a JiveID table that stores the current id of the roster ID. This corresponds to the JiveID of 18. When this value is less than the current max rosterID

UserAlreadyExistsException is fired when a user tries to add a new roster entry. Hence users who have this problem should remember that once you manually add new roster elements, you need to update this field. I wonder why we’'re not using auto number or something. Most databases support them. Anyway, a more robust plan would be to fire a RosterIDException -> this is more meaningful. Another fantastic plan would be to do a check and see if the user does not exist in the specified roster and then update the JiveID table with the max(RosterID) from the jiveRoster table.

I think Jive is really cool.

Cheers,

Rakesh