Bug 219651 - Patch for harness: Netbeans HintTest helper throws "java.lang.NoSuchFieldError: RESOURCE_VARIABLE" while trying to run the auto-generated test on auto-generated hint service compiling against JDK_1.6
Patch for harness: Netbeans HintTest helper throws "java.lang.NoSuchFieldErro...
Status: RESOLVED FIXED
Product: apisupport
Classification: Unclassified
Component: Harness
7.2
All All
: P3 (vote)
: 7.3
Assigned To: Jaroslav Tulach
issues@apisupport
: SPACE_IN_PATH, TEST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-07 07:44 UTC by maks_t34
Modified: 2012-12-20 02:46 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
IDE log (124.19 KB, text/plain)
2012-10-07 07:44 UTC, maks_t34
Details
Project Test Build Output (11.89 KB, text/plain)
2012-10-07 07:47 UTC, maks_t34
Details
command line output on initial system configuration (3.12 KB, text/plain)
2012-10-10 19:36 UTC, maks_t34
Details
ant output on initial configuration (623.29 KB, text/plain)
2012-10-10 19:37 UTC, maks_t34
Details
command line output with JAVA_HOME set to JDK6 (207 bytes, text/plain)
2012-10-10 19:38 UTC, maks_t34
Details
ant output with JAVA_HOME set to JDK6 (1.21 MB, text/plain)
2012-10-10 19:39 UTC, maks_t34
Details
Proposed patch. (8.05 KB, patch)
2012-10-23 11:23 UTC, Jan Lahoda
Details | Diff
Test project (6.48 KB, application/zip)
2012-10-24 16:47 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maks_t34 2012-10-07 07:44:13 UTC
Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_26
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.1-b02

Reproduction steps:
1. Create new clean netbeans module project (File > New Project... > Netbeans Modules > Module) targeting Development IDE platform
2. Add Java Hint file (File > New File... > Module Development > Java Hint) with Fix
3. Add missing Unit Test Libraries (JUnit 4 was installed together with IDE)
4. Add Hava Hints Test API as unit test library
5. Test the project
Comment 1 maks_t34 2012-10-07 07:44:21 UTC
Created attachment 125523 [details]
IDE log
Comment 2 maks_t34 2012-10-07 07:46:56 UTC
When switching to JDK_1.7 as Java Platform the error doesn't reproduce and the tests runs OK.
Comment 3 maks_t34 2012-10-07 07:47:00 UTC
Created attachment 125524 [details]
Project Test Build Output
Comment 4 Jan Lahoda 2012-10-09 17:56:09 UTC
I apologize for inconvenience, but this:
requires.nb.javac=true
must be added to the nbproject/project.properties of the project (as described in the comment in the generated test). That will ensure the bootclasspath is tweaked correctly, but the apisupport wizard infrastructure does not allow to do that from the wizard.
Comment 5 maks_t34 2012-10-09 20:01:57 UTC
In my case even with
>> requires.nb.javac=true
the issue could be reproduced on my system. This line was in the project.properties when I was posting a bug.

This applies even to 7.3 beta I have on my PC.

Product Version: NetBeans IDE 7.3 Beta (Build 201210011125)
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_GB (nb)
Comment 6 Jan Lahoda 2012-10-09 20:55:58 UTC
Sorry, I did not understand from the description that you used the switch. I will check once I get to a Win 7 box - but in the mean time, if you could try to run the build with "-d" passed to ant and attach the output, that could shed some light on the problem.

Thanks.
Comment 7 maks_t34 2012-10-10 19:36:50 UTC
Created attachment 125714 [details]
command line output on initial system configuration
Comment 8 maks_t34 2012-10-10 19:37:29 UTC
Created attachment 125715 [details]
ant output on initial configuration
Comment 9 maks_t34 2012-10-10 19:38:04 UTC
Created attachment 125716 [details]
command line output with JAVA_HOME set to JDK6
Comment 10 maks_t34 2012-10-10 19:39:00 UTC
Created attachment 125717 [details]
ant output with JAVA_HOME set to JDK6
Comment 11 maks_t34 2012-10-10 19:39:40 UTC
Here are the builds with "-d" option:

1. build_command_line.log - is the command I have typed in command window without any modifications to my system
build.log - is the output of ant utility

Note: there was a warning about JAVA_HOME not set in command line. So next I have set the variable to JDK6 and JDK7

