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 39020 - Compiler output directory lost when switching projects
Summary: Compiler output directory lost when switching projects
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-20 17:52 UTC by tkellerer
Modified: 2007-09-26 09:14 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE (1.42 KB, text/plain)
2004-01-21 09:33 UTC, rmatous
Details
Execute with internal execution (1.54 KB, text/plain)
2004-03-11 14:34 UTC, Jaroslav Tulach
Details
Compiler settings for the first project (5.54 KB, text/plain)
2004-03-12 08:15 UTC, tkellerer
Details
Compiler settings for the other project (5.54 KB, text/plain)
2004-03-12 08:15 UTC, tkellerer
Details
logfile (22.04 KB, text/plain)
2004-03-12 08:16 UTC, tkellerer
Details
Please copy these files to java.jar to appropriate place and let me know whether the problem disappear (9.07 KB, application/octet-stream)
2004-03-12 10:27 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tkellerer 2004-01-20 17:52:03 UTC
When I switch between a J2EE project and a
"normal" project, the compiler output directory is
lost from the compiler definition.

Actually it seems that it is not updated, as it is
always set to "Invalid target" so I'm assuming it
is still "pointing" to the directory from the old
project (after switching)

The compiler output for the web project is set to
WEB-INF/classes on a CVS filesystem

The output directory for the "normal" project is
set to a local directory outside a CVS filesystem

This happens with the latest dev builds for 3.6
(January 18, 2004)

Windows XP and W2K
JDK 1.4.2_03
Comment 1 Jan Pokorsky 2004-01-20 19:35:08 UTC
Radku is this related to your last modifications in AutomountSupport?
If I switch to another project it takes some time the repository is
updated, especially web FS comes with some delay. In some cases it
cannot restore even open files located on a web FS. The switch ends up
with DataObjectNotFoundException.

In case you do not have any open file in the editor and you wait a
while everything works fine inclusive of the compiler output directory.
Comment 2 rmatous 2004-01-21 09:32:08 UTC
I played with switching projects (even with webFS) and didn't find any
problem - all filesystems were present. Files in editor were reopened
except NPE that seems to be caused by problems inside j2ee
(j2eeeserver) module. See attachement. 

Reassigned back for evaluation: if you can reproduce this bug then you
can test with e.g. month old revision of AutomountSupport and then
eventually reassign to me. Thanks.
Comment 3 rmatous 2004-01-21 09:33:26 UTC
Created attachment 12992 [details]
NPE
Comment 4 Jan Pokorsky 2004-01-21 12:28:05 UTC
You have to convert some mounted FS to web module in order to
reproduce it. IMO there is nothing what the java module could do in
the compiler setting to prevent this.
Comment 5 rmatous 2004-01-21 12:40:14 UTC
Fix: /cvs/core/src/org/netbeans/core/AutomountSupport.java
new revision: 1.53; previous revision: 1.52

Jan, please could you verify it and add comment before I close it.
Comment 6 Jan Pokorsky 2004-01-21 12:56:32 UTC
It works for me now.
Comment 7 rmatous 2004-01-21 12:57:56 UTC
Thanks. FIXED.
Comment 8 tkellerer 2004-02-05 08:24:23 UTC
It still doesn't work for me. 

I have one project with a CVS based web app directory 
and one CVS based "normal" java directory
This one has the compiler output set to WEB-INF/classes which is
inside the CVS filesystem

The other project does not have any CVS directories. Just one java
source file system and one filesystem for the classes. 

When I switch back and forth between the two projects, the compiler
output is always lost. No entries in ide.log though

I recreated both projects from scratch with the current dev builds (to
get the new CVS filesystems) but it still doesn't work.
Comment 9 Lukas Hasik 2004-02-26 17:33:37 UTC
Thommas, could you verify or reopen. thanks.
Comment 10 tkellerer 2004-03-10 09:42:40 UTC
I tried with 3.6 daily build from March, 8 and the problem is still
there. 

