I'm trying to get my Java code in Eclipse to access the internet, through an authenticated proxy. My code is simply reading a website source using http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html
I get this error:
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
Here are the things I already tried:
- In Preferences, setting the HTTP and HTTPS proxy, clearing SOCKS, and going to Manual
- In Eclipse.ini, adding
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyPort=8080
-Dhttp.proxyHost=XXX
-Dhttp.proxyUser=XXX
-Dhttp.proxyPassword=XXX
-Dhttp.nonProxyHosts=localhost|127.0.0.1
You need to be aware that what you are setting, is the settings for the JVM in which Eclipse runs. Your programs are started in another JVM where these settings do not apply.
Running your application creates a launch configuration, which you can open and add the system properties you need. They will then apply when that launch configuration is launched.
(also, Eclipse has a very elaborate network settings panel in the preferences window where you can configure this for Eclipse itself).
Related
Please correct me if I did anything wrong:
I created a web service (WSDL) in Java and it has a method TestCall().
I also created a website http://testwebsite:8000/abc/index.html, and this website is calling the web service in step 1.
I created a remote debugging for it in IntelliJ. I put testwebsite as the host and 8000 as the port number.
Once I went to http://testwebsite:8000/abc/index.html and click on TestCall(), it didn't go to the breakpoint in IntelliJ. When I was trying to remote debug the web service, I got error:
Unable to open debugger port (testwesite:8000), handshake failed, connection permanently closed.
Can someone tell me what steps I missed? thanks
When you need to remotely debug an application, go to the settings (Run->Edit configurations) in IntelliJ.
Now click the + sign and add a Remote configuration. It tells you the command line to add to the startup of the JVM you start on the remote machine. It will be something like:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 for jvm 5-8.
Now you can start your remote web service on the server with these extra command line options. Then you start this configuration in IntelliJ. It will tell you Connected to target VM, address: 'server name', transport: 'socket'. You can add breakpoints as you are used to with local debugging.
As you see: the remote debugging does not use the web-port, but a different port that is opened especially for debugging purposes. If there are firewalls between the server and your workstation, please choose a port that is open, or have the firewall port opened (if possible).
I have tried to install Java EE 7 with updatetool to be able to run Java EE Tutorial examples.
But the installation of updatetool fails. I have tried to start updatetool installation from the command line on my elementary os, then I saw the error when installing updatetool.
Here is an image: http://oi58.tinypic.com/x6iumx.jpg
Error text example 1:
Input/output error: Connection failed for URL http://pkg.oracle.com/javaeesdk/7/native/release/manifest/0/updatetool#2.3.5%2C0-56.2852%3A20111207T211721Z: 503: Service Temporarily Unavailable
Could not download application packages. This could be because:
- a proxy server is needed to access the internet. Please ensure that
the system proxy server settings are correct, or set the 'http_proxy'
environment variable to the full URL of the proxy server.
- the package server or network connection is slow.
If you are getting time out errors you can try setting the
PKG_CLIENT_CONNECT_TIMEOUT and PKG_CLIENT_READ_TIMEOUT
environment variables and try again. For example to increase
the timeouts to 300 seconds set them to 300
- the package server is down or otherwise inaccessible or it is
generating invalid data. Please contact the provider of the package
server.
Error text example 2:
File 138/564 Input/output error: Connection failed for URL http: //pkg.oracle.com/javaeesdk/7/native/release/file/0/217e83782a91f09fa7f35122412cd155263b107f: 502: Proxy Error
Could not download application packages. This could be because:
- a proxy server is needed to access the internet. Please ensure that
the system proxy server settings are correct, or set the 'http_proxy'
environment variable to the full URL of the proxy server.
- the package server or network connection is slow.
If you are getting time out errors you can try setting the
PKG_CLIENT_CONNECT_TIMEOUT and PKG_CLIENT_READ_TIMEOUT
environment variables and try again. For example to increase
the timeouts to 300 seconds set them to 300
- the package server is down or otherwise inaccessible or it is
generating invalid data. Please contact the provider of the package
server.
I don't use any proxy server. Help please!
I had the same - it's because their site is so unbelievably slow.
The output you showed tells you what to do, increase the timeout.
But sometimes it just needs to be run again, which worked in my case.
You can download the tutorial from Oracle Java EE 7 SDK download page.
Just download the latest Java EE 7 SDK, and unzip. The tutorial is inside the glassfish4/docs folder.
I have managed to install updatetool finally, after 3 days.
My advice for everyone who has the same problem:
Try installation several times in the morning, afternoon, evening and at night. And maybe once you will have successful attempt :)
The problem was not on my side.
Actually the apache-tomcat 7 server running at The Eclipse.but in browser getting error "The requested resource is not available." .Any reasons Please..?
When you start tomcat independently and type http://localhost:8080/, tomcat show its default page (tomcat has its default page at TOMCAT_ROOT_DIRECTORY\webapps\ROOT\index.jsp).
When you start tomcat from eclipse, eclipse doesn't have any default page for url http://localhost:8080/ so it show error message. This doesn't mean that tomcat7 is not running.when you put your project specific url like http://localhost:8080/PROJECT_NAME_YOU_HAVE_CREATE_USING_ECLIPSE will display the default page of your web project.
I had the same issue and for me, I tried changing the options in
Server Locations
and it worked.
Double click on the Tomcat Server under the Servers tab in Eclipse
Doing that opens a window in the editor with the top heading being Overview opens (there are 2 tabs-Overview and Modules).
In that change the options under Server Locations, and give Ctrl+S (Save configurations)
For me, Use Tomcat installation (takes control of Tomcat installation) worked
Try starting the server and checking if localhost opens in the browser. Else select a different option.
I do not understand why that issue came up. I did search but did not find a relevant answer(Maybe I didn't use the right keywords). If someone knows why that worked, kindly share.
Thanks.
There could be a number of reasons, have it as a checklist and go through it
Is your server running on 8080?I mean that is the default port but it could be configured to run on other.
Also there is a possibility that the default application is removed/uninstalled that is why it is giving "the requested resource is not available"
Also it could be a proxy issue. make sure you are not using any proxy in your browser.
1)Goto Server tab
2)Right on server -> general -> click on switch location.
3)Double click on the server -> under server location -> select tomcat installation.
4) restart the server.
It will be proxy configuration of your browser.
In NetWork Setting, use no proxy
For Manual proxy configuration add exception(No Proxy for in Firefox) like localhost:8080, localhost.
You may face two errors while testing tomcat server startup.
Error in the Eclipse inbuilt browser - This page can’t be displayed
Turn on TLS 1.0, TLS 1.1, and TLS 1.2 in Advanced settings and try connecting to https://localhost:8080 again. If this error persists, it is possible that this site uses an unsupported protocol. Please contact the site administrator.
404 error in the normal browsers.
Fixes -
For the eclipse browser error, check whether you are using secured URL - https://localhost:8080. This should be http://localhost:8080
For the 404 error:
Go to Tomcat server in the console. Do a right click, select properties. In the properties window, Click "Switch location" and then click OK.
Followed by that, Go to Tomcat server in the console, double click it, Under "server locations" select "Use Tomcat installation" radio button. Save it.
The reason for choosing this option is, When the default option is given as eclipse location, we will see 404 error as it changes Catalina parameters (sometimes). But if we change it to Tomcat location, it works fine.
Sometimes another software can be holding this door and it can be the cause of this conflict, try change the door on the server.xml.
Double click on the Tomcat Server under the Servers tab in Eclipse
Doing that opens a window in the editor with the top heading being Overview opens (there are 2 tabs-Overview and Modules).
In that change the options under Server Locations, and g
You can run below commands.
./catalina.sh run
Note: Make sure the port 8080 is open. If not, kill the process that is using 8080 port using sudo kill -9 $(sudo lsof -t -i:8080)
Many of us get this error after setting up the eclipse and server for first time. This solution is -
go to server tab
select the properties option of your respective server and expand it
in the properties window ,
select general tab -> click Switch Location -> click apply
->click ok.
This may work .
I'm trying to load my app in development mode using Chrome v. 20.0 on my local ip 127.0.0.1.
The app fails to load, and the following is displayed:
message:
"GWT Code Server Disconnected
Most likely, you closed GWT Development Mode. Or, you might have lost network connectivity. To fix this, try restarting GWT Development Mode and REFRESH this page."
on top of the previous message (overlaid):
"Plugin failed to connect to Development Mode server at 127.0.0.1:9997
Follow the underlying troubleshooting instructions"
This started to happen about 6-9 months ago and after 1 or 2 page refresh, the module loaded correctly. Now, i cannot load my app in dev-mode at all using Chrome. (in firefox
everything is ok).
I'm using GWT 2.4
UPDATE:
Those errors are not accompanied by any code stack trace output. Usually, if I changed the address form 127.0.0.1 to localhost, the module loaded, but this doesn't work any more...
Had the same problem. Deleting / reinstalling the plugin did the trick for me.
Check Automatically select an unused port of GWT from Run configuration.
My similar problem solved by this
I solved this in chrome by:
go to chrome://extensions/
locate GWT Developer Plugin
uncheck the Enabled box
check the Enabled box
Have a look at http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM
This page is supposed to be displayed in an iframe below the message (hence the message "underlying instructions", but Google has changed some server code on code.google.com and they now prohibit display within iframes, which is why it actually doesn't display.
FYI, the issue has been reported on GWT's issue tracker http://code.google.com/p/google-web-toolkit/issues/detail?id=7301
Your problem might be caused by improper gwt plugin setup. Go to your gwt developer plugin options (red toolbox right upper conner) in chrome and add your web and code server addresses. That worked for me.
Allowing "localhost" as webserver and code server made it work for me (although 127.0.0.1 was specified for both in the browser)
I have installed Jprofiler 7.1.2 & tomcat 5.0.19 on WINDOWS XP. I have created one session with 127.0.0.1 as host & 8849 as port.
After clicking on OK button getting message as
Could not connect to 127.0.0.1:8849. Please make sure that the remote address is correct, the remote program is started properly, and the network route allows socket connections.
What else do I need to setup? What should I put in the start & stop commands for profiled JVM settings?
That session will connect to a JVM where the profiling agent is already loaded.
To profile a JVM where the profiling agent has not been loaded, use
Session->Quick attach
in the JProfiler main menu.
The following check list can be used to resolve the issue:
Check if the JAVA_HOME is set to same version u r using for the application
Validate for right values/parameters for %JAVA_OPTS%
Set check box ON for VM Alive (under Settings -> Profile Settings)