This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 151419 - com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file: jar:file:/home/peter/dev/jfrog/Frog/JBase/lib/ext/JGraphT.jar!/org/jgrapht/graph/DirectedWeightedMultigraph.class class file contains
Summary: com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file: jar:file:/h...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL: http://statistics.netbeans.org/except...
Keywords:
: 230767 (view as bug list)
Depends on:
Blocks: 152191
  Show dependency tree
 
Reported: 2008-10-27 09:27 UTC by Marian Mirilovic
Modified: 2013-06-17 09:03 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 37073


Attachments
stacktrace (5.70 KB, text/plain)
2009-07-30 17:08 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2008-10-27 09:27:21 UTC
10 duplicates so far ...

Build: NetBeans IDE Dev (Build 200803130007)
VM: Java HotSpot(TM) Client VM, 10.0-b19
OS: Linux, 2.6.24.3-12.fc8, i386
User comments: 
STACKTRACE: (first 10 lines)
com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file:
jar:file:/home/peter/dev/jfrog/Frog/JBase/lib/ext/JGraphT.jar!/org/jgrapht/graph/DirectedWeightedMultigraph.class
class file contains wrong class: eu.advancedcargo.space.impl.RoutePlannerFactory
Please remove or make sure it appears in the correct subdirectory of the classpath.
        at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:280)
        at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:1569)
        at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:1680)
        at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1884)
        at org.netbeans.modules.java.source.usages.SymbolClassReader.fillInImpl(SymbolClassReader.java:176)
        at org.netbeans.modules.java.source.usages.SymbolClassReader.fillIn(SymbolClassReader.java:155)
        at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1816)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:401)
        at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:784)
        at com.sun.tools.javac.jvm.ClassReader$1.getEnclosingType(ClassReader.java:668)
Comment 1 Dusan Balek 2008-12-04 15:24:28 UTC
Strange. Do you have a reproducible test case?
Comment 2 Jesse Glick 2009-07-30 17:08:00 UTC
Build: NetBeans IDE Dev (Build 090730)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Linux, 2.6.28-14-generic, i386

User Comments: 
Built FindBugs as an autoproject.

Stacktrace: 
com.sun.tools.javac.jvm.ClassReader$BadClassFile: bad class file: class file contains wrong class: edu.umd.cs.findbugs.graph.AbstractDepthFirstSearch
  {1}
  Please remove or make sure it appears in the correct subdirectory of the classpath.
        at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:288)
        at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:1596)
        at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:1707)
        at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1918)
        at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1843)
        at com.sun.tools.javac.code.Symbol.complete(Symbol.java:405)
Comment 3 Jesse Glick 2009-07-30 17:08:05 UTC
Created attachment 85560 [details]
stacktrace
Comment 4 Exceptions Reporter 2009-07-30 17:08:10 UTC
This issue already has 13 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=37073
Comment 5 Dusan Balek 2009-07-31 12:34:27 UTC
Are you able to reproduce it on your sources?
Comment 6 Jesse Glick 2009-07-31 17:14:23 UTC
I did not manage to reproduce. What I tried:

svn co -r 11475 http://findbugs.googlecode.com/svn/trunk/findbugs
rm -r nbproject

Start 090730 (#fe6e63115575, cluster.config=basic) on a fresh userdir with JDK 6u14 on Ubuntu. Install Automatic
Projects from Plugin Manager. New Project > Automatic Project, point to findbugs checkout. F11, accept 'build' as
target. Wait for scanning to complete. A number of coupling errors are printed to console. S-F11, accept 'clean' as
target. Scan occurs again (I don't know why).
Comment 7 Exceptions Reporter 2009-08-10 16:03:35 UTC
This issue already has 14 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=37073
Comment 8 Tomas Zezula 2009-08-10 17:25:54 UTC
May be caused by some problem in FastJar, I will evaluate.

Comment 9 Tomas Zezula 2009-09-21 18:46:28 UTC
I am not able to reproduce it.
It's very strange the ClassReader verifies that the class which it's loading has the expected name.
There are three possibilities:
1) The class file contains different class - not very probable.
2) The ClassSymbol.classfile contains a reference to wrong JavaFileObject
3) The ClassReader consumed more data from ConstantPool and the pointer is pointing to the wrong (next) ConstantPool entry.
Comment 10 Tomas Zezula 2009-09-21 19:29:46 UTC
I am not able to reproduce it either with guice or findbugs.
Does anyone have the reproduceable test case?
I've also tried to revert to #fe6e63115575, cluster.config=basic as Jesse suggested, unfortunately I was not able to built it (Mac).
Comment 11 Tomas Zezula 2009-09-22 10:44:02 UTC
I've looked into the com.google.inject.binder.AnnotatedBindingBuilder  which was causing this problem in the Jesee's case and it does not even contain 
reference to java.lang.Map. Seems neither #3 causes this problem.
Comment 12 Tomas Zezula 2010-11-05 13:59:16 UTC
As mentioned above I am not able to reproduce it. If someone has a reproduceable test case (project refering to some jar causing this issue) please attach it and reopen.
Thanks
Comment 13 Jesse Glick 2011-09-02 20:41:43 UTC
Happening to me repeatedly in Glassfish sources; see exception reporter.
Comment 14 Jan Lahoda 2013-06-17 09:03:05 UTC
*** Bug 230767 has been marked as a duplicate of this bug. ***