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 182196 - Run Project dialog about compilation problems if use generated by ap classes
Summary: Run Project dialog about compilation problems if use generated by ap classes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-17 13:09 UTC by Sergey Petrov
Modified: 2010-03-19 05:14 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 Sergey Petrov 2010-03-17 13:09:04 UTC
steps:
create j2se with main class
add entity class (new|entity)
use attribute of metamodel type (entity name with '_' at the end) in main class
try to run the project

got dialog about "one or more projects was compiled with error".
reproducible with web project also (see 181693)
Comment 1 Sergey Petrov 2010-03-17 13:10:36 UTC
this dialog will appear once if source level is set to jdk5 and twice if source is set to jdk6
Comment 2 Sergey Petrov 2010-03-17 13:19:36 UTC
if I use metamodel from the same package I got only dialogs but main class is executed after "run anyway" selection, but if I use metamodel from another package I have 
"run:
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find symbol
  symbol:   class NewEntity2_
  location: package fff
        at javaapplication4.Main.<clinit>(Main.java:8)
Could not find the main class: javaapplication4.Main.  Program will exit.
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)"

looks more like p2 for me now.
Comment 3 Tomas Zezula 2010-03-17 17:06:31 UTC
The reason of this is following:
The clean & build works as it uses the ant script.
The run file works when Compile on Save is disabled.
The problem is when CoS is enabled and Run Processor in editor is disabled. The CoS just copies files from cache but the generated files are not available as the processors are disabled.

The solution is to enable processors in editor by default, I will do it for j2se project.
There will be 2 cases:
1st) When new j2se project is created the ANNOTATION_PROCESSING_ENABLED_IN_EDITOR will be true. This handles new projects.
2nd) When PU is added into the j2se project it will enable ANNOTATION_PROCESSING_ENABLED_IN_EDITOR if it's disabled (covers already created projects).
The same needs to be done for web project.
I will attach a link to j2seproject diff.
Comment 4 Tomas Zezula 2010-03-17 17:13:05 UTC
Fixed in jet-main: 9e04dc6d1aac
Comment 5 Tomas Zezula 2010-03-17 17:13:34 UTC
The j2se project diff: http://hg.netbeans.org/jet-main/rev/9e04dc6d1aac
Comment 6 Quality Engineering 2010-03-19 05:14:52 UTC
Integrated into 'main-golden', will be available in build *201003190200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bf2b14c1b5b7
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: fix #181693 made ap in editor support on by default (same as in #182196)