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 56292 - [41cat] Compiled status doesn't show correctly
Summary: [41cat] Compiled status doesn't show correctly
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 4.x
Hardware: PC All
: P4 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-11 16:59 UTC by llturro
Modified: 2007-11-15 13:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Compile status (74.71 KB, image/jpeg)
2005-03-12 12:51 UTC, llturro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description llturro 2005-03-11 16:59:11 UTC
[ BUILD # : Beta ]
[ JDK VERSION : 1.5.0_01 ]

Try this:
1) Clean & Build a project
2) All files' status will be 'not compiled' (binary icon)
3) Right-Click on a single file and choose 'Compile file'
4) Its status has changed to compiled (no binary icon)
Comment 1 Jesse Glick 2005-03-11 23:18:53 UTC
Umm... what?

After cleaning & building a project, all the uncompiled flags go away, as
designed (contrary to what you say).

After cleaning a project, the flags appear on all Java files.

After pressing F9 on one of those files, the flag disappears from it.

All working correctly for me.
Comment 2 llturro 2005-03-12 12:51:04 UTC
Created attachment 20799 [details]
Compile status
Comment 3 llturro 2005-03-12 12:55:16 UTC
Attached is a screenshot showing the wrong compile status after a Clean & Build.
The not-compiled state is removed only when pressing F9. It happened to me only
with this Enterprise Application (everything build from scratch)
Comment 4 Jesse Glick 2005-03-14 16:37:43 UTC
This is a J2EE project, reassigning accordingly.

No steps to reproduce from scratch -> INCOMPLETE for now.
Comment 5 Andrei Badea 2005-03-14 17:12:27 UTC
Tried it too, can't reproduce. Do you get the same behavior with a new project?
Do you get the same behavior with any other projects too? Could you post a
*very* simple project in which you still can experience the bug? 

Is the project on the screenshot included in an enterprise application?
Comment 6 llturro 2005-03-15 10:57:05 UTC
The project was created form scratch, option I prefer from previous experiences
with web applications. This is what I did:

1) Created a new Enterprise Application.
2) Created a new EJB Module.
3) Created the EJBs.
4) Added 'Bussines methods' and filled with old application code.
5) Added the EJB Module to the Enterprise Application.

Looking further I found that 'build' creates:
project
  build
    ear-module
      packages and classes

whereas 'Compile single F9' creates:
project
  build
    jar
      packages and classes

which is what sets the compile status.

Tough the Enterprise Application was a renamed project, iaejb is a brand new EJB
Module, due NB4.1 demands a separated project.

Comment 7 llturro 2005-03-15 11:08:03 UTC
It doesn't happen with other projects, only with the EJB Module.
Comment 8 Andrei Badea 2005-03-16 07:51:54 UTC
I can reproduce it now. If I do clean & build on the EJB module, everything is
fine. If I do it on the enterprise application which the EJB module was added
to, files status is 'not compiled'.

I experience this behavior in the Web project as well.
Comment 9 Andrei Badea 2005-10-07 18:38:01 UTC
This is caused by the fact that the classes are built to different directories
based on whether you build only the EJB project or the whole enterprise
application. When you build only the project, they go to ${build.classes.dir},
otherwise they go to ${build.ear.classes.dir}. 

Not sure about the fix. I have two ideas:

1. Could add to the project's FileBuiltQueryImplementation both
${build.classes.dir} and ${build.ear.classes.dir} for each source root.  This
solution has the obvious disadvantage that you could have half the files
compiled in the one build directory and half in the other one -- the project
would look compiled, but that wouldn't be true. Moreover, this use case is
currently not supported by AntProjectHelper.createGlobFileBuiltQuery(), which is
used to implement FileBuiltQueryImplementation.

2. Could just always build to one directory. Not sure why the decision to build
to different directories was taken. Pavle, do you know why?
Comment 10 Petr Blaha 2006-03-13 13:47:44 UTC
TM 5.0 -> TBD
Comment 11 Andrei Badea 2006-05-25 15:05:39 UTC
Reassigning to Pavel for evaluation. Pavle, please see my last post.
Comment 12 Pavel Buzek 2006-07-13 19:29:57 UTC
The reason for having 2 different build directories for EJB module is that
packaging of libraries is different. When building standalone module build
includes jar files into the module, when building EAR it includes them into the
EAR and adds manifest entries into EJB module's manifest. The Java classes are
always compiled in the same way. The reason why we do not put compiled classes
into one location is that creating jar file is easier and also possibly for
directory based deployment (though I am not sure if/how that works for ejb
module). I think we could compile classes into one location. If directory
deployment is an issue (I will have to check this) then we would compile classes
into the directory where the standalone module gets compiled and when including
the module into EAR we would use these classes to build the jar file.
Comment 13 Pavel Buzek 2006-07-13 23:34:28 UTC
App server is not actually using directory deployment for EJB modules. J2EE
server makes it theoretically possible but it is not used.
One correction to my previous proposal: If we copy classes into build\jar and
then want to copy them into build\ear-module we would need to filter out other
files. We could filter */**.class but it is not 100% bullet proof (if the user
puts .class file into sources folder...). 

Sooo.. we should probably compile classes to a separate directory, e.g.
build\classes and then use them to build the jar file together with build\jar or
build\ear-module as needed. If we find issues with directory deployment we would
fix them by copying build\classes into build\jar and/or build\ear-module, but
for now it is not really needed.

Andrei, let me know if this makes sense and if you want to fix this or you want
me to take it. Thanks.
Comment 14 Petr Jiricka 2006-08-25 14:01:29 UTC
Is this even a P3 bug? Sounds like a P4 to me.
Comment 15 Andrei Badea 2006-09-11 21:07:05 UTC
Yes, it seems this qualifies as a P4 according to the guidelines ("incorrect
behavior that doesn't affect functionality").
Comment 16 Jiri Prox 2007-09-17 20:32:37 UTC
Obsolete milestone, please reevaluate
Comment 17 Andrei Badea 2007-11-15 13:27:01 UTC
Not valid anymore, the project is built to a single directory in 6.0.