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 47657 - SourcesHelper.remarkExternalRoots () does not work on deleted folders
Summary: SourcesHelper.remarkExternalRoots () does not work on deleted folders
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords:
Depends on:
Blocks: 41537
  Show dependency tree
 
Reported: 2004-08-22 20:40 UTC by meliandra
Modified: 2009-12-21 04:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Attached changed properties file to anagrame game so it's not longer possible to debug (1.36 KB, text/plain)
2004-10-06 15:01 UTC, meliandra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description meliandra 2004-08-22 20:40:56 UTC
[ BUILD # : 200408191352 ]
[ JDK VERSION : J2SE 1.5.0 ]

There's no main project class defined.

So I start the debugger via Run -> Run Other -> Debug File.

The following output occurs

init:
deps-jar:
compile-single:
Key: PIC, Value: column0, column2, column4
Key: MC, Value: column1, column3
PICAccess: true MCAccess: false
PICAccess: false MCAccess: false
PICAccess: false MCAccess: false
PICAccess: false MCAccess: false
debug-single:
BUILD SUCCESSFUL (total time: 0 seconds)

But the debugger didn't stop on any defined breakpoint.

I tried "Run to cursor" 
 => start a window to search for the main project class
 => I'm wondering why this functionality is enabled in a non-debug mode

I tried "Step into"
 => That seems to compile the whole project.
 => I'm wondering why this functionality is enabled in a non-debug mode

There are a lot of open bugs regarding debugging. I found also some bugs that seem to be similiar. They are from March and closed. But it didn't work on my machine.
Comment 1 meliandra 2004-08-24 15:40:02 UTC
I get the feedback from the netcat group that this is a problem of the
used java platform.

If you use the default platform you can debug.

If you use another platform it doesn't work.
Comment 2 Jan Jancura 2004-08-24 15:55:05 UTC
Can not reproduce even with non default Platform.
It was probably already fixed.
Can you try to reproduce it on latest builds?
Comment 3 _ lcincura 2004-08-24 17:14:01 UTC
Reproducible on my machine (on beta1 build and also on build 200408231800)
Comment 4 Jan Jancura 2004-08-25 08:36:24 UTC
Lubo, can you specify exact steps how to reproduce it, please?
Is it random on your machine?
Do you think is it JDK 1.5 specific?
Comment 5 _ lcincura 2004-08-25 10:05:13 UTC
Steps to reproduce:
1, Create project with main class, put breakpoint in the main class
2, Set at least two java platforms
3, Invoke action Debug Main Project
4, Finish debugging session
5, Switch to another java platform
6, Enter empty line or space into source of main class (just to make
it compile before running in debugger, but do not compile it manually)
7, Repeat from step 3 => sometimes debugge does not start. In
debugging console is displayed only Listenning on #### and nothing
else happens.

It happens very rarely, thus I am lowering the priority.
Comment 6 meliandra 2004-08-25 10:46:51 UTC
This problems also occurs on JDialogs.

I've change also the target for the .class files.

I don't switch the java version during my work.

If I do the test with a JDialog and create a breakpoint before
starting the dialog. The dialog starts without stopping.

I've got some test classes that I can send you.
Comment 7 Jan Jancura 2004-08-25 16:28:22 UTC
Attach everything you have.
I am not able to reproduce it.
Comment 8 meliandra 2004-08-31 12:44:38 UTC
If installed the new q-build.

Debugging is not working on my system.
Comment 9 meliandra 2004-09-02 17:39:06 UTC
Is it possible that debugging not works if you change the jdk or the
target directory?

I have two projects. My work project and a test project with the
sample code.
If I create the attached class in the test project and set a
breakpoint to the first System.out the debugger stops on this line.

If I do the same on my work project the debugger never reachs the
breakpoint.

Can you please check if you change following entries in the
project.properties to

build.classes.dir=${build.dir}/codebase
build.dir=c:/ptc/wt626

Also compile your source with a different jdk 1.3.1_07.

/*
 * TestDebug.java
 *
 * Created on 2. September 2004, 18:34
 */

package com.toy.anagrams.lib;

/**
 *
 * @author  Administrator
 */
public class TestDebug {
    
    /** Creates a new instance of TestDebug */
    public TestDebug() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("xx");
        
        System.out.println("yy");
        // TODO code application logic here
    }
    
}
Comment 10 _ lcincura 2004-09-02 17:59:08 UTC
NetBeans build 2004080271257 on java 1.42_05 on Mac OS X

Today I had hard times with debugging on Mac OS X. The symptoms were
similar to this, except it was not working even on default platform.

I am rising priority, because when you come to this problem, you
cannot debug at all and no workaroud is known so far.
Comment 11 Jan Jancura 2004-09-03 09:13:15 UTC
Thank you for your report.
But this bug report is little bit confusing to me.
bug should contain:
1) ONE "how to reproduce" section
2) ONE description of target platform (OS, JDK, HW, IDE version)
3) ONE description if its random or regular.

Here in this bug report I see three JDKs, two platforms, several
usecases. Once this bug is random, but second time you "cannot debug
at all". I am simply missing some important and accurate information.

Lubo, Meliandra, can you do some clarification here?

For example:
"Reproducible on my machine" => whats your machine?
"hard times with debugging" => what does it mean?
"symptoms were similar to this" can you be more specific?

May be that this bug covers two different (similair) problems on two
different platforms (one is random, and one is regular). Feel free to
create two bugs for them in this case.

And can you attach you ide.log and output from Output Window, please?
Comment 12 _ lcincura 2004-09-03 09:20:20 UTC
To be more specific:

This bug is still random bug. But it seems, that probability of not
working bedugger varies depending on platform/CPU speed/some other
factors. My findings were, that on my WinXP machine debugging works
almost all the time (the only problematic case is, when I add another
paltform). On Mac OS X it did not work, I sucessfully started debugger
only once (= hard times with debugging). I had no luck to create
thread dump (the signal terminated debugged application), no
exceptions were in output.
Comment 13 _ lcincura 2004-09-07 15:56:27 UTC
Today I tested the debugger on mac again. Here is output from debugger.

[begin succesfull start]
S JPDAStart2 ***************
class: file:/Users/debugger/JavaApplication1/build/classes/
source : MasterFileObject@d4ddf0[file:/Users/debugger/JavaApplication1/src/]

S Crete sourcepath: ***************
    classpath : /Users/debugger/JavaApplication1/build/classes
    sourcepath : null
    bootclasspath : null
    >> sourcePath : ClassPath[Entry[file:/Users/debugger/JavaApplication1/src/]]

S start listening on port 52368

S StartActionProvider.doAction ()

S StartActionProvider.doAction () setStarting

S StartActionProvider.doAction ().thread

S StartActionProvider.doAction () end

S JPDADebuggerImpl.setRunning ()

S JPDADebuggerImpl.setRunning () - thread supended

S JPDADebuggerImpl.setRunning () - thread supended - VM resumed - end

S StartActionProvider.doAction ().thread end: success

S StartActionProvider.finish ()

S StartActionProvider.finish () VM exit

S StartActionProvider.finish () VM exception com.sun.jdi.VMDisconnectedException

S StartActionProvider.finish () end 
[end sucesfull start]

[begin unsucesfull start]
S JPDAStart2 ***************
class: file:/Users/debugger/JavaApplication1/build/classes/
source : MasterFileObject@d4ddf0[file:/Users/debugger/JavaApplication1/src/]

S Crete sourcepath: ***************
    classpath : /Users/debugger/JavaApplication1/build/classes
    sourcepath : null
    bootclasspath : null
    >> sourcePath : ClassPath[Entry[file:/Users/debugger/JavaApplication1/src/]]

S start listening on port 52370

S StartActionProvider.doAction ()

S StartActionProvider.doAction () setStarting

S StartActionProvider.doAction ().thread

S StartActionProvider.doAction () end

S JPDADebuggerImpl.setRunning ()

S JPDADebuggerImpl.setRunning () - end

S StartActionProvider.doAction ().thread end: success
[end unsucessfull start]
Comment 14 _ lcincura 2004-09-07 15:59:12 UTC
Would you be so kind and run the IDE with switch -J-Dnetbeans.debugger.start and try to 
debug? Please, attach then the console output.
Comment 15 meliandra 2004-09-08 08:15:20 UTC
init:
deps-jar:
compile-single:
S JPDAStart ***************
xx
yy
debug-single:
BUILD SUCCESSFUL (total time: 5 seconds)
--------
xx
yy

are the two print lines from my code
------- additional ant verbose

