PDA

View Full Version : Avoiding Malformed Url, Spaces in cn= and o=


jr@2ft
Oct 25th, 2006, 11:59 AM
Hi,

Using the sample application, I've used the following in my spring config

<bean id="contextSource" class="org.springframework.ldap.support.LdapContextSource" >
<property name="urls" value="http://myserver:389" />
<property name="userName" value="cn=Directory Manager" />
<property name="password" value="secret" />
<property name="base" value="o=foo and bar company" />
<property name="dirObjectFactory" value="org.springframework.ldap.support.DefaultDirObjectF actory" />
</bean>

When I run the test, I get this:

Operation failed; nested exception is javax.naming.NamingException: Cannot parse url: http://myserver:389/o=the%20foo%20and%20bar%20company [Root exception is java.net.MalformedURLException: Not an LDAP URL: http://myserver:389/o=the%20foo%20and%20bar%20company]

I know the spaces are the culprit, but how to I handle the spaces?

Thanks,

JR

jr@2ft
Oct 25th, 2006, 12:16 PM
Well, I'm 0-for-2 on the forum because I just found my error:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19576

Error: javax.naming.NamingException: Cannot parse url: [protocol]://[server]:[port] [Root exception is java.net.MalformedURLException: Not an LDAP URL: [protocol]://[server]:[port]]

Cause: The protocol you have specified is not correct.

Note: Currently if you specify anything besides ldap for the protocol, you will receive this error.

I noticed i used http in my snippet above.

problem solved.