Spring Boot应用程序立即退出

2023-11-22

当我运行我的spring bootapplication ,它立即退出(与exit code 0) 有了这个:

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.0.RELEASE)

2018-11-27 14:08:31.219  INFO 94920 --- [  restartedMain] c.springbootsecurity.jwt.JwtApplication  : Starting JwtApplication on 1000810002637M.local with PID 94920 (/Users/723305/Documents/spring/springbootSecure/target/classes started by 723305 in /Users/723305/Documents/spring/springbootSecure)
2018-11-27 14:08:31.222  INFO 94920 --- [  restartedMain] c.springbootsecurity.jwt.JwtApplication  : No active profile set, falling back to default profiles: default
2018-11-27 14:08:31.252  INFO 94920 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2018-11-27 14:08:31.722  INFO 94920 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2018-11-27 14:08:31.743  INFO 94920 --- [  restartedMain] c.springbootsecurity.jwt.JwtApplication  : Started JwtApplication in 0.752 seconds (JVM running for 1.294)

Process finished with exit code 0

my pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.springbootSecurity</groupId>
    <artifactId>jwt</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>jwt</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

        </plugins>
    </build>        
</project>

因为你在 pom.xml 中启动了 spring boot,所以你没有声明为启动 Web 项目,它会 立即关闭,这是预期的行为,现在要作为 Web 容器运行,您需要在 pom.xml 中添加以下代码。

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Spring Boot应用程序立即退出 的相关文章

随机推荐

  • 实现哈希表

    我正在尝试创建一个有效的查找表C 我有一个整数作为键和一个可变长度char 作为值 我看过uthash 但这需要固定长度char 价值 如果我把这个数字设得很大 那么我就使用了太多的内存 struct my struct int key c
  • ASP.Net MVC 的计划控件 [关闭]

    这个问题不太可能对任何未来的访客有帮助 它只与一个较小的地理区域 一个特定的时间点或一个非常狭窄的情况相关 通常不适用于全世界的互联网受众 为了帮助使这个问题更广泛地适用 访问帮助中心 是否有适用于 ASP Net MVC 的任何商业或其他
  • MAMP Config 帮助,显示 PHP 错误

    我正在 Snow Leopard 上运行最新版本的 MAMP 我的 php ini 文件已配置为显示错误 显示错误 打开 phpinfo 页面显示错误报告状态 为打开状态 我已经多次重新启动我的网络服务器 我用Google搜索过 没有发现类
  • delete[] 如何“知道”操作数数组的大小?

    Foo set new Foo 100 delete set 您没有将数组的边界传递给delete 但这些信息存储在哪里 是否标准化 当您在堆上分配内存时 分配器将跟踪您分配了多少内存 它通常存储在您分配的内存之前的 头 段中 这样 当需要
  • 编写一个有 2 个线程交替打印的程序

    我最近在接受采访时被问到这个问题 编写一个具有两个线程 A 和 B 的程序 其中 A 打印 1 B 打印 2 依此类推 直到达到 50 我们该如何去做呢 分配的本质是演示一个线程如何向另一个线程发出信号 最常见的方法是使用阻塞队列 但这里信
  • 在Python 2.7中模拟按键事件

    我想要做的是在 Windows 上按 Python 脚本级别的任意键盘键 我尝试过 SendKeys 但它仅适用于 python 2 6 我尝试过的其他方法包括 import win32com client win32com client
  • 来自 ADFS 服务器的 URL 重定向

    我在 ASP net Web 应用程序中使用 ADFS 进行身份验证 STS服务器将浏览器重定向到https test contoso com 首先将客户端重定向到 STS 时 STS 不允许任何返回 URL 参数 是否可以将浏览器重定向到
  • 整数除法的行为是什么?

    例如 int result result 125 100 or result 43 100 结果总是分区的底线吗 定义的行为是什么 结果总是分区的底线吗 定义的行为是什么 不完全的 它向 0 舍入 而不是向下舍入 6 5 5 乘法运算符 6
  • Java 的“Parallel.For”?

    我想知道是否有并行 For相当于 Java 的 net 版本吗 如果有人可以提供一个例子吗 谢谢 我想最接近的事情是 ExecutorService exec Executors newFixedThreadPool SOME NUM OF
  • jquery 中的按钮文本切换

    当我单击 pushme 按钮时 它会将其文本变为 不要推我 当再次单击按钮时 我想再次将文本变为 推我 我怎样才能做到这一点
  • 避免应用程序激活并在单击其上的按钮时集中注意力 - Windows API 或 Qt

    情况 无边框 QDialog 成功地保持在其他应用程序之上 问题是当单击此始终位于顶部的应用程序窗口时 会发生以下情况 单击的始终位于顶部的应用程序被激活 单击的始终位于顶部的应用程序窗口会窃取先前活动 聚焦的应用程序的焦点 是否有可能当单
  • YouTube API loadVideoById startSeconds 不起作用

    我为我嵌入的一些 YouTube 视频创建了一个章节选择器 此方法曾经有效 但最近已停止 我不明白发生了什么事 我使用他们推荐的格式 但使用 loadVideoById 来显示每一章 div class wrapper div div di
  • 具有 MVVM 模式的数字文本框

    我见过数字的实现TextBox后面的代码WPF 我们如何做到这一点MVVM图案 在 WPF 中 如果将 TextBox 绑定到 Decimal 或 Int 属性 它将仅接受该 int 或decimal 否则它将显示红色边框 表明它在绑定中没
  • 什么是真与假?它与 True 和 False 有何不同?

    我刚刚了解到有truthy and falsypython 中的值与正常值不同True and False 有人可以深入解释一下什么吗truthy and falsy价值观是 我应该在哪里使用它们 有什么区别truthy and True价
  • 为什么 ${basedir} NLog 配置不起作用?

    为什么我无法在生产服务器中使用 basedir nlog config 如果我使用fileName basedir logs shortdate log nlog 不记录消息信息 但是如果我更改为类似的内容fileName C logs s
  • dockerfile中的EXPOSE和服务YAML中的TARGETPORT与Pod中实际运行的端口有什么关系?

    dockerfile中的EXPOSE和服务YAML中的TARGETPORT与Pod中实际运行的端口有什么关系 在我的 dockerfile 中 expose 8080 在我的部署中 ports containerPort 8080 在我的服
  • fork() 后 libCurl SSL 错误

    我正在开发一个 FUSE 驱动程序 当我将其作为守护进程运行时 没有 f 或 d 标志 通过 libcurl 发出的所有 https 请求都会失败 我能够通过发出 https 请求 分叉并返回父进程 然后从新进程发出第二个请求来重现该错误
  • 查找关联记录存在的位置

    如何仅选择那些具有关联标签记录的员工 换句话说 仅选择具有一个或多个与其关联的标签记录的员工记录 class Employee lt ActiveRecord Base has and belongs to many tags end cl
  • 在 ASP.NET 中正确执行锁定

    我有一个 ASP NET 站点 其搜索功能相当慢 我想通过使用查询作为缓存键将结果添加到缓存一小时来提高性能 using System using System Web using System Web Caching public cla
  • Spring Boot应用程序立即退出

    当我运行我的spring bootapplication 它立即退出 与exit code 0 有了这个 Spring Boot v2 1 0 RELEASE 2018 11 27 14 08 31 219 INFO 94920 resta