I am using windows 8 (64bit) but not able to get access to internet using netbeans. When I am trying to update via Help > Check for Update I am getting
Check your network connection, verify that your proxy settings are configured correctly in the NetBeans IDE, or try again later.
When I am trying to access some url with a program in java I am getting error
connection refused: Address is invalid on local machine
whats going on here????
I need to force Java to use IPv4, to do so set it by command
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
Are you behind a proxy server? Go to Tools > Options > General and try to change the network settings according to your network config.
EDIT: It may also be a firewall issue.
Are you using a proxy server, because if you are then you will need to use a ProxyAuthenticator java class which will can be called within your Java class. This should allow your class to access the Internet.
However, it may be worth checking your NetBeans Internet settings (Tools -> Options -> General) and checking whether a HTTP Proxy authentication is being used. Even so, a ProxyAuthenticator Java class may still be required (assuming a Proxy server is being used). Please see Authenticated HTTP proxy with Java
Related
I am trying to access my Tomcat HomePage which is inside my Google Cloud VM Instance with External IP address 35.189.85.127 and Internal IP 10.154.0.2. On my local machine, in my browser I tried http://35.189.85.127 and http://35.189.85.127:8080 but got error
The connection has timed out. The server at 35.189.85.127 is taking too long to respond.
I have seen all the questions and replies on stackoverflow regarding this question but still I found no clear solution.
The steps that I've done so far:
I have setup a Google Cloud VM instance in Compute Engine. I am using Windows Server 2016 as the image.
Using RDP I log on to Windows Server.
I successfully installed Java 1.7 and Tomcat 7 on Windows Server.
I tested Java and Tomcat 7, both are working fine i.e. I open browser and type localhost:8080 and it shows Tomcat HomePage.
I replaced localhost with my VM Instance Internal IP i.e. 10.154.0.2:8080 and it again correctly shows Tomcat HomePage.
Now I try to access Tomcat HomePage using my VM Instance External IP (Static) 35.189.85.127 but in my browser I get error
The connection has timed out. The server at 35.189.85.127 is taking too long to respond.
Faced the same issue today.
Noticed from your question that you're using an Windows environment.
On Windows
Be sure that the Windows Firewall is properly configured to allow traffic under the ports you need (or deactivate it).
On GCP
Under "VPC Network/Firewall Rules", create a new firewall rule and configure as below:
Firewall Rule Parameters (image)
Or, you have the option to check the "Allow HTTP traffic" option under the Instance Configuration menu and edit Tomcat's server.xml to startup at port 80, as described here:
Change Tomcat Port Tutorial # StackOverflow
Option1: If it's just tomcat. GCP offers a click to launch Tomcat instance with an external IP. You can SSH and also have a temp tomcat username and password to manage any of your deployments.
https://console.cloud.google.com/launcher/details/click-to-deploy-images/tomcat
Option 2:
If you wish to have a Google Cloud VM instance in Compute Engine.
You will need to setup security groups and assign it to your instance.
Eg. Define rules to Open Tomcat port 8080(or any) externally / range. Assign that group/rule to your VM instance.
There are many options available, it all depends on how you wish to organize things. You could create a VPC and add your instances there or keep them under the same subnet or have them accessible externally etc.
I am using Eclipse 3.5 along with JDK 1.6.0_23 (both on Laptop and desktop) within my organisation. The proxy server uses Windows domain authentication to pass through request.
While adding update sites within Eclipse available on Laptop, I could see that Eclipse is able to connect the site and doesn't throw authorisation exception. I have set the Active Provider in Network Connections as Native. I haven't configured my credentials in eclipse anywhere and it communicates with Proxy server smoothly.
I have similar settings on my desktop machine, but it throws Proxy Authorization exception. There is no clue in Error log. But it does displays a information indicating
System property http.proxyHost is not set but should be XXX.XXX.XXX.XXX.
Similar messages do appear for http.proxyPort and https as well. I don't want to explicitly enter my credentials in Eclipse and hence looking for clues as why similar settings are behaving differently in these environments.
I had the same problem with eclipse luna. I tried this link
( http://javarevisited.blogspot.com/2014/01/eclipse-not-able-to-connect-internet-market-place-configure-proxy-settings.html ) and it helped me resolve the problem!
How do I set the Java proxy settings in Ubuntu (10.04 or 12.04), from the command line?
What I am aiming at is to get direct connection, but by default it takes it from browser settings which are meant to go via a proxy - just I don't want Java to go via the proxy.
I am running an application server in Ubuntu which serves remote desktop sessions. I can put the Java control panel into the user's desktop, and then they (each individual user) can set the proxy settings under Network Settings. However - this means I have to tell each user to make this setting, which is not workable.
I want it set via some command line or environment variable on the server itself, so it defaults to "direct connection". I am not familiar with Java programming and it won't help much to give me Java code for this, I think it must be possible to set the defaults upon Java startup? Any pointers are welcome.
How can I do this?
Instead of command line you can edit $javaDirectory/jre/lib/net.properties.
Remove # in-front of:
http.proxyHost="proxy host"
http.proxyPort="proxy port"
https.proxyHost="proxy host"
https.proxyPort="proxy port"
and set your proxy there.
You can export the http_proxy environment variable via command line.
Ex:
$ export http_proxy=http://proxy-server:port
There is a environment variable ftp_proxy also, just in case you need it.
I want to disable the network for testing like this solution in c#: How to simulate network failure for test purposes (in C#)? It suggests setting the ip to a bogus static address. How can I set the ip from Java or Groovy?
This solution is for windows. I'm using Mac.
How about setting a proxy for the JVM that drops all the requests ?
You wouldn't have to change your system configuration, proxy handling could be done via fixtures if you want some advanced properties.
That seems to me a way to explore
I'm trying to access WMI via j-interop (www.j-interop.org/), wich is a Java DCOM client.
However, I always get a "Access is denied" error.
Things I've tried:
disabled the Firewall
set permission on HKEY_CLASSES_ROOT\CLSID{76A64158-CB41-11D1-8B02-00600806D9B6}, which is the WMI component I'm trying to access
OS is Windows Server 2008 R2.
No luck. Any ideas?
maybe you could try additionally the following:
Is UAC active? If yes than disable it. (Note: You could also disable it only for Build In\Administrator or all Administrators, if you use one of these accounts)
Is the service remote registry started? If not start it.
Did you enable AutoRegistration? JISystem.setAutoRegisteration(true);
I hope this will help.