FileNotFoundException when loading interface ClassNode

Peter Veentjer <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Hi Guys,

I have the following problem: when I try to load interfaces the system
is not able to find the resource.

    public static ClassNode loadAsClassNode(ClassLoader loader, String
classInternalForm) {
        if (loader == null || classInternalForm == null) {
            throw new NullPointerException();
        }

        String fileName = classInternalForm + ".class";
        InputStream is = loader.getResourceAsStream(fileName);

        try {
            ClassNode classNode = new ClassNode();
            ClassReader reader = new ClassReader(is);
            reader.accept(classNode, ClassReader.EXPAND_FRAMES);
            return classNode;
        } catch (FileNotFoundException ex) {
            throw new RuntimeException(format("Could not find file
'%s' for class '%s': ",
                    fileName,
                    classInternalForm));
        } catch (IOException e) {
            throw new RuntimeException("A problem ocurred while
loading class: " + fileName, e);
        }
    }

In the case of an interface, I get the FileNotFoundException, so this
means that I don't get the chance
to enhance interfaces. I work on an STM and for every transactional
method of an interface, I add an additional
one that also is able to receive a transaction).

The strange thing is that it works perfectly for classes (that are
exact the same directory). So something must be working good.

PS: the classloader is the one that is received in the JavaAgent, so I
don't have the impression that that is the cause.
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.