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 199481 - Some network connection failure can prevent the IDE from switching project group
Summary: Some network connection failure can prevent the IDE from switching project group
Status: RESOLVED INCOMPLETE
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on: 200074
Blocks:
  Show dependency tree
 
Reported: 2011-06-16 22:53 UTC by fabriziogiudici
Modified: 2011-12-20 19:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread Dump 1 (5.03 KB, application/x-gzip)
2011-10-23 15:36 UTC, fabriziogiudici
Details
Thread Dump 2 (5.38 KB, application/x-gzip)
2011-10-23 15:36 UTC, fabriziogiudici
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fabriziogiudici 2011-06-16 22:53:00 UTC
This evening I was working with NetBeans 7.0 on two computers, my Ubuntu 11.04 laptop and a Mac OS X 10.6 Mac Mini. Everything fine up to a certain point; then both IDEs all of a sudden weren't capable to switch the project group. The IDE didn't freeze (menus were still operative): they just did nothing when I asked for switching to another project group. I didn't see anything significant in the IDE log. Clearing var/cache (all but the Maven stuff) wasn't helpful.

After some minutes of shock because I frankly didn't understand how two IDEs could fail at the same time, I realized I had some network connection. In particular, I could connect only to some websites, while tracepath for others timed out (from the tracepath I guess there should be a problem with a router in the international connections). To be more precise, it's that kind of network problem that, instead of giving a "network connection" failure, keeps your sockets freezing for some time.

At this point, I completely disconnected my computers from the network and both IDEs resumed immediately the normal operations. I suspect this is related with the Maven repositories, since at least some of them (including my own mirror, configured in $HOME/.m2/settings.xml) are affected by the network problem.
Comment 1 Jesse Glick 2011-06-24 18:23:24 UTC
There should not be any code blocking project open which uses the online embedder, but there may be things I do not know about (e.g. recently fixed bug #199476). A thread dump (or self-profiler snapshot) is necessary to even begin evaluation of this kind of thing. Information about the projects and the state of your local repository may also be necessary for reproducing. Also check in a dev build to see if there is any difference in behavior.
Comment 2 fabriziogiudici 2011-10-23 15:15:47 UTC
It happened again a few minutes ago, this time under Ubuntu. I wasn't aware of any network disruption, but all of a sudden NetBeans behave as described here. I recalled of this bug and disconnected my laptop from the network. NetBeans now is fine.

I'm aware that this doesn't add a lot of information to the problem, still I think it's good to comment here. The previous comment helped me in this situation.
Comment 3 fabriziogiudici 2011-10-23 15:21:27 UTC
This time I was able to read something interesting in the log, when I restarted the IDE with the network disconnected. But unfortunately when I started visualvm to analyze the thing better, the strange behaviour disappeared.

I'm reopening this just to see whether this inspires somebody. 



INFO [org.netbeans.modules.exceptions.ReporterResultTopComponent]: URL Loading failed
java.net.UnknownHostException: statistics.netbeans.org
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:176)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
	at java.net.Socket.connect(Socket.java:579)
	at java.net.Socket.connect(Socket.java:528)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:483)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:213)
	at sun.net.www.http.HttpClient.New(HttpClient.java:300)
	at sun.net.www.http.HttpClient.New(HttpClient.java:316)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:992)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:928)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:846)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1296)
	at org.netbeans.modules.exceptions.ReporterResultTopComponent.uploadURL(ReporterResultTopComponent.java:327)
	at org.netbeans.modules.exceptions.ReporterResultTopComponent.access$800(ReporterResultTopComponent.java:74)
[catch] at org.netbeans.modules.exceptions.ReporterResultTopComponent$PageUploader.run(ReporterResultTopComponent.java:306)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 4 fabriziogiudici 2011-10-23 15:33:54 UTC
Ok, it blocks again so I've been able to get a thread dump. Actually the AWT Thread is blocked on monitor (dump 1). Killed NetBeans, disconnected the network, relaunched NetBeans and it's fine. Reconnected the network, launched a build on a Maven project and it blocks again. This time, not only the AWT but a large number of threads are blocked on monitor (Java Node badge processor, Default Request processor, exec_Build..., Error Annotation worker, org.netbeans.modules.project.ui.... and the AWT EventQueue-0.
Comment 5 fabriziogiudici 2011-10-23 15:36:21 UTC
Created attachment 112349 [details]
Thread Dump 1
Comment 6 fabriziogiudici 2011-10-23 15:36:38 UTC
Created attachment 112350 [details]
Thread Dump 2
Comment 7 fabriziogiudici 2011-10-23 15:37:06 UTC
Just for the record, the bug was originally opened on 7.0, I'm now running 7.0.1.
Comment 8 fabriziogiudici 2011-10-23 15:53:04 UTC
... and I finally got it. It's my Tomcat where I'm running a Nexus that is referenced by the project. Currently Tomcat is reachable, I can even connect to port 80, but every command I send (e.g. GET /) hangs forever. I restarted my Tomcat and now everything is fine. So the log about statistics.netbeans.org is not related to the bug.

If you look at the former thread dump, you'll see that the AWT EventQueue is blocked in a call related to Maven:

org.netbeans.modules.maven.configurations.M2ConfigProvider.getActiveConfiguration(M2ConfigProvider.java:250)

I think this is telling that when this strange situation occurs (a Maven project refers to a Nexus that it's stuck) the AWT event thread is blocked on the IDE.
Comment 9 Jesse Glick 2011-11-08 18:39:02 UTC
(In reply to comment #3)
> java.net.UnknownHostException: statistics.netbeans.org
>     ...at org.netbeans.modules.exceptions.ReporterResultTopComponent.uploadURL(ReporterResultTopComponent.java:327)

Means your network was in fact down, but otherwise unrelated.


...
	at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:441)
...
	at org.apache.maven.repository.legacy.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:352)
	at org.netbeans.modules.maven.embedder.MavenEmbedder.resolve(MavenEmbedder.java:260)
	at org.netbeans.modules.maven.embedder.NBRepositoryModelResolver.resolveModel(NBRepositoryModelResolver.java:103)
...
	at org.netbeans.modules.maven.embedder.EmbedderFactory.createModelLineage(EmbedderFactory.java:347)
	at org.netbeans.modules.maven.configurations.ProjectProfileHandlerImpl.getLineage(ProjectProfileHandlerImpl.java:103)
...

makes it look like the fix for bug #200074 would solve this as well. That was released as a 7.0.1 patch, but without a log file I cannot tell if you have the patch or that (org.netbeans.modules.maven.embedder 2.9.2 rather than 2.9.1). 7.1 includes the same fix and also an assertion which ought to more aggressively prevent network connections during project loading.
Comment 10 Jesse Glick 2011-12-20 19:04:27 UTC
No more info about whether this remains a problem after fixes in 7.1.