2. build_jdk6_command_line.log - is the command after JAVA_HOME was set to JDK6
build_jdk6.log - is the output in this case

3. When the JAVA_HOME is set to JDK7 everything runs OK
Comment 12 Jan Lahoda 2012-10-21 20:18:03 UTC
Luckily does not seem to be related to Windows (I was able to run tests there without problems), which would be harder for me to debug, but rather to path with spaces, and is reproducible on Linux as well.
Comment 13 Jan Lahoda 2012-10-23 11:23:24 UTC
Created attachment 126387 [details]
Proposed patch.
Comment 14 Jan Lahoda 2012-10-23 11:25:40 UTC
I have attached a proposed patch:
http://netbeans.org/bugzilla/attachment.cgi?id=126387
I can commit it, but needs to be reviewed by the NB harness and buildsystem developers before that.
Comment 15 Jaroslav Tulach 2012-10-23 12:13:17 UTC
I can't integrate the patch without an automated test included in a daily running test suite which would fail right now and will succeed after the patch is integrated. 

Translation to normal English: I don't have any clue of what is going on.
Comment 16 Jan Lahoda 2012-10-23 12:23:24 UTC
(In reply to comment #15)
> I can't integrate the patch without an automated test included in a daily
> running test suite which would fail right now and will succeed after the patch
> is integrated. 

If you expect such a test from me, then I would ask you to point me to existing test suite that I can extend.
Comment 17 Jaroslav Tulach 2012-10-24 16:21:09 UTC
Unless you can describe how to emulate the failure, I can't accept the patch.
Comment 18 Jan Lahoda 2012-10-24 16:47:43 UTC
Created attachment 126497 [details]
Test project
Comment 19 Jan Lahoda 2012-10-24 16:51:39 UTC
1. Make a copy of NetBeans in a directory with a space, e.g.:
/tmp/net beans
2. Download:
http://netbeans.org/bugzilla/attachment.cgi?id=126497
3. Unpack
4. Open in the IDE from step 1, and choose "Test" from the project's pop-up menu. An error like this will appear:
http://bugzilla-attachments-219651.netbeans.org/bugzilla/attachment.cgi?id=125524
5. Place another copy of NetBeans into a directory without a space, repeat step "4." - no error will appear.

(BTW: you would basically get the same by following the original steps, with the addition of adding "requires.nb.javac=true" into nbproject/project.properties mentioned in #c4 and #c5.)
Comment 20 Jaroslav Tulach 2012-11-30 10:03:53 UTC
I've did all I should:

~/tmp/219651$ ./net\ beans/bin/netbeans --userdir u\ d/

and the test seem to notice the space:

build-init:
Scanning for modules in /home/jarda/tmp/219651/net beans/webcommon
Scanning for modules in /home/jarda/tmp/219651/net beans/apisupport
Scanning for modules in /home/jarda/tmp/219651/net beans/websvccommon
Scanning for modules in /home/jarda/tmp/219651/net beans/nb
Scanning for modules in /home/jarda/tmp/219651/net beans/dlight
Scanning for modules in /home/jarda/tmp/219651/net beans/cnd
Scanning for modules in /home/jarda/tmp/219651/net beans/enterprise
Scanning for modules in /home/jarda/tmp/219651/net beans/java
Scanning for modules in /home/jarda/tmp/219651/net beans/ide
Scanning for modules in /home/jarda/tmp/219651/net beans/harness
Scanning for modules in /home/jarda/tmp/219651/net beans/profiler
Scanning for modules in /home/jarda/tmp/219651/net beans/platform
init:

but at the end the tests succeed. Maybe it will be easier if I stop by on Monday and let you show the problem to me?
Comment 21 Jan Lahoda 2012-11-30 11:34:39 UTC
And did you try on JDK6? But sure, stop by, but better on Tuesday or Wednesday
Comment 22 Jaroslav Tulach 2012-12-18 12:50:08 UTC
Reproduced the failure on JDK6 - after applying the patch, the failure is gone.
Comment 23 Jaroslav Tulach 2012-12-18 12:51:57 UTC
ergonomics#2feadc7db19e
Comment 24 Quality Engineering 2012-12-20 02:46:16 UTC
Integrated into 'main-golden', will be available in build *201212200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2feadc7db19e
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #219651: More robust handling of space in installaton path.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo