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 195190

Summary: junit libraries not downloaded when using resolve references dialog
Product: projects Reporter: Kenneth Ganfield <kganfield>
Component: MavenAssignee: Jesse Glick <jglick>
Status: RESOLVED INVALID    
Severity: normal CC: mmirilovic, pjiricka
Priority: P2    
Version: 7.0   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 195123    

Description Kenneth Ganfield 2011-02-08 18:35:43 UTC
1. create web app
2. project is badged, so right-click project and choose Resolve References Problem.
3. Click Resolve in dialog. Dialog says Click Resolve to download or automatically define this library.

The IDE seems to try to download JUnit and opens Library Manager, but there is no JUnit library in the list of Libraries and no indication that JUnit was downloaded somewhere.

IDE log file displays the following:

INFO [org.netbeans.modules.java.project.BrokenReferencesCustomizer]
java.io.IOException: failed to download junit-4.8.2.jar
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.download(JUnitLibraryDefiner.java:211)
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.call(JUnitLibraryDefiner.java:125)
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.call(JUnitLibraryDefiner.java:110)
	at org.netbeans.modules.java.project.BrokenReferencesModel$OneReference.define(BrokenReferencesModel.java:538)
[catch] at org.netbeans.modules.java.project.BrokenReferencesCustomizer$3.run(BrokenReferencesCustomizer.java:198)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
WARNING [org.netbeans.JarClassLoader]: Opening /Applications/NetBeans/NetBeans 7.0 Beta 2.app/Contents/Resources/NetBeans/java/modules/ext/jaxws22/jaxws-tools.jar took 678 ms
INFO [org.netbeans.modules.progress.spi.InternalHandle]: Cannot process more work than scheduled. Progress handle with name "Downloading JUnit" has requested progress to workunit no.7 but the total number of workunits is 6. That means the progress bar UI will not display real progress and will stay at 100%.
java.lang.IllegalArgumentException
	at org.netbeans.modules.progress.spi.InternalHandle.progress(InternalHandle.java:265)
	at org.netbeans.api.progress.ProgressHandle.progress(ProgressHandle.java:174)
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.download(JUnitLibraryDefiner.java:207)
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.call(JUnitLibraryDefiner.java:127)
	at org.netbeans.modules.maven.junit.libdef.JUnitLibraryDefiner$1.call(JUnitLibraryDefiner.java:110)
	at org.netbeans.modules.java.project.BrokenReferencesModel$OneReference.define(BrokenReferencesModel.java:538)
	at org.netbeans.modules.java.project.BrokenReferencesCustomizer$3.run(BrokenReferencesCustomizer.java:198)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 1 Kenneth Ganfield 2011-02-08 18:36:59 UTC
Product Version: NetBeans IDE 7.0 Beta 2 (Build 201102052128)
Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03-307
System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb)
Userdir: /Applications/NetBeans/userdirs/7.0beta2
Comment 2 Yulia Novozhilova 2011-02-09 10:49:45 UTC
Redirecting to Maven.
Comment 3 Jesse Glick 2011-02-09 14:50:15 UTC
The download of JUnit artifacts from the Maven Central repository failed. Are you online? Behind a proxy? If you create a new Maven > Java Application and click Test Project, does it succeed?

Probably irrelevant since this impl is temporary for b2 and planned to be replaced after bug #195041 is implemented.

*** This bug has been marked as a duplicate of bug 195041 ***
Comment 4 Kenneth Ganfield 2011-02-09 16:18:38 UTC
This behavior is from behind a proxy, so I can understand why it failed.

I think the main issue for me is that there was no indication that the download failed. So this could be a UI issue that the user was only given the Libraries manager without an explanation of why.

The minimum should be a message that says download failed, please check your connection and proxy settings.
Comment 5 Jesse Glick 2011-02-09 17:08:52 UTC
Again, a rather different implementation is under preparation as part of bug #195041. I don't think it's worth tweaking the behavior of this one just for b2, but that's for b2 QE to decide.
Comment 6 Jesse Glick 2011-02-10 14:27:23 UTC
Was decided to handle this for b2. Should be able to fall back to direct HTTP download (without using Maven resolver & cache), which ought to work with the IDE's configured proxy settings.
Comment 7 Jesse Glick 2011-02-10 14:55:41 UTC
FWIW I cannot reproduce the reported problem so I cannot easily verify a fix. When I go on VPN and set my GNOME proxy settings to use wpad.dat (leaving the IDE to use system settings as by default), nothing works in the IDE (e.g. Hudson Builders). If I manually configure Oracle proxies in GNOME proxy settings, then e.g. Hudson Builders does work, but so does the Maven-based download (confirmed after deleting ~/.m2/repository/junit) without touching ~/.m2/settings.xml. Can try deliberately breaking my Maven settings.
Comment 8 Jesse Glick 2011-02-10 15:00:57 UTC
(In reply to comment #0)
> INFO [org.netbeans.modules.progress.spi.InternalHandle]: Cannot process ...

Side problem fixed in core-main #7bceb174a607.
Comment 9 Jesse Glick 2011-02-10 15:22:57 UTC
Bug #195296 shows that doing a direct download is not going to change behavior; the Maven embedder already effectively does this. The reporter's proxy was probably just not configured. Bug #195041 will result in a different UI anyway.
Comment 10 Jesse Glick 2011-02-10 16:02:29 UTC
(In reply to comment #8)
> Side problem fixed in core-main #7bceb174a607.

And backported to b2: releases #9dc121cf80b2