How to fix 'Localhost not found' when using dotnet run? - asp.net-core

I'm studying this learning module from microsoft
Learning WEB API
But I'm not seeing anything when I try to run dotnet run command on vscode terminal.
Hence, I got this Error 404
This localhost page can’t be foundNo webpage was found for the web address: https://localhost:7162/
HTTP ERROR 404
But my terminal displays :
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7162
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5043
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\John\Desktop\ContosoPizza\

404 means the request url is not correct, your controller does not contain any url with empty string. If you use default pure Web Api project, it only contains one get method in WeatherForecastController. The request url should be https://localhost:portNum/WeatherForecast(or api/WeatherForecast.It depends on the [Route] attribute on your controller. You can check the controller).
From your description, I think you may misunderstand dotnet run command. It is just used to build the project. You need manually open the browser and then browse to correct url(e.g. https://localhost:7162/WeatherForecast).
Actually your shared document is very clear here:

Related

OpenShift Origin: Getting started Build example : https error on pushing to registry

I am trying the learn OpenShift Origin, and was going through the Getting Started example. I did all steps prior to creating a new application that combines a builder image for Node.js. I can see I have configured the docker registry using oc adm registry.
But in the build logs I see an error as
Pushing image 172.30.134.94:5000/test/nodejs-ex:latest ...
Registry server Address:
Registry server User Name: serviceaccount
Registry server Email: serviceaccount#example.org
Registry server Password: <>
error: build error: Failed to push image: Get https://172.30.134.94:5000/v1/_ping: http: server gave HTTP response to HTTPS client
and the build fails.
What could be the possible issue. Is it some port I have not opened or something? I would really appreciate if someone can share some insight on this and on what I may be doing wrong to get things to work
Thanks
There was a fault in the setting up of insecure registries. Fixed it and things started working.

Selenium ChromeDriver Failed to load resource: net::ERR_CONNECTION_CLOSED

I'm using Codeception to run some acceptance tests using WebDriver and a Docker Selenium standalone server. I noticed that after one of my tests threw an error I get this logged:
[Selenium browser Logs]
13:59:52.345 SEVERE - https://ssl.google-analytics.com/ga.js - Failed to load resource: net::ERR_CONNECTION_CLOSED
Funny thing is that there isn't any google analytics on the page at all (or the app for that matter). I'm guessing that there is some anonymous usage analytics but can't tell whose it is, whether it's Selenium, Codeception or it's included libs, or even the ChromeDriver for Selenium. I run the Selenium server with --net=host and maybe that has something to do with it.
Anyone know how to turn these analytics off or let Codeception ignore failed external resources?
add the following entry to your local hosts file,
127.0.0.1 www.google-analytics.com
127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com
This works for all browsers, regardless of whether they support plugins. As long as you don't run a web server on your local machine, these connections are instantly rejected and so don't take very long to fail.
You could also try 0.0.0.0 (never personally tested by me though).
0.0.0.0 www.google-analytics.com
0.0.0.0 google-analytics.com
0.0.0.0 ssl.google-analytics.com
PS: 0.0.0.0, a null route, is better. If you're running your own web server you'll start to get 404s if your route to localhost.

Unable to access glassfish served content when using localhost

I created this simple dynamic web project (glassfish 4.1.1 latest atm) using eclipse java ee Mars.2 that I installed 2 days ago.
Checking on the admin, the app is deployed and running fine. I could not access the web app using the localhost:8080 url but it works when I use <computername>:8080.
I could access the admin using localhost:4848.
I tried disabling the firewall but the problem persists. What could be the problem?
The error is:
404 Not Found
No context found for request
In eclipse I see the log int he console that says: Automatic timeout occurred
As I pointed out in comments, you can configure listeners in Configuration -> needed configuration -> Network Config -> Network Listeners. However, it is still rather strange that your localhost doesn't work with 0.0.0.0 IP address, since it is a special address which means "listen on all available IPs on given port". Perhaps your network is somehow misconfigured.

Cannot open URL. Please check this URL is correct: http://localhost:8080/

I am using IntelliJ Ideea 13.1.4 and I encountered this error - after I Run / Debug my project, after "Artifact portal-webapp:war exploded: Artifact is deployed successfully"
I get this error but it has been working util now...
Do you Have any idea what should it be?
It appears Idea is trying to wait for your page to return 200 response and then open the external web browser. If this does not happen (e.g. your application returns a redirect due to authentication filters), Idea is just spamming your application with requests and then complains about not being able to open the web page.
I was on production profile but I don't know how I was building until now automatic on dev profile. Now I put a -Pdev to the mvn clean install command I had in a .bat file and all is ok.

Cloudbees java (non-web) application listening to port?

I tried to deploy java application on cloudbees, following this doc (http://developer.cloudbees.com/bin/view/RUN/Java+Container) and this guidelines (How do you deploy a non-web Java app through CloudBees Jenkins "Deploy Now" feature?) and finally managed to run my app on cloudbees, but... I can't connect to it.
In the logs I can see it started just fine, and is listening to port:
Starting spray can on 8464
[INFO] [06/11/2014 08:15:33.237] [on-spray-can-akka.actor.default-dispatcher-3] [akka://on-spray-can/user/IO-HTTP/listener-0] Bound to localhost/127.0.0.1:8464
My app is on http://spray-can.pawelstawicki.eu.cloudbees.net/, but when I go there, I can see only 502 Bad Gateway. I also tried http://spray-can.pawelstawicki.eu.cloudbees.net:8464/ but nothing there is even listening on the port.
What am I doing wrong?
I guess the problem here could be that you specified the port when it is injected as an environmental variable ($app_port). Your application should be reachable in http://spray-can.pawelstawicki.eu.cloudbees.net/. Also I think that the output "localhost/127.0.0.1:8464" doesn't sound really good.