You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Maurizio Pillitu (JIRA)" <ji...@apache.org> on 2006/09/24 11:32:24 UTC
[jira] Commented: (SANDBOX-174) ClassFormatException during
Javaflow class enhancement
[ http://issues.apache.org/jira/browse/SANDBOX-174?page=comments#action_12437193 ]
Maurizio Pillitu commented on SANDBOX-174:
------------------------------------------
Ok, it works. I guess I have no permissions to close the issue. Could you please close it?
> 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