> I'm using an InitialLdapContext object to perform a search on an
> entry.
[quoted text clipped - 16 lines]
>
> with no success.
jpegPhoto is one of the default binary attributes that are already
defined in JNDI so you shouldn't have to explicitly tell JNDI that it is
binary. With that said, I specify it for completeness in my code. Also,
specifying it as "jpegPhoto;binary" is incorrect unless the attribute is
literally defined as jpegPhoto;binary in the schema of the directory.
Since it is a standard binary attribute there shouldn't be any reason
for a standard directory server to do that. I know Sun, OpenLDAP, and
ADS do not (and my LDAP GUI client handles binary attributes just fine
with all 3 of those so I know).
> Can someone suggest what the problem might be or how I might narrow
> the problem down? If I use a LDAP browser (jXplorer or LDAP Studio) I
> can view the stored jpegPhoto with no problem It appears that only my
> program has the problem.
When you are parsing the attributes and their values from the
SearchResult object you have to put the value of the jpegPhoto attribute
into a byte array (byte[]) in order to properly use it. However, the
attribute will not even be returned if you do not specify it explicitly
(assuming you aren't just telling your directory server to return all
attributes by using the * character). It is also possible to not be
returned if the user you are using to connect to the server does not
have privileges to read jpegPhoto for all the objects that are returned
in the result set. Is jpegPhoto included in the returned attribute set?
> I did discover that jXplorer doesn't use the
> javax.naming.ldap.InitialLdapContext to gain access to the server.
> Can that be my issue?
I don't know what jXplorer is so it's hard to say whether it's your
problem or not. How does that integrate into your code that you are
trying to get working? Is it your code or jXplorer that you are having
problems with?
THat's all I can say for now until I understand your situation more.