commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurizio Pillitu (JIRA)" <>
Subject [jira] Created: (SANDBOX-174) ClassFormatException during Javaflow class enhancement
Date Sat, 23 Sep 2006 16:23:22 GMT
ClassFormatException during Javaflow class enhancement

                 Key: SANDBOX-174
             Project: Commons Sandbox
          Issue Type: Bug
          Components: JCI
            Reporter: Maurizio Pillitu
         Attachments: commons-jci.diff

org.apache.bcel.classfile.ClassFormatException: null is not a Java .class file
        at org.apache.bcel.classfile.ClassParser.readID(
        at org.apache.bcel.classfile.ClassParser.parse(
        at org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer.transform(
        at org.apache.commons.javaflow.stores.TransformingResourceStore.write(
        at org.apache.commons.javaflow.stores.JavaflowResourceStore.onStop(
        at org.apache.commons.jci.listeners.ReloadingListener.onStop(
        at org.apache.commons.jci.monitor.FilesystemAlterationMonitor.onStop(

The exception is triggered because the bytecode of the .class file is not recognized; the
error resides in org.apache.commons.jci.listeners.ReloadingListener, that uses  a FileReader
to read the file and converts it in a stream of characters :

                final File file = (File);
                try {
                    final byte[] bytes = IOUtils.toByteArray(new FileReader(file));
                    final String resourceName = ReloadingClassLoader.clazzName(repository,
                    //if (resourceName.endsWith(".class")) {
                        store.write(resourceName, bytes);

Using FileInputStream it works correctly; all relevant tests work.
Attaching patch.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message