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 153840 - Error cannot find symbol from an existing class in the library
Summary: Error cannot find symbol from an existing class in the library
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker with 2 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-25 10:16 UTC by psecheresse
Modified: 2016-07-07 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example project displaying the errors conatining the Sentinel jar (88.73 KB, application/x-compressed)
2008-11-25 10:19 UTC, psecheresse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description psecheresse 2008-11-25 10:16:22 UTC
This bug was already in NB 6.1, but without any real issue: one a the class display many errors, even the imports are
correct and the library contains the needed jar file. Since version 6.5, things are going worst as I cannot compile any
more. The associated jar file encapsulate some JNI calls for a Sentinel Superpro dongle key. The jar can be opened, the
class and the methods are displayed with the auto completion. When I switched from NB 6.1 to 6.5, the project was
compiling but since I cleared the project, I cannot compile any more:
 Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find symbol
 symbol  : class SentinelSuperpro
 location: package rainbow
Comment 1 psecheresse 2008-11-25 10:19:35 UTC
Created attachment 74123 [details]
Example project displaying the errors conatining the Sentinel jar
Comment 2 Jiri Prox 2008-11-25 14:33:58 UTC
Turn off Compile On Save (in project properties), it will bring back the old behavior at least
Comment 3 Jan Lahoda 2008-12-01 13:08:02 UTC
The main problem here seems to be that the SentinelManager/lib/rainbow.jar is broken. For example:
$ jar tf rainbow.jar
java.util.zip.ZipException: invalid entry size (expected 868548616 but got 439 bytes)
        at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:376)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:148)
        at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:92)
        at sun.tools.jar.Main.list(Main.java:863)
        at sun.tools.jar.Main.run(Main.java:212)
        at sun.tools.jar.Main.main(Main.java:1022)

Something similar happens when the IDE tries to read the file. The command line javac probably reads the jar using some
other way than the jar tool and the IDE. We might be able to workaround this (accept the broken jar file).

The problem seems to be that the local file header has the "Data Descriptor" bit set, but the "Data Descriptor" block
does not follow the file data.

The command line unzip tool was able to unpack the file for me. When I repacked the file (i.e. fixed it), the project
started to behave normally.
Comment 4 psecheresse 2008-12-02 06:06:23 UTC
Well done! Re jaring the librairy fixed the problem. I could not imagine that the jar was corrupted as it is used for
years without problem and Eclipse does not complain.
Comment 5 Rastislav Komara 2009-02-03 10:54:50 UTC
Overtake.
Comment 6 Jan Lahoda 2009-08-20 09:59:26 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 7 Martin Balin 2016-07-07 07:16:35 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss