You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Torsten Curdt (JIRA)" <ji...@apache.org> on 2006/09/23 18:30:25 UTC

[jira] Resolved: (SANDBOX-174) ClassFormatException during Javaflow class enhancement

     [ http://issues.apache.org/jira/browse/SANDBOX-174?page=all ]

Torsten Curdt resolved SANDBOX-174.
-----------------------------------

    Resolution: Fixed

Patch applied. Please verify and close

> ClassFormatException during Javaflow class enhancement
> ------------------------------------------------------
>
>                 Key: SANDBOX-174
>                 URL: http://issues.apache.org/jira/browse/SANDBOX-174
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: JCI
>            Reporter: Maurizio Pillitu
>         Assigned To: Torsten Curdt
>         Attachments: commons-jci.diff
>
>
> org.apache.bcel.classfile.ClassFormatException: null is not a Java .class file
>         at org.apache.bcel.classfile.ClassParser.readID(ClassParser.java:286)
>         at org.apache.bcel.classfile.ClassParser.parse(ClassParser.java:155)
>         at org.apache.commons.javaflow.bytecode.transformation.bcel.BcelClassTransformer.transform(BcelClassTransformer.java:117)
>         at org.apache.commons.javaflow.stores.TransformingResourceStore.write(TransformingResourceStore.java:50)
>         at org.apache.commons.javaflow.stores.JavaflowResourceStore.onStop(JavaflowResourceStore.java:81)
>         at org.apache.cocoon.components.flow.java.JavaflowResourceStore.onStop(JavaflowResourceStore.java:101)
>         at org.apache.commons.jci.listeners.ReloadingListener.onStop(ReloadingListener.java:120)
>         at org.apache.commons.jci.monitor.FilesystemAlterationMonitor.onStop(FilesystemAlterationMonitor.java:261)
>         at org.apache.commons.jci.monitor.FilesystemAlterationMonitor.run(FilesystemAlterationMonitor.java:420)
>         at java.lang.Thread.run(Thread.java:595)
> 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) it.next();
>                 try {
>                     final byte[] bytes = IOUtils.toByteArray(new FileReader(file));
>                     final String resourceName = ReloadingClassLoader.clazzName(repository, file);
>                     //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: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org