You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by B G <fi...@gmail.com> on 2007/05/02 02:07:28 UTC

ldif directory path on windows

Hi...

I am trying to use a ldif file to import schema into an embedded 1.5.0 ds.

The issue I found has to do with what is configured for the path to the ldif
directory on a windows machine. If this path contains any characters that
are possible hex values after the  file seperator ( '\' on windows) things
are totally screwed.
This is because the DefaultStringNormalizer interprets the presence of any
'\' characters as an escape for a hex sequence and tries to convert the
following 2 bytes as hex. This is not a problem if the path has no possible
hex values after the file seperator, but big problem otherwise.

For example: C:\dev\ldif\myldif.ldif willl never work.

Stack trace looks like this:
javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
    at
org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize(
DeepTrimToLowerNormalizer.java:65)
    at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(
CachingNormalizer.java:95)
    at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java
:1402)
    at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java
:1459)
    at
org.apache.directory.server.core.normalization.NormalizationService.add(
NormalizationService.java:116)
    at org.apache.directory.server.core.interceptor.InterceptorChain.add(
InterceptorChain.java:708)
    at org.apache.directory.server.core.partition.PartitionNexusProxy.add(
PartitionNexusProxy.java:341)
    at org.apache.directory.server.core.partition.PartitionNexusProxy.add(
PartitionNexusProxy.java:329)
    at
org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(
ServerDirContext.java:428)
    at
org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(
ServerDirContext.java:374)
    at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(
ServerContextFactory.java:258)
    at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(
ServerContextFactory.java:383)
    at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(
ServerContextFactory.java:209)
    at org.apache.directory.server.core.DefaultDirectoryService.startup(
DefaultDirectoryService.java:268)
    at
org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext
(AbstractContextFactory.java:123)


Does anyone know of a work around for this?

Thanks...

Re: ldif directory path on windows

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi,

Have you tried to escape the escape character ?

Something like : c:\\dev\\...

Can you paste the piece of code you ar using to inject the ldif file, so
that we have a clear idea about what happens ?


Thanks !

On 5/2/07, B G <fi...@gmail.com> wrote:
>
> Hi...
>
> I am trying to use a ldif file to import schema into an embedded 1.5.0 ds.
>
> The issue I found has to do with what is configured for the path to the
> ldif
> directory on a windows machine. If this path contains any characters that
> are possible hex values after the  file seperator ( '\' on windows) things
> are totally screwed.
> This is because the DefaultStringNormalizer interprets the presence of any
> '\' characters as an escape for a hex sequence and tries to convert the
> following 2 bytes as hex. This is not a problem if the path has no
> possible
> hex values after the file seperator, but big problem otherwise.
>
> For example: C:\dev\ldif\myldif.ldif willl never work.
>
> Stack trace looks like this:
> javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
>     at
>
> org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize
> (
> DeepTrimToLowerNormalizer.java:65)
>     at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize
> (
> CachingNormalizer.java:95)
>     at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(
> LdapDN.java
> :1402)
>     at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java
> :1459)
>     at
> org.apache.directory.server.core.normalization.NormalizationService.add(
> NormalizationService.java:116)
>     at org.apache.directory.server.core.interceptor.InterceptorChain.add(
> InterceptorChain.java:708)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(
> PartitionNexusProxy.java:341)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(
> PartitionNexusProxy.java:329)
>     at
> org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(
> ServerDirContext.java:428)
>     at
> org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(
> ServerDirContext.java:374)
>     at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(
> ServerContextFactory.java:258)
>     at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(
> ServerContextFactory.java:383)
>     at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(
> ServerContextFactory.java:209)
>     at org.apache.directory.server.core.DefaultDirectoryService.startup(
> DefaultDirectoryService.java:268)
>     at
>
> org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext
> (AbstractContextFactory.java:123)
>
>
> Does anyone know of a work around for this?
>
> Thanks...
>



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com