I started out with an empty User Dir. 
Created first Project:
Mounted a CVS directory with my Java classes
Mounted a CVS directory as a webapps directory -> it was regnoized as
a web module and the WEB-INF/classes was auto-mounted.
Then went into compiler options and selected WEB-INF/classes as the
output directory (btw: why isn't this done automatically :-)

Worked with the project

Created the second Project (same setup as above, but different CVS
directories obviously)

Worked (compiled) with that project, closed NetBeans

Reopened NetBeans, switch to first Project 
Go to compiler options, output directory read "Invalid target"

This is with WinXP, JDK 1.4.2_03 and Win2K JDK 1.4.2_02
Comment 11 _ ttran 2004-03-10 12:44:31 UTC
Yarda, please take over this issue.  Thx
Comment 12 Jaroslav Tulach 2004-03-11 14:33:02 UTC
I am sorry, I was not able to reproduce the problem. I tried to follow
your description and everything worked fine. I am not completely sure
why the problem should be in core, and in order to track it down I
have written small debug program that can help us find that. If you
ever run into the same problem again, please execute the Main.java I
am going to attach by internal execution and attach the output here.
That will allow us to correctly categorize the problem and hopefully
track it down.
Comment 13 Jaroslav Tulach 2004-03-11 14:34:29 UTC
Created attachment 13947 [details]
Execute with internal execution
Comment 14 tkellerer 2004-03-11 14:58:07 UTC
As I can reproduce this problem every time I change my projects, this
isn't a problem.

But when I open Main.java, I cannot compile it, because obviously I'm
missing the netbeans libraries. I installed the NetBeans API support,
but I still cannot compile it...
Comment 15 tkellerer 2004-03-11 15:01:50 UTC
Btw. would it help, if I attached an archive with the contents of the
two project directories from my userdir to this issue?
Comment 16 Jaroslav Tulach 2004-03-11 16:01:51 UTC
Re: compilation - please mount openide.jar into filesystems. It should
be in in nbinstalldir/lib/openide.jar. Then you should compile. Btw.
do not forget to set internal execution on the class.

Re: content of directories - it might help, but I prefer to see the
output of Main.java first
Comment 17 tkellerer 2004-03-11 16:15:34 UTC
Here is the output:

================== output start =======================
in lookup: SL[/CompilerType/External Compilation class: class
org.netbeans.modules.java.JavaExternalCompilerType its targetFSName:
org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/COL/repository/projects/opg/webapp:WEB-INF/classes its fs:
null
in lookup: SL[/CompilerType/Internal Compilation class: class
org.netbeans.modules.java.gj.JavaCompilerType its targetFSName: null
its fs: null
in lookup: SL[/CompilerType/JikesCompiler class: class
org.netbeans.modules.java.JavaExternalCompilerType its targetFSName:
null its fs: null
fs: SystemFileSystem instance:
SystemFileSystem[org.netbeans.core.projects.SystemFileSystem@29ea31]
fs: Mount/Javadoc/org-netbeans-modules-junit-junit-javadoc.xml
instance:
Mount/Javadoc/org-netbeans-modules-junit-junit-javadoc.xml[org.netbeans.modules.javadoc.search.environment.JavadocArchive@13d5f21]
fs:
Mount/Javadoc/org-netbeans-modules-web-core-resources-javadoc_jsp.xml
instance:
Mount/Javadoc/org-netbeans-modules-web-core-resources-javadoc_jsp.xml[org.netbeans.modules.javadoc.search.environment.JavadocArchive@30a895]
fs:
Mount/Javadoc/org-netbeans-modules-web-core-resources-javadoc_servlet.xml
instance:
Mount/Javadoc/org-netbeans-modules-web-core-resources-javadoc_servlet.xml[org.netbeans.modules.javadoc.search.environment.JavadocArchive@8be1c9]
fs:
Mount/Javadoc/org-netbeans-modules-xml-tools-resources-xml_apis.xml
instance:
Mount/Javadoc/org-netbeans-modules-xml-tools-resources-xml_apis.xml[org.netbeans.modules.javadoc.search.environment.JavadocArchive@1947647]
fs: Mount/java/org-netbeans-modules-form-absolutelayout-library.xml
instance:
Mount/java/org-netbeans-modules-form-absolutelayout-library.xml[org.netbeans.modules.java.environment.LibraryArchive@1e14de0]
fs: Mount/java/org-netbeans-modules-junit-junit-library.xml instance:
Mount/java/org-netbeans-modules-junit-junit-library.xml[org.netbeans.modules.java.environment.LibraryArchive@bfb545]
fs: Mount/java/org-netbeans-modules-junit-junit-testrunner.xml
instance:
Mount/java/org-netbeans-modules-junit-junit-testrunner.xml[org.netbeans.modules.java.environment.LibraryArchive@15cd9a]
fs: Mount/java/org-netbeans-modules-web-core-resources-library-jsp.xml
instance:
Mount/java/org-netbeans-modules-web-core-resources-library-jsp.xml[org.netbeans.modules.java.environment.LibraryArchive@16d46d7]
fs:
Mount/java/org-netbeans-modules-web-core-resources-library-servlet.xml
instance:
Mount/java/org-netbeans-modules-web-core-resources-library-servlet.xml[org.netbeans.modules.java.environment.LibraryArchive@145d424]
fs: c:\Programme\NetBeansDev\beans\TimerBean.jar instance:
c:\Programme\NetBeansDev\beans\TimerBean.jar[org.netbeans.modules.usersguide.UGModule$GlobalJarFileSystem@16a8823]
fs: org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/java instance:
org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/java[org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem@811340]
fs: org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/projects/lms/webapp instance:
org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/projects/lms/webapp[org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem@d68841]
fs: org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/projects/lms/webapp:WEB-INF/classes instance:
org.netbeans.modules.vcs.advanced.CommandLineVcsFileSystem
C:/Projects/LMS/src/projects/lms/webapp:WEB-INF/classes[org.netbeans.modules.web.context.DelegatingFileSystemVcs@588ec0]
fs: C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\struts.jar
instance:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\struts.jar[org.openide.filesystems.JarFileSystem@ef87ba]
fs: C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\activation.jar
instance:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\activation.jar[org.openide.filesystems.JarFileSystem@1b7e189]
fs: C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\classes12.jar
instance:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\classes12.jar[org.openide.filesystems.JarFileSystem@13825bf]
fs:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\log4j-1.2.8.jar
instance:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\log4j-1.2.8.jar[org.openide.filesystems.JarFileSystem@1365dcc]
fs: C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\mail.jar
instance:
C:\Projects\LMS\src\projects\lms\webapp\WEB-INF\lib\mail.jar[org.openide.filesystems.JarFileSystem@480e23]
fs:
c:/daten/netbeansdev/jakarta-tomcat-5.0.19_base/work/catalina/localhost/webapp
instance:
c:/daten/netbeansdev/jakarta-tomcat-5.0.19_base/work/catalina/localhost/webapp[org.openide.filesystems.LocalFileSystem@983fe1]
fs: C:\Programme\NetBeansDev\lib\openide.jar instance:
C:\Programme\NetBeansDev\lib\openide.jar[org.netbeans.core.ExJarFileSystem@84c71b]

================== output ends =======================

The first line is actually showing the problem: 

C:/Projects/COL/repository/projects/opg/webapp:WEB-INF/classes

belongs to the project which was active before I switched, and is not
mounted in the new project. The new project (LMS) should have 

C:/Projects/LMS/src/projects/lms/webapp:WEB-INF/classes

as the output directory.
Comment 18 Jaroslav Tulach 2004-03-11 16:36:10 UTC
Good and bad. 

This is definitively not problem in automount support. It is either in
java module or in filesystems. I will think about ways how to track it
down. 

Meanwhile Thomas please verify that your compiler is project and not
global. Tools/Options->Compilers/YourCompiler, and click on "<<" in
top-middle position this shall expand three new columns, and your
compiler should be in "Project" one. 
Comment 19 tkellerer 2004-03-11 17:57:12 UTC
Verifying the compiler options was actually the first thing I did.
Comment 20 Jaroslav Tulach 2004-03-12 07:55:22 UTC
So all the compilers are "project" ones. Ok. In such case please
attach here the actual compiler settings files please. This is what I
would do on my computer:

$ cd youruserdir
$ find . -name "*Java*Compiler*" 
./system/Projects/First/system/Services/CompilerType/JavaExternalCompiler.settings
./system/Projects/Second/system/Services/CompilerType/JavaExternalCompiler.settings
./system/Services/CompilerType/JavaExternalCompiler.settings
$ find . -name "*Java*Compiler*" | xargs zip Files39020.zip

Another interesting information would be output with logging turned
on. Please run with: runide.sh
-J-Dorg.openide.loaders.FolderInstance.Services.CompilerType=-5 and
attach the log file.

Comment 21 Jaroslav Tulach 2004-03-12 08:05:32 UTC
In the scenario you used to reproduce this problem you wrote: 
"Reopened NetBeans, switch to first Project"
can you instead of it do
"Reopened NetBeans, switch to Default(Empty) project, switch to first
Project"
and verify whether the problem appears in this case as well? In my
opinion the problem should disappear. 

The other solution to your problem should be: In one of your projects,
go to the Compiler Settings and create another instance of your
compiler using copy,paste. Then delete the original one. Everything
should work as before (as the compiler is there with the same
settings), but the bug during switching of projects should not appear.
Can you try it and let me know the result?

Comment 22 tkellerer 2004-03-12 08:14:16 UTC
Copy & pasting the compiler node did the trick, now it works fine and
the setting is remembered. 

I will attach the two compiler setttings files anyway, because I think
it would be fine if you could track that down. As the two projects
where created from scratch on an empty userdir.

I saved my userdir before doing the changes, so I will attach the log
file with the extended information as well
Comment 23 tkellerer 2004-03-12 08:15:02 UTC
Created attachment 13950 [details]
Compiler settings for the first project
Comment 24 tkellerer 2004-03-12 08:15:31 UTC
Created attachment 13951 [details]
Compiler settings for the other project
Comment 25 tkellerer 2004-03-12 08:16:06 UTC
Created attachment 13952 [details]
logfile
Comment 26 Jaroslav Tulach 2004-03-12 10:20:23 UTC
Both setting files contain reference to C:/Projects/COL/ which is not
good. Btw. locations of the files were
system/Projects/LMS/system/Services/CompilerType/ and
system/Projects/COL/system/Services/CompilerType/, I guess.

However I have no idea why they both refer to COL. The log file just
shows that there is new version of JavaExternalCompiler read from the
disk. I will try to provide some test case to proceed a bit further.

Anyway: because I am still not able to reproduce and there is a
workaround that works for you, I believe I can lower priority. That
way release36 will not be blocked by this issue. 
Comment 27 Jaroslav Tulach 2004-03-12 10:27:43 UTC
Created attachment 13957 [details]
Please copy these files to java.jar to appropriate place and let me know whether the problem disappear
Comment 28 tkellerer 2004-03-12 11:21:59 UTC
I tried the patch, and as far as I can tell, it fixes the problem

I will also try it on my other computer at home, because there the
problem is reproducable as well. 
Comment 29 Jaroslav Tulach 2004-03-12 12:48:13 UTC
When switching projects, the filesystems in repository are being
unmounted, which triggers the RepositoryListener R in JavaCompilerType
which in turn fires property change that it changed. Which is in fact
not true. 

There seems to be another possible problem in InstanceDataObject (it
saves an object which is no longer valid for it, so the object gets
saved into wrong project), but the root source of the problem is
JavaCompilerType firing and thus requesting save when in fact there is
no change.

This problem is not webapp specific, it can happen for any compiler
that has different target directory. Please fix it in java module. For
example by having property of type String targetFSName and special
property editor that will allow editing it in the way how current
editor works. By doing this you will not need to fire changes if there
is some change in the Repository.
Comment 30 Milan Kubec 2004-03-12 13:22:54 UTC
Please, make issue evaluated. Thanks.
Comment 31 _ ttran 2004-03-12 13:45:57 UTC
okay, i marked this as targeted for the next release, not 3.6
Comment 32 psuk 2004-06-22 18:03:21 UTC
The whole project system was rewritten and uses ANT now, so the bug is
not relevant in promoD. Closing as WONTFIX.