While working through a programming book, I implemented a local REST service running in Tomact on port 8081 in the folder webapi (http://localhost:8081/lwchapter1/webapi/user/login). When running a request in Postman I get an error:
Could not send request
Error: connect ECONNREFUSED 127.0.0.1:8081
I dont understand, how to debug this and therefore kindly ask for help!
The service is implemented (as far as I understand) like this:
Postman to test the API
Tomcat to provide the service
compiled War File
maven as a build tool
java class listening for POST requests in a specific folder
The java project compiles, undeploy/ deploy works and the war file is in the tomcat folder, tomcat is running.
Edit: I found a developer console in Postman giving additional information. Unfortunately this doesn't help either since there is no parameter in the request:
Could not find on r. Missing or invalid parameter.
No revision id found for response
I found the solution by:
checking which ports are open and listened by using
netstat -a -n -p tcp | grep 127.0.0.1*
in the terminal
understanding in which folder the REST service listens by checking the actual java program
Thanks to #MattVickery for your kind help, I really appreciated it!
Related
i have a java spring app that runs just fine locally with gradle, but when i run the image version of it, i get a strange error that i am not sure how to resolve or debug
docker run -it --rm myregistry.azurecr.io/my-app:latest
is the command that i get the following error on:
I/O exception (java.net.SocketException) caught when processing request to {s}->https://rt.services.visualstudio.com:443: Invalid argument or cannot assign requested address
ive found out thru googling that this url https://rt.services.visualstudio.com:443 is associated with Application Insights (azure logging) which is one of my dependencies. does this mean something is wrong with logback?
the thing is, when i run with gradle, i see trace logs in the app insights instance i am trying to log to, so i know that connection is working outside of docker.
one thing to note is that in the deployed dockerized instance, i see the same logs on startup as the successful local gradle output, but then it dies after it sets the profile. maybe meaning that it is dying during the tomcat initialization.
what to do/try here?
this ended up being due to a web proxy issue, switching networks or creating a proxy rule are solutions.
In android client consuming my LoginService remote service, in order to connect user to the application.
I use gwt-syncproxy librairie to acces to my remote interface. And the following warning occured:
RpcPolicyFinder:No RemoteService in the classpath
followed by :
java.io.FileNotFoundException:
http:// localhost: . . . /. . ./application/application.nocache.js
Is there someone who had experienced this type of trouble ?
Please review the Android and CommonIssues wiki pages for the project as these clarify some common issues with the library.
In the meantime, more specifically, I often see this type of issue (though not this exactly) when the library has not been GWT-compiled or if the local server is not running where the Android app is expecting to find it. If you're not using App-Engine and are testing locally, make sure you are using Android's host Loopback interface with the #setLoginUrl method (GAELogin, Android Emulator networking).
Try posting the full error with details so we can see where it might be pointing wrong.
I think this issue is caused by a few reason:
1. You site is required login. And I checked the code of SyncProxy(0.5), it doesn't support if a site is secure.
2. SyncProxy will download some files from server side, for example:
compilation-mappings.txt
*.nocache.js
*.cache.html
*.gwt.rpc
If SyncProxy cannot download them, this error may occur, please check it these files can be download and the uri and name format of them is as default.
I was contacting with the owner of SyncProxy to improve this feature to support basic cookie/sessionid checking of auth.
https://github.com/jcricket/gwt-syncproxy/issues/46#issuecomment-89271311
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.
Hope you are doing well.I know there are many answers alike to the issue that i am going to ask but still no one seems to help.
Please help!!!
Issue:-
I am trying to connect to a secure website(HTTPS) using WebScarab, so that i can capture the traffic.Http is working fine for me.
For this i am using WebScarab as a proxy.
'client.getHostConfiguration().setProxy("127.0.0.1", 8008);'
but everytime i gets an exception (
SunCertPathBuilderException
) as stated above.
I have tried adding the website certificate to the Java using Keytool utility also.
I then added a proxy (reverse) entry in WebScarab (127.0.0.1 , 443) and changed the program to use it as a proxy server.
'client.getHostConfiguration().setProxy("127.0.0.1", 443);'
Then i got the following exception :-
org.apache.commons.httpclient.ProtocolException: The server stbeehive.oracle.com failed to respond with a valid HTTP response.
I also tried creating a .p12 certificate (for the website which i want to connect to) and importing it to WebScarab.
But inspite of all these methods i am not able to get the proper response.
I am using WebScarab as a proxy for firefox to capture its traffic and it is working fine (for both http and https).
Please help me as i have run out of ideas now :(
Are you using WebScarab or WebScarab-NG?
Please try WebScarab "classic", rather than the -NG variant. NG was a failed experiment, and no real effort was put into validating the client-side certificate functionality.
Also, what version of Java are you using, what operating system, 32 bit or 64-bit, etc, etc
Regards,
Rogan
I made a webservice that publish a wsdl file , here is the code
Endpoint.publish("http://localhost:"+args[0]+"/main/webServ", new WebServiceImpl());
and here is the procfile
worker: java -cp target/classes:target/dependency/* com.example.Publisher $PORT
there is no error in the log file and I got the port number from there lets say its "7435".
and when I run :
telnet whispering-beyond-3102.heroku.com
I got nothing
how can I access the webserice url ? , I tried to go to:
http://whispering-beyond-3102.heroku.com:7435/run/java/main/webServ?wsdl
I get no output
what URL should I use
If you are exposing a web service, you'll want to be defining a web process in your Procfile instead of a worker process. This will tell Heroku to inject the $PORT environment variable on app start up and route web requests to your app on that port. Web requests from the Internet to your app should be on the default 80 (or 443 for HTTPS) and then Heroku will route the request to your app on the provided $PORT. Once you fix the Procfile, you should be able to access your web service at (on default port 80):
http://whispering-beyond-3102.heroku.com/run/java/main/webServ?wsdl