• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Maven setup is not working in Eclipse or Netbeans

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi-

When I am trying to setup Maven, got below error. I am not working under firewalls.

Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Permission denied: connect
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Permission denied: connect
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Permission denied: connect
Jun 04, 2013 3:07:48 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect

INFO: Retrying connect

Can some body help me.

----------Pratap
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you enter the URL from the error message in your browser, what happens?

You mentioned NetBeans and Eclipse. Is this output generated from inside one of them? If so, which one? Also, could you try running mvn from the command prompt and see if that does something different.

You you have a proxy server in your browser configuration? (Which OS and browser are you using, we can provide more specific debugging guidance if we know)
 
pratap tamatam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter-

I am able to access "http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom"; from browser.Below error message is generated from Netbeans.

Command prompt:-
C:\Users\pc>mvn -version
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
Maven home: D:\apache-maven-3.0.5\bin\..
Java version: 1.7.0_11, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.7.0_11\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
C:\Users\pc>

Command prompt eror-

C:\Users\pc>mvn archetype:generate
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Jun 05, 2013 7:57:06 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Permission denied: connect
Jun 05, 2013 7:57:06 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect
Jun 05, 2013 7:57:06 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the target host: Permission denied: connect
Jun 05, 2013 7:57:06 AM org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector tryConnect
INFO: Retrying connect


I am using Win7 OS. I do not have proxy. I have added ' _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true'as Env variable and disabled IPv6.

Thank you.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First thing I would do is upgrade to the latest JDK 7 - 7u11 is really old. Also, I don't have java.net.preferIPv4Stack set, try unsetting it. Finally, try running from the command line and not NetBeans.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I encountered pratap's problem (Permiission denied: connect) with a new laptop so was able to study it under more controlled conditions.
I think it is a firewall problem. I tried various other fixes that are recommended such as adding -Djava.net.preferIP4Stack=true to the command line, but these did not work.
I don't think the JDK was a cause, because I installed the latest JRE (8) and JDK (1.8)
The puzzle was also that my setup was working perfectly on an identical laptop (Yoga Pro running Windows 8.1) - I happened to have two for a brief while because the manufacturers had send me the wrong model. Only difference was memory size.
Also for this reason, a clean Windows 8.1 Install on both machines

The only differences between the setups that I could detect were
(1) the new machine (call it Yoga 2) was running ZoneAlarrm instead of McAfee
(2) the new machine could have downloaded some more recent Windows 8.1 upgrades. I don't know

To ensure a controlled environment I ran Maven from within Netbeans and set up a Maven Web Application project. The problem reproduces whether Maven is run from the command line or within NetBeans, but Netbeans gives more human-readable information (IMO as a relative Maven newbie)

What seemed to fix the problem was turning Windows Firewall off. I notice that Pratap says "I don't use Firewall" but I think it is the Windows default - at least for Windows 8 it is. So you have to consciously turn it off.

Here are the steps I took and what happened:

Uninstall Netbeans, Tomcat and Glassfish
Delete Netbeans directory in Documents
Delete .nb1 directory
Delete .m2 directory
Delete all Netbeans settings in Program Files
Delete all Netbeans settings in Appdata

JRE8 and JDK 1.8 not deleted

Download and re-install Netbeans "all" 8.0.1 with Glassfish and Tomcat enabled

Create a new Maven project (File->New->Maven->Web application
No change to Maven settings

Results

Project created and runs
Programme spends long time (>30 minuts) Importing the index
When it is finished, you can see .m2 has been populated
But the ''Services>Maven Repositories>Central Repository shows flickering 'looking for index' message

Now, the project will not build. Instead it reports that it cannot access the remote repository, with the error 'connect'

Next steps:

Disabled ZoneAlarm
Switched off Windows Firewall

Results:

Now it builds, also carries out a clean and build
Also after some downloading (<5 minutes) it displays the Central Repository
However, all this still succeeds after firewall is switched on - I suspect because it has downloaded all the dependencies that it needs.

I don't yet understand which selective Firewall Settings I should use to ensure that the Maven repository can be accessed but this should be clear from the error message ie repo1.maven.org or whatever repository the projects and plugins are trying to access.

I hope this helps somebody because the problem intrigued me but also held me up. I am sure many newbies encounter problems like this, for which there is a fix but it takes a while to find, and generally it is much harder at the early stage when you are still learning a new technology, because you can't even get to the point where the technology works, in order to study it. In this case I was lucky that it worked the first time, but not the second.

Cheers
Alan

 
straws are for suckers. tiny ads are for attractive people.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic