如何删除已分配给端口的当前进程/应用程序?
例如: localhost:8080
我正在尝试在Spring Boot网站上调整REST控制器示例.不幸的是,当我尝试访问localhost:8080/itemURL 时,我遇到以下错误.
{
"timestamp": 1436442596410,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/item"
}
Run Code Online (Sandbox Code Playgroud)
POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SpringBootTest</groupId>
<artifactId>SpringBootTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<javaVersion>1.8</javaVersion>
<mainClassPackage>com.nice.application</mainClassPackage>
<mainClass>${mainClassPackage}.InventoryApp</mainClass>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
</configuration>
</plugin>
<!-- Makes the Spring Boot app executable for a jar file. The additional configuration is needed for the cmd: mvn spring-boot:repackage
OR mvn spring-boot:run -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${mainClass}</mainClass>
<layout>ZIP</layout>
</configuration>
<executions>
<execution>
<goals> …Run Code Online (Sandbox Code Playgroud) 我正在运行Scott Allen的ASP.Net Fundamentals课程中的以下代码
using System;
using Microsoft.Owin.Hosting;
using Owin;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string uri = "http://localhost:8080";
using (WebApp.Start<Startup>(uri))
{
Console.WriteLine("Started!");
Console.ReadKey();
Console.WriteLine("Stopping!");
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseWelcomePage();
//app.Run(
// ctx => ctx.Response.WriteAsync("Hello Owin!"));
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当我运行控制台应用程序时,我收到一条消息
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.Net.HttpListenerExceptio
n: Failed to listen on prefix 'http://localhost:8080/' because it conflicts …Run Code Online (Sandbox Code Playgroud) 后端: Express 服务器,带有 npx create-express-api 后端
\n前端:Next.js,带有 npx create-react-app 前端
\n我已在根文件夹中实现了这些命令,并尝试运行 npm start xxx 来检查它们是否仍在工作。但他们没有在我的http://localhost:3000中工作\n尽管他们在这个链接中工作http://172.27.178.192:3000(在我的网络上)\n这是显示问题的图像
\n我更换了浏览器,仍然出现同样的问题。在浏览器上显示\n无法连接\nFirefox 可以\xe2\x80\x99t 建立与 localhost:3000 处服务器的连接。
\n我正在学习nodeJS。当我编写一个侦听端口的程序时,假设8081,然后编写另一个侦听同一端口的程序,我将得到以下类型的错误消息:
Error: listen EADDRINUSE
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1039:14)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at Object.<anonymous> (C:\NetBeansWorkPlace\nodeJS_Files\TutsNodeJS\static_file_server.js:36:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Run Code Online (Sandbox Code Playgroud)
我发现该端口正在使用中,但是如何清除该端口,或停止应用程序监听给定的端口?谢谢!世界银行
当我尝试启动我的基于java的服务器时,有一条消息说该端口已经在使用......并且我的所有Java Web服务器都已停止...所以,如果有人可以帮助我,我会很感激...