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 12568 - Wrong classpath being used by compilers/executors
Summary: Wrong classpath being used by compilers/executors
Status: CLOSED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC All
: P1 blocker (vote)
Assignee: Petr Jiricka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-06-03 23:21 UTC by _ gtzabari
Modified: 2008-12-22 19:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2001-06-03 23:21:52 UTC
build 201, dev

I cannot compile a standard JSP file (created using template)

This has been reproduced under WinNT and OS/2
Comment 1 _ gtzabari 2001-06-03 23:23:00 UTC
Also, I have verified that \netbeans\lib\ext\servlet.jar is indeed in the 
path and it contains the correct files. I have noticed that while editing 
standard Class files, I can see javax.servlet.* but under JSP files I 
cannot.
Comment 2 _ gtzabari 2001-06-03 23:31:31 UTC
I think I found the problem.. Looking into ide.log I noticed that 
whenever "java" is used, the entire CLASSPATH is passed after "java -cp" 
but when "javac" is used, only the project directories are placed after 
"javac -cp".

As a result, many files which must be placed on the classpath are 
missing. Servlet.jar being one of them.
Comment 3 _ gtzabari 2001-06-03 23:34:57 UTC
I have verified my hypothesis, forcing "servlet.jar" to be added after 
the default classpath statement fixes the problem. Netbeans stops 
complaining about "javax.servlet.*" and instead complains about "jasper" 
which is _also_ missing from the classpath.

This looks like an easy fix. Could you please take care of it as soon as 
possible? :)
Comment 4 _ gtzabari 2001-06-18 02:46:23 UTC
When JPDA is used, the shortened classpath is used as well. JAVA.EXE is 
indeed being used, but the classpath is wrong again.
Comment 5 _ gtzabari 2001-06-18 02:47:54 UTC
*** Issue 12945 has been marked as a duplicate of this issue. ***
Comment 6 _ gtzabari 2001-06-18 02:50:17 UTC
Assigning to CORE as this stretchs beyond a problem in WEB. Problem 
occurs in compiler/executor engines which (as far as I can tell) are the 
responsibility of CORE.
Comment 7 _ gtzabari 2001-06-18 03:23:00 UTC
This problem is even worse than I had originally thought. See issue 
#12945.. For all of the other mentioned problems I know how to manually 
add statements to CLASSPATH, but for the Bean problem I have no idea what 
has to be modified as no output shows up in IDE.LOG.

How does one find out what classpath is being used by the CUSTOMIZE BEAN 
feature?
Comment 8 _ gtzabari 2001-06-18 04:17:02 UTC
Argh.. I give up.. I keep on getting mixed behavior. One second I get one 
error, another minute I get another. I would really appreciate it if 
someone else could reproduce this problem. Meanwhile I'm going to 
reinstall my copy of Netbeans.

Issue #12945 is a big question mark. It might be related to this problem 
and then again it might not be. All _other_ issues I have mentioned are 
100% reproducable so you can rely upon them.
Comment 9 _ gtzabari 2001-07-31 19:49:12 UTC
Ok, this does it ;) I'm using Netbeans 3.2.1 under winNT 4.0 (fresh 
install) and this bug just showed up.. This is far worse than I had 
originally thought.. Picture this:

1) I have 4 mounted directories, one of which declares a class 
called "Object"
2) From another directory (not the one mounted with class Object) I 
try to compile a JSP file
3) The JSP file won't compile because "Object page = this;" is found 
in the servlet code (harded by the JSP compiler) and it fails to 
compile because it finds _MY_ version of Object which is declared 
within another (totally different) mounted directory.

   How screwed up is that? Umm, I'm going to mount this bug to a P1 
because its effects are far reaching (touches almost all modules) and 
quite severe. If you feel this is inapproriate, feel free to lower 
its priority to back to P2.

   It would be nice to get feedback from you guys about this issue, 
seeing as I have gotten none since reporting this bug back in June.
Comment 10 _ gtzabari 2001-07-31 19:51:09 UTC
Check out issue #8806.. It might be related. I didn't add the 
dependency to this issue, but you might consider doing so.
Comment 11 Petr Jiricka 2001-08-01 10:15:59 UTC
Your page does not compile because this is a problem with your page 
and your Java class, not with the IDE. Per Java language 
specification, your Object class will override the java.lang.Object 
class, and will be in the classpath before java.lang.Object.

The workaround is 

1) to give your classes better names, different than "Object"
or
2) put your class into a package
or
3) if you really want to have a class in the default package 
called "Object", you need to explicitly import java.lang.Object into 
your JSP, so it takes precedence over your Object:

<%@page import="java.lang.Object" %>
Comment 12 Petr Jiricka 2001-08-01 10:16:48 UTC
This is a user error, not IDE bug.
Comment 13 _ gtzabari 2001-08-01 13:05:51 UTC
You're not listening to what I said. My Object class is NOT within 
the same directory as my JSP file. In fact, it shouldn't be within 
the classpath of the compiler when I try to compile the JSP file, but 
it is; which is a bug.

If I have two mounted directories:

1) \work1
2) \work2

   where (1) contains my JSP file and (2) contains some definition of 
Object, compiling (1) should have nothing to do with compiling (2). 
They don't share a classpath.
Comment 14 Petr Jiricka 2001-08-01 14:41:29 UTC
The fact that all filesystems mounted in the IDE are included in the 
classpath (in the order in which they appear in the Filesystems) is 
actually by design. This is necessary for larger projects, which need 
to store files in multiple source hierarchies. Without this feature, 
it would not be possible to develop large projects in the IDE.

It can be seen from the IDE log that all filesystems mounted in the 
IDE are used in the classpath.
Comment 15 _ gtzabari 2001-08-01 17:17:20 UTC
I understand. Ok, so let me clarify: my original understanding was 
that each mounted directory represents a different project. How does 
one accomplish this sort of behavior in the current version?

I tried playing with Projects before and they were a big mess (very 
inconvient to use). It's much easier to simply use the EXPLORER tab.
Comment 16 Petr Jiricka 2001-09-07 13:15:27 UTC
Currently the support for Projects in the IDE is limited. Many things 
are not possible to accomplish with the current designs, so new 
project infrastructure needs to be introduced to cope with them. For 
now, the design is that all filesystem together constitute the 
classpath of a single project.

Given that, the behavior of JSP compilation behaves as designed.
Comment 17 Quality Engineering 2003-07-01 15:50:18 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified.

Comment 18 Quality Engineering 2003-07-01 16:45:10 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.