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 235684 - IllegalArgumentException: file:/home/aldo/.m2/repository/org/apache/derby/derby/10.10.1.1/derby-10.10.1.1-sources.jar is not a valid classpath entry; use a jar-protocol URL.
Summary: IllegalArgumentException: file:/home/aldo/.m2/repository/org/apache/derby/der...
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-09 11:14 UTC by aldobrucale
Modified: 2013-09-18 16:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 203695


Attachments
stacktrace (2.60 KB, text/plain)
2013-09-09 11:14 UTC, aldobrucale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aldobrucale 2013-09-09 11:14:43 UTC
This issue was reported manually by mjanicek.
It already has 14 duplicates 


Build: NetBeans IDE 7.3.1 (Build 201306052037)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b15
OS: Linux

User Comments:
aldobrucale: "run" action for an ant java project. I have created the library via the "create library" action in the "View artifact details" window of a maven project.

hildo: Attempting to start the JPDA debugger, attaching to the Jetty service hosting my Spring application.  The jar it's listing exists on my machine.  The process is listening on this port.

GUEST: debugging project

lostmats: happened since last update of  netbeans.
now I cant debug anything
This time it was a Junit test

GUEST: debugging program

hpk2987: Starting a debugging session

GUEST: debuuging project

GUEST: Trying to run a junit test by right clicking and executing "Debug Test File". No other operations were happening at this time.

aldobrucale: Tried to debug a  java application. The derby-10.10.1.1-sources.jar is actually invalid.

GUEST: debugging program

lostmats: just try to debug a junit test or production code, when having ireport installed

aldobrucale: Attached the debugger to a glassfish instance




Stacktrace: 
java.lang.IllegalArgumentException: file:/home/aldo/.m2/repository/org/apache/derby/derby/10.10.1.1/derby-10.10.1.1-sources.jar is not a valid classpath entry; use a jar-protocol URL.
   at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:100)
   at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:68)
   at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.<init>(SimplePathResourceImplementation.java:126)
   at org.netbeans.spi.java.classpath.support.ClassPathSupport.createResource(ClassPathSupport.java:77)
   at org.netbeans.spi.java.classpath.support.ClassPathSupport.createClassPath(ClassPathSupport.java:126)
   at org.netbeans.modules.debugger.jpda.breakpoints.ClassBasedBreakpoint.classExistsInSources(ClassBasedBreakpoint.java:301)
Comment 1 aldobrucale 2013-09-09 11:14:45 UTC
Created attachment 139823 [details]
stacktrace
Comment 2 Martin Entlicher 2013-09-09 13:46:05 UTC
It's ClassPathSupport.createClassPath(FileObject... roots), which creates the URL. If jar-protocol URL should be there, test the root for being a JAR.
Comment 3 Tomas Zezula 2013-09-17 14:18:40 UTC
>It's ClassPathSupport.createClassPath(FileObject... roots), which creates the >URL. If jar-protocol URL should be there, test the root for being a JAR.
Not true.
The ClassPathSupport.createClassPath(FileObject... roots) just converts the given FOs to URLs, it does neither magic nor garbage in garbage out anti pattern. It just converts the given arguments into URLs and delegates it to ClassPathSupport.createClassPath(URL...) which verifies pre conditions.
The called (debugger) is responsible for passing correct FileObjects (root of archives or folders).
Comment 4 Tomas Zezula 2013-09-17 14:20:36 UTC
For example the src.zip is an example of ambiguity where conversion of src.zip into src.zip!/ does not work as the archive has relocation.
Comment 5 Martin Entlicher 2013-09-18 14:55:57 UTC
Debugger correctly asks FileUtil.isArchiveFile(), but this test had to return false for these JARs. Despite this a different test for JAR files in SimplePathResourceImplementation fails.

This suggests, that the error occurs for empty or broken JARs.
Comment 6 Martin Entlicher 2013-09-18 16:34:01 UTC
Fixed by changeset:   264461:538f613a8a9d
http://hg.netbeans.org/core-main/rev/538f613a8a9d