Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 83852 invoked from network); 23 Sep 2006 16:27:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Sep 2006 16:27:11 -0000 Received: (qmail 45122 invoked by uid 500); 23 Sep 2006 16:27:10 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 44541 invoked by uid 500); 23 Sep 2006 16:27:07 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 44119 invoked by uid 99); 23 Sep 2006 16:27:07 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Sep 2006 09:27:06 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:54971] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 8E/7F-27820-95065154 for ; Sat, 23 Sep 2006 09:27:05 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B7A17142E8 for ; Sat, 23 Sep 2006 16:23:23 +0000 (GMT) Message-ID: <1172423.1159028603503.JavaMail.jira@brutus> Date: Sat, 23 Sep 2006 09:23:23 -0700 (PDT) From: "Maurizio Pillitu (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (SANDBOX-174) ClassFormatException during Javaflow class enhancement In-Reply-To: <29696016.1159028602386.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/SANDBOX-174?page=all ] Maurizio Pillitu updated SANDBOX-174: ------------------------------------- Attachment: commons-jci.diff > 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 > 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