相关疑难解决方法(0)

如何杀死Linux上特定端口上运行的进程?

我尝试使用./shutdown.shtomcat /bin目录关闭tomcat .但发现服务器没有正常关闭.因此我无法重启
我的tomcat正在端口上运行8080.

我想杀死运行的tomcat进程8080.我首先想要在特定端口(8080)上运行进程列表,以便选择要杀死的进程.

unix linux port kill-process

640
推荐指数
25
解决办法
100万
查看次数

Windows杀死进程的端口号

我在Spring Tool Suite IDE中使用嵌入式Tomcat服务器。我的问题是,当我运行我的项目时,出现以下错误,

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.
Run Code Online (Sandbox Code Playgroud)

有一些类似的问题,但是没有一个答案对我不起作用。

windows port cmd kill-process spring-boot

9
推荐指数
2
解决办法
6621
查看次数

尝试在 SASL 身份验证期间切换数据库目标

我尝试在 Spring Boot 项目中设置一个 Mongo DB。我在 application.yml 中设置了一个 uri:

spring:
  data:
    mongodb:
      uri: mongodb://user:pass@localhost:27017/mydbname
Run Code Online (Sandbox Code Playgroud)

但是应用程序无法从存储库读取数据并出现错误:

Attempt to switch database target during SASL authentication.
Run Code Online (Sandbox Code Playgroud)

发生错误的行(kotlin):

val emails = emailRepository.findAllByStatus(READY_TO_SEND)
Run Code Online (Sandbox Code Playgroud)

在哪里

interface EmailRepository : MongoRepository<Email, String> {
    fun findAllByStatus(status: EmailStatus) : Collection<Email>
}
Run Code Online (Sandbox Code Playgroud)

data class Email(
    @Id
    @get:JsonIgnore
    var id: String? = null,
    @get:NotNull
    val from: MailActor,
    @get:NotEmpty
    val to: Collection<MailActor>,
    @get:NotEmpty
    val subject: String,
    @get:NotEmpty
    val htmlText: String,
    val attachments: Collection<Attachment> = listOf(),
    val cc: Collection<MailActor> = listOf(),
    val bcc: …
Run Code Online (Sandbox Code Playgroud)

java mongodb kotlin spring-boot

6
推荐指数
2
解决办法
3919
查看次数

连接到多个mongo db主机,并在spring boot中使用其他数据库进行身份验证

我有一个与mongo db集成的java应用程序.我碰巧有3个mongo db主机(都有相同的端口),并且必须使用除我的应用程序使用的db之外的单独数据库进行身份验证.例如:"admin"是身份验证数据库名称,"contenttest"是我的应用程序要连接的db.我也有凭据(用户名和密码).我尝试使用以下uri进行连接,但它在spring boot应用程序中无效.

application.properties

spring.data.mongodb.authentication-database=admin
spring.data.mongodb.uri = mongodb://content_rw:<secret password>@a.mongo.db:27017,b.mongo.db:27017,c.mongo.db:27017/contenttest?wtimeoutMS=300&connectTimeoutMS=500&socketTimeoutMS=200
Run Code Online (Sandbox Code Playgroud)

我收到错误,说明以下错误日志的身份验证失败.

com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='content_rw', source='contenttest', password=<hidden>, mechanismProperties={}}
    at com.mongodb.connection.SaslAuthenticator.wrapInMongoSecurityException(SaslAuthenticator.java:157) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.SaslAuthenticator.access$200(SaslAuthenticator.java:37) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:66) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:44) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.SaslAuthenticator.doAsSubject(SaslAuthenticator.java:162) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:44) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.DefaultAuthenticator.authenticate(DefaultAuthenticator.java:32) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.InternalStreamConnectionInitializer.authenticateAll(InternalStreamConnectionInitializer.java:109) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:46) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113) ~[mongodb-driver-core-3.4.3.jar!/:na]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server a.mongo.db:27017. The full response is { "ok" : 0.0, "code" : 18, "errmsg" …
Run Code Online (Sandbox Code Playgroud)

java database spring mongodb spring-boot

4
推荐指数
1
解决办法
9136
查看次数

标签 统计

spring-boot ×3

java ×2

kill-process ×2

mongodb ×2

port ×2

cmd ×1

database ×1

kotlin ×1

linux ×1

spring ×1

unix ×1

windows ×1