directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny" <elecha...@gmail.com>
Subject Re: [naming] Meaningless FileNotFoundException
Date Fri, 08 Dec 2006 11:05:12 GMT
Sorry, I didn't "browse" the exception enough :)

So far, it seems that the FNFE is thrown because the URL corresponding to
the DirContext is not found. From the code :

    public InputStream getInputStream()
        throws IOException {

        if (!connected)
            connect();

        if (resource == null) {
            throw new FileNotFoundException();


and somewhere in the connect() method, the 'resource' objetc is supposed to
be initialized this way :

                String path = getURL().getFile();

                        ...

                object = context.lookup(path);
                attributes = context.getAttributes(path);
                if (object instanceof Resource)
                    resource = (Resource) object;


If the lookup fails, the resource remains null, though the FNFE (The URL is
passed as an argument to the constructor :

public DirContextURLConnection(DirContext context, URL url) )


Here you are : on your own :(

Sorry, but this code has been sandboxed a while ago because nobody was
maintening it, and I think that only the original coder can help you... Of
course, it deserves some serious improvment, doco and logs, so if you
wolunteer for that, we will be very pleased :)

Emmanuel L├ęcharny


On 12/8/06, Sven Schliesing <schliesing@subshell.com> wrote:
>
>
> > I guess the remaining part of your message is pretty much struts
> > related, and we won't be able to be helpfull on this matter ...
> No it isn't. The problem is in
> org.apache.naming.resources.DirContextURLConnection on line 297:
> ------
> throw new FileNotFoundException();
> ------
>
>
> Unfortunately I'm not enough into the code to be able to provide a
> appropriate patch for that issue.
>
>
> Sven
>



-- 
Cordialement,
Emmanuel L├ęcharny

Mime
View raw message