惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 风雨行者

使用 Qjx.CustomCache 在接口进行AOP 数据缓存 asp.net core 基于autofac 实现AOP 拦截 之 第三种方式 -基于class asp.net core 基于autofac 实现AOP 拦截 之 第二种方式 -基于class asp.net core 3.1 应用Aufac 进行AOP 的三种方式1 基于接口AOP linux之 tomcat 安装配置入门 linux的nginx的安装以及负载均衡 linux 系统管理 linux 服务管理 redis主从复制 读写分离 Redis 集群部署之Redis 安装(1) hbuilder 运行在 android 模拟器中 asp.net digest 摘要认证过程 转载:Spring Boot 不使用默认的 parent,改用自己的项目的 paren .NET Core CLI 的性能诊断介绍 转载学习:windows下将ES和kibana作为服务启动 转(以作记录):cmd命令行---进行Windows服务操作 在 .NET Core 中使用 Diagnostics Git与GitHub 学习笔记 dropdownlist 支持键盘拼音定位选择
MyEclipse 使用外部tomcat 调试springboot
风雨行者 · 2020-06-15 · via 博客园 - 风雨行者

在网上找了一些调试springboot 的文章,使用内置tomacat步骤大体都是如下步骤

1.配置插件:
<configuration>
         <jvmArguments>
           -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
         </jvmArguments>
       </configuration>

2.启动maven命令:clean install -Ptest -X spring-boot:run

3.开调试

右击项目–>选择debug as–>Debug Configuration–>Remote Java Application  

配置地址和端口号  localhost  5005

我按照此方法总是不行,所以换成了使用外部tomcat调试springboot的方案

(1)       新建-》Other->搜索maven 如下图

 

(2)       下一步

 

(3)       输入名称

 

(4)       点击完成

(5)       修改pom.xml,添加对springboot 的引用

如下内容:

<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.spboot.tomcat.pomdemo</groupId>

    <artifactId>tomcattest</artifactId>

    <packaging>war</packaging>

    <version>0.0.1-SNAPSHOT</version>

    <name>tomcattest Maven Webapp</name>

    <url>http://maven.apache.org</url>

    <parent>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter-parent</artifactId>

        <version>2.2.7.RELEASE</version>

    </parent>

    <dependencies>

        <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <scope>test</scope>

        </dependency>

        <dependency>

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-starter-web</artifactId>

            <exclusions>

                <exclusion>

                    <groupId>org.springframework.boot</groupId>

                    <artifactId>spring-boot-starter-tomcat</artifactId>

                </exclusion>

            </exclusions>

        </dependency>

        <dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>javax.servlet-api</artifactId>

            <scope>provided</scope>

        </dependency>

    </dependencies>

    <build>

        <plugins>

            <plugin>

                <groupId>org.springframework.boot</groupId>

                <artifactId>spring-boot-maven-plugin</artifactId> 

            </plugin>

        </plugins>

        <finalName>tomcattest</finalName>

    </build>

</project>

View Code

(6)创建mainApplication

如下内容

package com.tomcat.demo;

import org.springframework.boot.SpringApplication;

import org.springframework.boot.SpringBootConfiguration;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.boot.builder.SpringApplicationBuilder;

import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;

 

@SpringBootConfiguration

@Controller()

@SpringBootApplication

public class mainApplication extends SpringBootServletInitializer{

    @Override

    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {

        return builder.sources(mainApplication.class);

    }

 

    public static void main(String[] args) throws Exception {

        System.out.println("starting........................................................");

        // SpringApplication.run(bootApplication.class, args);

        SpringApplication alApplication = new SpringApplication(mainApplication.class);

        //alApplication.setBannerMode(Mode.OFF);

        alApplication.run(args);

    }

 

    @RequestMapping("/hello")

    @ResponseBody

    public String Hello() {

 

        return "1";

 

    }

}

View Code

7引入tomcat,打开官网,下载tomcat-9

 

8.tomcat添加到myeclipse,windows->preferences

 

 

9运行调试,选择tomcat9作为server

 

 

10访问地址http://localhost:8080/tomcattest/hello 发现断点已经进来了