LDAP vCard errors

Hi ,

I am having issues getting the LDAP vCard plugin to work. The following errors show up in the error log. According the debug log, it seems to lookup the user information properly.

Thanks for the help.

Badri

2008.05.27 14:35:24 org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:69)

Internal server error

java.lang.IllegalArgumentException: Illegal group reference

at java.util.regex.Matcher.appendReplacement(Unknown Source)

at java.util.regex.Matcher.replaceFirst(Unknown Source)

at java.lang.String.replaceFirst(Unknown Source)

at org.jivesoftware.openfire.ldap.LdapVCardProvider$VCard.treeWalk(LdapVCardProvid er.java:521)

at org.jivesoftware.openfire.ldap.LdapVCardProvider$VCard.treeWalk(LdapVCardProvid er.java:525)

at org.jivesoftware.openfire.ldap.LdapVCardProvider$VCard.getVCard(LdapVCardProvid er.java:502)

at org.jivesoftware.openfire.ldap.LdapVCardProvider.loadVCard(LdapVCardProvider.ja va:216)

at org.jivesoftware.openfire.vcard.VCardManager.getOrLoadVCard(VCardManager.java:2 05)

at org.jivesoftware.openfire.vcard.VCardManager.getVCard(VCardManager.java:198)

at org.jivesoftware.openfire.handler.IQvCardHandler.handleIQ(IQvCardHandler.java:1 08)

at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:49)

at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:349)

at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:101)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:68)

at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:299)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler .java:79)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:264)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:163)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:133)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:180)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

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

What version of openfire server and what are you trying to use that plugin for? Also what specific plugin are you referencing?

i guess i should have been clearer.

using version 3.5.1

JRE: 1.6.0_06

On Windows Server 2003, and SQL Server 2005

I am not using any third party plugins, just the builtin LDAP plugin that comes with openfire.

The error starts at

at org.jivesoftware.openfire.ldap.LdapVCardProvider$VCard.treeWalk(LdapVCardProvid er.java:521)

the line it errors on is just calling replaceFirst on a String type.

That is indeed very odd. I am not getting that error at all, I am using an older version of JAVA 1.0.6_03-b05. Iwill try upgrading my java on my testbead server to see if it can be reproduced.

Did you install using the exe or the zip file? Even with the all updats on the server JAVA and Openfire I can not replicate this error on my server. The only other variable I can not test is your database, as I use MySQL for windows.

I used the zip file to install since the server already had JRE.

I may not hurt to try the exe file. I used the exe file for my install. So that would be another difference.

I will try that tonight, and see what happens. but i just cant see that being the issue, but you never know

One weird thing i noticed was the format for the vcard was different depending on documentation

Check out

http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/javadoc/ org/jivesoftware/openfire/ldap/LdapVCardProvider.html

(http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/javadoc/)

and

http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/ldap-gui de.html

For example

<FN attrs=“displayName”></FN>

vs

<FN></FN>

I do not know which is correct, for right now I have everything is format 2.

I think format 1 is an old style that was used in earlier releases of the server. Format 2 is what is used now and works fine.

I tried switching to the installer, and I have the same errors.

Any other suggestions as what could be causing this issue.

I just tested the service against mysql as well, and still has the same issue. Supposedly the function typically errors on special characters part of regex, and since { } are used in regex it might be erroring on that.

Does anyone else have openfire integrated with ldap/ad have this issue.

Thanks for the help

HI,

I fixed my issue. It was caused by address fields having the $ sign in them. I recompiled openfire after changing

org.jivesoftware.openfire.ldap.LdapVCardProvider$VCard.treeWalk in file LdapVCardProvider.java at line 521

from

format = format.replaceFirst("(
{)(" + field + “)(})”, value);

to

format = format.replaceFirst("(
{)(" + field + “)(})”, java.util.regex.Matcher.quoteReplacement(value));

Hopefully someone can file commit this to the source so it can be fixed in a future release.

Badri