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 163169 - Run Failed due to JAXB Class Files Deleted at Runtime
Summary: Run Failed due to JAXB Class Files Deleted at Runtime
Status: RESOLVED DUPLICATE of bug 151845
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 02:02 UTC by rpoon
Modified: 2011-01-18 10:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project and screen shots files (111.10 KB, application/octet-stream)
2009-04-21 02:06 UTC, rpoon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rpoon 2009-04-21 02:02:19 UTC
Build: \\thumper\50builds\gfesb\v2.1\main\nightly\20090420-0723

The new ‘Compile on Save’ option under Java Application project’s properties (Java Application 
project/Properties/Build/Compiling), causing JAXB class file to be deleted at runtime.  This causes the project to fail 
at runtime with ‘Exception in thread "main" java.lang.NoClassDefFoundError’.

To reproduce:

1)Open the provided Java Application for JAXB.
2)Under the project’s properties/Build/Compiling, make sure to select ‘Compile on Save’ option (which is set by default 
when the project was created)
3)Clean and Build the project.
4)Check the generated jaxb class files under ‘Files’ tab:
5)Run the project. It will fail with:
  ‘Exception in thread "main" java.lang.NoClassDefFoundError: CreditReport/CreditReport’

Notice that the generated jaxb class files (shown above) were deleted once the project was run.

6)Do another ‘Clean and Build’ the project.
7)Go under the Files tab, and select the build.xml under the project and select ‘Run Target/run’ (as shown below) and 
the project will run fine:
Work-around:
     Under the project properties, de-select the project’s ‘Compile on Save’ option (as shown in step 2 above).  The 
the project will be able to run successfully.

(ticket filed under:  Issuezilla/Component = Java; Sub-component=j2seproject)
Comment 1 rpoon 2009-04-21 02:06:29 UTC
Created attachment 80553 [details]
Project and screen shots files
Comment 2 Jiri Prox 2009-04-21 11:36:56 UTC
What version of NB is bundeled? This should be fixed in final 6.5 - see issue 142360
Comment 3 rpoon 2009-04-21 16:36:45 UTC
NetBean 6.5.1.
Comment 4 Max Sauer 2009-05-18 16:17:28 UTC
Still reproducible in trunk. Errors are shown inside editor for JAXB-generated classes. Triggered by CoS.
---
Product Version: NetBeans IDE Dev (Build 090515)
Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-133
System: Mac OS X version 10.5.6 running on i386; MacRoman; en_US (nb)
Comment 5 Max Sauer 2009-05-19 13:13:47 UTC
After clean and build, everything seems to work fine. Maybe a build-impl.xml regeneration issue. It should be probably regenerated upon opening of 
project. Rpoon, could you please try again in a newer build?
Comment 6 rpoon 2009-05-22 16:35:07 UTC
You will only see the problem when run the project after built.

I have reverified with the very last build (\\thumper\50builds\gfesb\v2.1\gfesbv21\nightly\20090515-1455) and this is 
still reproducible.
Comment 7 rpoon 2009-05-22 16:41:15 UTC
The work around is to un-select the 'Compile on Save' selection under Compiling of the project properties.
Comment 8 Tomas Zezula 2011-01-18 10:37:08 UTC

*** This bug has been marked as a duplicate of bug 151845 ***