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 48672 - [gjast] Fatal Error: Unable to find package java.lang in classpath or bootclasspath
Summary: [gjast] Fatal Error: Unable to find package java.lang in classpath or bootcla...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-08 13:53 UTC by Lukas Hasik
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
part of messages.log (16.57 KB, text/plain)
2005-01-05 10:35 UTC, Lukas Hasik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hasik 2004-09-08 13:53:32 UTC
I just opened a file.

com.sun.tools.javac.util.FatalError: Fatal Error:
Unable to find package java.lang in classpath or
bootclasspath
	at
com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:120)
	at
com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:503)
	at
com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:389)
	at
com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:383)
	at
com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:777)
	at
com.sun.tools.javac.code.Symbol.complete(Symbol.java:354)
	at
com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:613)
	at
com.sun.tools.javac.comp.Enter.complete(Enter.java:448)
	at
com.sun.tools.javac.comp.Enter.main(Enter.java:426)
	at
org.netbeans.lib.gjast.ASErrorChecker.compile(ASErrorChecker.java:133)
	at
org.netbeans.lib.gjast.ASErrorChecker.parse(ASErrorChecker.java:52)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.initCheck(ResourceImpl.java:1168)
	at
org.netbeans.modules.javacore.jmiimpl.javamodel.ResourceImpl$ErrorList.size(ResourceImpl.java:1177)
	at
org.netbeans.modules.java.JavaEditor.refreshAnnotations(JavaEditor.java:379)
	at
org.netbeans.modules.java.JavaEditor.access$200(JavaEditor.java:70)
	at
org.netbeans.modules.java.JavaEditor$16.run(JavaEditor.java:1385)
	at org.openide.util.Task.run(Task.java:136)
	at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
	at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:686)
Comment 1 Tomas Hurka 2004-09-09 15:16:19 UTC
Please provide more details. I cannot reproduce it. 
Comment 2 Lukas Hasik 2004-10-27 14:11:10 UTC
I use NB + mobility pack
steps:
1, run IDE with userdir user1, create project P1, add new
emulator(platform) to it
2, run ide with new userdir and open the P1 project (there are
unresolved  reference problems)
3,open a file from P1 project
-exception in console appears

-it's enought to open file from project with unresolved reference
problems ;)
Comment 3 Martin Matula 2004-10-27 14:31:40 UTC
Tom, could the FatalError be transformed into an exception we could
catch? I think it is not a good idea to catch Error or Throwable. This
problem is nothing fatal, IMO we could just ignore it. The result is
that the error annotations will not be displayed if java.lang is
missing on a classpath. Or do you think it should be handled in a
different way?
Comment 4 _ tball 2004-10-27 16:40:51 UTC
Sure, I can catch the exception, change it, hide it, or wrap it up as
a present for you, but what is right?  I think turning it off is
wrong, as not having a path to java.lang suggests that the build
environment is very, very broken.  How can the project be built?  If
it can, then the real problem is that the correct classpath is not
being passed to the error checker.
Comment 5 _ tball 2004-10-28 21:29:35 UTC
gjast now throws a CompilerException wrapper for javac internal
exceptions and errors, which the error checker logs.  This eliminates
the scary message from the user's perspective, without hiding any
problems.
Comment 6 Lukas Hasik 2005-01-05 09:50:22 UTC
happend to me again with build 0501041900, FatalError printed to
console when opening java file from just opened project
Comment 7 Martin Matula 2005-01-05 10:26:48 UTC
Could you please attach the new stacktrace?
Comment 8 Lukas Hasik 2005-01-05 10:35:31 UTC
Created attachment 19485 [details]
part of messages.log
Comment 9 ehucka 2005-01-11 13:20:53 UTC
old target milestone, please re-evaluate
Comment 10 Martin Matula 2005-01-17 09:41:29 UTC
*** Issue 53440 has been marked as a duplicate of this issue. ***
Comment 11 Jesse Glick 2005-01-17 17:35:59 UTC
I would consider this bug P2, since at least for me it completely
prevents me from using basic features like Find Usages. What triggers it?
Comment 12 Martin Matula 2005-01-17 17:42:13 UTC
That's strange, because the exception comes from the ASErrorChecker,
which is only used to get syntactic and semantic errors for the file
when updating error annotations, so it should not have any impact on
"find usages" functionality. So, I doubt it has anything to do with
the broken "find usages". Maybe this exception may give us a hint that
something is wrong - in this particular case it seems that JDK was not
found on the classpath returned for a given file.
Comment 13 Martin Matula 2005-01-21 09:41:59 UTC
Tom, it seems that the FatalError still does not get wrapped by
CompilerException. Could you please check it?

Jesse, this does not seem to be the cause of your problems with find
usages, since this only means that errors underlining for some file
failed. This happened because the ClassPath.BOOT seems to not contain
the JDK (java.lang.* package).
I am changing this to P3, I will reopen your original issue, set its
priority to P2 and change the summary.
Comment 14 _ tball 2005-01-21 21:26:14 UTC
Lucas, please attach your system's copy of gjast.jar and reassign this
bug to me.  

Although your stack trace suggests that you have the latest code, the
FatalError appears to be ignored by a surrounding "try/catch
Throwable" block in ASErrorChecker.parse():

...
	try {
            in = request.getReader();
	    compile(filename, in);
	    return log.nerrors;
	} catch (Throwable t) {
	    throw new CompilerException(t);
	} finally {
...

  I decompiled my version of ASErrorChecker and the try/catch is
compiled correctly in my version.  Since FatalError is a subclass of
Error which subclasses Throwable, this missed catch may be due to a
JVM bug.
Comment 15 Martin Matula 2005-01-21 21:42:00 UTC
The exception seems to be caught and printed out in
ASErrorChecker.compile().
Comment 16 Martin Matula 2005-02-11 15:57:26 UTC
Tom?
Comment 17 _ tball 2005-02-14 17:16:44 UTC
Removed thread dump statement from code.
Comment 18 Lukas Hasik 2006-09-14 10:32:52 UTC
v
Comment 19 Quality Engineering 2007-09-20 09:55:50 UTC
Reorganization of java component