Detected Java version: 1.5 in: C:\Programme\Java\jdk1.5.0\jre
Detected OS: Windows 2000
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml
parsing buildfile
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml
with URI =
jar:file:/C:/Programme/netbeans-4.0beta-q/ide4/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml
parsing buildfile C:\Daten\Audi\build.xml with URI =
file:///C:/Daten/Audi/build.xml
Project base dir set to: C:\Daten\Audi
Importing file nbproject/build-impl.xml from C:\Daten\Audi\build.xml
parsing buildfile C:\Daten\Audi\nbproject\build-impl.xml with URI =
file:///C:/Daten/Audi/nbproject/build-impl.xml
Build sequence for target `debug-single' is [-pre-init, -init-private,
-init-user, -init-project, -init-macrodef-property, -do-init,
-post-init, -init-check, -init-macrodef-javac, -init-macrodef-junit,
-init-macrodef-nbjpda, -init-macrodef-debug, -init-macrodef-java,
-init-presetdef-jar, init, deps-jar, -pre-pre-compile,
-pre-compile-single, -do-compile-single, -post-compile-single,
compile-single, -debug-start-debugger, -debug-start-debuggee-single,
debug-single]
Complete build sequence is [-pre-init, -init-private, -init-user,
-init-project, -init-macrodef-property, -do-init, -post-init,
-init-check, -init-macrodef-javac, -init-macrodef-junit,
-init-macrodef-nbjpda, -init-macrodef-debug, -init-macrodef-java,
-init-presetdef-jar, init, deps-jar, -pre-pre-compile,
-pre-compile-single, -do-compile-single, -post-compile-single,
compile-single, -debug-start-debugger, -debug-start-debuggee-single,
debug-single, -debug-start-debuggee-applet, debug-applet,
-post-compile-test-single, -post-compile, -post-jar, -pre-test-run,
run-single, -pre-compile, -do-compile, compile, -pre-pre-compile-test,
-pre-compile-test, -do-compile-test, -post-compile-test, compile-test,
-debug-start-debuggee, debug, -debug-start-debugger-test,
-debug-start-debuggee-test, debug-test, -pre-jar, -do-test-run,
test-report, -javadoc-build, -pre-pre-jar, -do-jar-with-mainclass,
-do-jar-with-manifest, -do-jar-without-manifest, jar,
-pre-test-run-single, -post-test-run, -test-browse, test,
-javadoc-browse, javadoc, default, -pre-compile-test-single,
-do-compile-test-single, compile-test-single, -do-test-run-single,
-debug-start-debugger-stepinto, -post-test-run-single, deps-clean,
-do-clean, -post-clean, clean, -pre-debug-fix, -do-debug-fix,
debug-fix, debug-stepinto, -do-debug-fix-test, run, debug-fix-test,
test-single, run-applet, ]
-pre-init:
-init-private:
Loading C:\Daten\Audi\nbproject\private\private.properties
-init-user:
Loading C:\Dokumente und
Einstellungen\Administrator\.netbeans\dev\build.properties
Override ignored for property default.javac.source
Override ignored for property default.javac.target
-init-project:
Loading C:\Daten\Audi\nbproject\project.properties
Override ignored for property application.args
-init-macrodef-property:
-do-init:
Property ${platforms.Java_HotSpot_TM__Client_VM_1.3.1_07-b02.compile}
has not been set
Property ${platforms.Java_HotSpot_TM__Client_VM_1.3.1_07-b02.javac}
has not been set
Override ignored for property platform.javac
Property ${platforms.Java_HotSpot_TM__Client_VM_1.3.1_07-b02.java} has
not been set
Override ignored for property platform.java
Property ${manifest.file} has not been set
Unable to find ${manifest.file} to set property manifest.available
Found: test
Override ignored for property run.jvmargs
Property ${no.dependencies} has not been set
-post-init:
-init-check:
-init-macrodef-javac:
-init-macrodef-junit:
-init-macrodef-nbjpda:
-init-macrodef-debug:
-init-macrodef-java:
-init-presetdef-jar:
init:
deps-jar:
-pre-pre-compile:
-pre-compile-single:
-do-compile-single:
ext\TextDebug.java omitted as ext/TextDebug.class is up to date.
-post-compile-single:
compile-single:
-debug-start-debugger:
S JPDAStart ***************
-debug-start-debuggee-single:
Executing 'C:\ptc\jdk1.3.1_07\bin\java' with arguments:
'-Xdebug'
'-Xnoagent'
'-Djava.compiler=none'
'-Xrunjdwp:transport=dt_socket,address=localhost:1285'
'-classpath'
'C:\ptc\wt626\codebase\WEB-INF\lib\JGL.jar;C:\ptc\wt626\codebase\log4j.jar;C:\ptc\wt626\codebase'
'ext.TextDebug'

The ' characters around the executable and arguments are
not part of the command.
xx
yy
debug-single:
BUILD SUCCESSFUL (total time: 0 seconds)
Comment 16 meliandra 2004-09-10 22:36:00 UTC
I've got the error.

If I change the build.dir in the project.properties I'm not able to
debug. If I reset the value I'm able to debug.

Please take also a look to issue
http://www.netbeans.org/issues/show_bug.cgi?id=48284
Comment 17 Jan Jancura 2004-09-30 14:16:47 UTC
So, looks like the problem is solved.
Comment 18 meliandra 2004-10-05 16:57:49 UTC
It's not solved I just know why the problem occurs.

I've tested the scenario with the beta 2, too.

What I found out today is that it worked if I changed the names of the
build.dir and build.classes.dir.
But if I change it to build.dir=c:/xyz it doesn't work.

So what I found is a scenario how you can reproduce this issue and fix it.
Comment 19 Jan Jancura 2004-10-05 17:10:26 UTC
OK. Can you repeat the scenario from the begining, please?
Like:
1) Install fresh NetBeans
2)...
Comment 20 meliandra 2004-10-05 17:17:04 UTC
Today I have deinstalled all Netbeans 4.0 versions I have.
I've deleted the directories, too.
I've deleted the project data and the .netbeans/dev directory.
Then I have reinstalled the new beta 2.

After that I can reproduce this issue with the sample anagram game.
Comment 21 Jan Jancura 2004-10-06 09:30:47 UTC
I am still not able to reproduce. My usecase:
JDK1.5.0 final, Win XP, build 041004
1) install fresh NetBEans
2) start nb (no project opened)
3) open some simple J2SE project with "Make Project Current" property
unchecked.
((no main project is selected))
4) add line breakpoint on some XXX.java file
5) call Run Other - Debug "XXX.java" action
=>> debugger is started and debugger stops on breakpoint.
Sources View contains sources for opened J2SE project which contains
XXX.java file.

I am closing this bug because there is no DETAILED reproducible
testcase. I do not understand whats wrong.
Comment 22 meliandra 2004-10-06 09:37:15 UTC
What are the values for build.dir and build.classes.dir?

Did you changed it? Because the error only occurs if this two values
are changed.
Comment 23 Jan Jancura 2004-10-06 13:57:27 UTC
No. This params should not be changed as I know. Thats why it does not
work for you.
I have tested it and what works for me is:
1) change "build.classes.dir" property (where .class are stored)
build.classes.dir=${build.dir}/cls
2) change "src.dir" property (where .java are stored)
src.dir=src1
(and copy all my java files to new folder.

then you should exit&restart IDE.
and than debugger works. But again this it not standard supported
feature, as I know. You can ask projects guys on nbusers.
Comment 24 meliandra 2004-10-06 14:58:17 UTC
Do you have tried to change the entry 

build.dir=c:/something

(Just renaming the given directory isn't enough.)

Then it doesn't work.

I get the tip from Jiri how to change this stuff.

Because I can't work with the default entries.
Comment 25 meliandra 2004-10-06 15:01:09 UTC
Created attachment 18089 [details]
Attached changed properties file to anagrame game so it's not longer possible to debug
Comment 26 Jan Jancura 2004-10-06 15:22:36 UTC
As I wrote, you should not change build.dir, but build.classes.dir!
But I am not a project expert. Can you ask on nbusers how to do it
correctly, please?
Comment 27 Jesse Glick 2004-10-27 23:47:05 UTC
Steps to reproduce in 041027 custom, JDK 1.5.0:

1. Create anagram sample project: /tmp/ana

2. Edit /tmp/ana/nbproject/private/private.properties and add:

build.dir=/tmp/anabuild

(overriding the default of /tmp/ana/build)

3. Set a breakpoint in main() of Anagrams.java.

4. Debug project.

/tmp/ana/src is not listed in the debugger's Sources tab. You will hit
the breakpoint, and Run to Cursor works, but Step Over (etc.) do not.
Comment 28 Jesse Glick 2004-10-27 23:52:25 UTC
See XXX comment in J2SEProject.createLookup. Should be using
SourcesHelper.addNonSourceRoot, I think. The probable cause of the
problem is that there is no project owner registered for e.g.
/tmp/anabuild/classes in FileOwnerQuery.

User workaround: none known, other than to avoid using external build
dirs for j2seproject's.
Comment 29 Jesse Glick 2004-10-27 23:55:27 UTC
Suggested unit test: change build.dir to some random location in test
work dir, then try SFBQ on the new ${build.dir}/classes; should
produce ${src.dir}.

Not sure if P3 or P4 is more appropriate, since there is no GUI
support for making this kind of change anyway; but would certainly be
better for it to work properly if you do it.
Comment 30 David Konecny 2005-01-24 13:46:20 UTC
Tomas, moving java project specific issues to you for now.
Comment 31 Tomas Zezula 2005-02-16 14:35:51 UTC
Fixed the j2seproject part. J2SEProject registers build.dir to non
source roots, but the build fodler has to exist on disk. This may be a
problem because it is deleted during clean.
To reproduce the problem run J2SESourcesTest with uncommented line 74.

Checking in
j2seproject/src/org/netbeans/modules/java/j2seproject/J2SESources.java;
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SESources.java,v
 <--  J2SESources.java
new revision: 1.12; previous revision: 1.11
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/J2SESourcesTest.java,v
done
Checking in
j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/J2SESourcesTest.java;
/cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/J2SESourcesTest.java,v
 <--  J2SESourcesTest.java
initial revision: 1.1
done
Comment 32 Quality Engineering 2009-12-21 04:44:17 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team