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 233601 - IllegalArgumentException: jar:file:/D:/Projects/ZZZ-EON/QQQ/YYY/../PPP/lib/jericho-html-3.3.jar!/ is not a valid classpath entry; it cannot contain current or parent dir reference.
Summary: IllegalArgumentException: jar:file:/D:/Projects/ZZZ-EON/QQQ/YYY/../PPP/lib/je...
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Grails (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
: 235691 235697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-29 15:09 UTC by otan
Modified: 2014-01-23 02:40 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The netbeans report I got when it tries to send the bug report. (300.68 KB, text/plain)
2013-07-29 15:09 UTC, otan
Details
Stack trace (1.96 KB, text/plain)
2013-08-12 16:47 UTC, otan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description otan 2013-07-29 15:09:07 UTC
Created attachment 137952 [details]
The netbeans report I got when it tries to send the bug report.

There's a long standing bug that doesn't get fixed because every time it is reported, it gets logged as a duplicate of something else, where in fact, this is a different bug.

When I run a project, the error comes out.

I'm attaching a stacktrace, maybe it can help to identify the cause of the bug. I think it has something to do with BuildConfig.groovy with lines like this:

grails.plugin.location.'xxx-common' = "../xxx-common"
grails.plugin.location.'xxx-plugin' = "../xxx-plugin"
Comment 1 otan 2013-07-29 18:26:49 UTC
Correction... the error comes out when I open the project, and it also comes out from time to time even if I'm just typing on the editor.
Comment 2 Martin Janicek 2013-07-30 08:06:54 UTC
Hi, could you please send me link to the bug you have mentioned? Eventually it would be good if you could attach also stacktrace from the time when the exception occurs (current attachment is just some kind of message log with no information about source code). Thanks in advance
Comment 3 Martin Janicek 2013-07-31 08:19:14 UTC
Closing as INCOMPLETE for now. Please reopen the issue with information requested in comment 2. Thanks in advance!
Comment 4 otan 2013-08-12 16:47:58 UTC
Created attachment 138603 [details]
Stack trace

Adding the requested stack trace.
Comment 5 otan 2013-08-12 17:10:46 UTC
When you report this kind of bug using the Netbeans bug reporter, it always logged as a duplicate of something else, but I can't recall what those bugs are and I no longer have access to the project to reproduce it. I attached the stacktrace I saved last month.

To see the mistaken duplicates, try google search and you will find that there are bugs in netbeans.org with similar subjects - http://www.google.com/search?q=%22+is+not+a+valid+classpath+entry%3B+it+cannot+contain+current+or+parent+dir+reference.%22
(first three results)

Bug reopened.
Comment 6 Martin Janicek 2013-08-13 07:17:57 UTC
Thanks otan, this is exactly what I needed. I'll take a look at it.
Comment 7 Martin Janicek 2013-08-22 12:21:45 UTC
Hopefully fixed by change-set: http://hg.netbeans.org/web-main/rev/7467eca5d3e6

Please since I don't have any reproducible test case, try one of the daily builds in a few days (the change needs to be propagated first). Thanks in advance
Comment 8 Martin Janicek 2013-09-09 14:08:55 UTC
*** Bug 235697 has been marked as a duplicate of this bug. ***
Comment 9 Martin Janicek 2013-09-09 14:10:22 UTC
*** Bug 235691 has been marked as a duplicate of this bug. ***
Comment 10 otan 2013-09-16 15:39:31 UTC
Hi again,

I'm sorry if it took me so long for me to give this feedback. I checked the diff for the fix and I think the fix does not addressed the bug to get the right solution.

From this code:
result.add(ClassPathSupport.createResource(entry));

modified to this code:
// #233601
String rootS = entry.toString();
if (!rootS.contains("/../") && !rootS.contains("/./")) {  //NOI18N
    result.add(ClassPathSupport.createResource(entry));
}

I think what the fix does is just filter out (ignore) the paths with /../ and /./ in the path components. The exception is avoided but the paths that should have been added intentionally is now left out; it then results to another bug due to some declared paths in BuildConfig.groovy are not being included.

The real fix should be to convert the paths to canonical/cleaned-up paths (so that there's no more /../ and /./) before adding it into the *result* collection.

The goal is to first make
jar:file:/D:/Projects/ZZZ-EON/QQQ/YYY/../PPP/lib/jericho-html-3.3.jar!/
into 
jar:file:/D:/Projects/ZZZ-EON/QQQ/PPP/lib/jericho-html-3.3.jar!/

before adding it to the result.

Thanks. I'm reopening this bug, feel free to close.
Comment 11 otan 2013-09-16 15:48:54 UTC
Sorry if I'm messing up the bug inventory... but I'm promoting this bug to Priority P2 because the presence of duplicates, and those similar exceptions that have been misfiled as a duplicate of something else unrelated, is an indication that this bug is something that occurs very frequently that should be fixed for the next release.

Thanks and please feel free to revert it back to P3 if you deem it not appropriate for P2.
Comment 12 Marian Mirilovic 2013-09-19 11:57:37 UTC
Martin, 
this issue is supposed to be fixed/waived in NB 7.4 ... could you please take a look and evaluate ASAP? Thanks in advance.
Comment 13 Martin Janicek 2013-09-25 08:38:50 UTC
(In reply to otan from comment #11)
> Sorry if I'm messing up the bug inventory... but I'm promoting this bug to
> Priority P2 because the presence of duplicates, and those similar exceptions
> that have been misfiled as a duplicate of something else unrelated, is an
> indication that this bug is something that occurs very frequently that
> should be fixed for the next release.

Hi Otan, thanks for taking your time to respond. The issue is quite rare actually (these duplicates you are talking about were reported manually by me because I was able to find the original issue you were talking about and I tried to split all duplicates to proper categories so it will be fixed on each side separately - there were mixed up reports from Grails/JavaDoc/Refactoring and many others). But even with those duplicates it occurs only few times every year which we normally consider as P3 problem.

Anyway I'll take a look at it so it will be at least available in night builds, so stay in touch ;)
Comment 14 Martin Janicek 2014-01-22 13:28:15 UTC
Fixed by change-set: web-main #d91c0964a5d2
Comment 15 Quality Engineering 2014-01-23 02:40:41 UTC
Integrated into 'main-silver', will be available in build *201401230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d91c0964a5d2
User: Martin Janicek <mjanicek@netbeans.org>
Log: #233601 - IllegalArgumentException: jar:file:/D:/Projects/ZZZ-EON/QQQ/YYY/../PPP/lib/jericho-html-3.3.jar!/ is not a valid classpath entry; it cannot contain current or parent dir reference.