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

推荐订阅源

H
Help Net Security
S
Secure Thoughts
I
Intezer
Project Zero
Project Zero
Stack Overflow Blog
Stack Overflow Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Full Disclosure
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
人人都是产品经理
人人都是产品经理
博客园_首页
J
Java Code Geeks
Recorded Future
Recorded Future
K
Kaspersky official blog
GbyAI
GbyAI
S
Schneier on Security
The Cloudflare Blog
Spread Privacy
Spread Privacy
C
Cisco Blogs
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
Know Your Adversary
Know Your Adversary
T
Tenable Blog
A
Arctic Wolf
Blog — PlanetScale
Blog — PlanetScale
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
O
OpenAI News
Last Week in AI
Last Week in AI
B
Blog RSS Feed
T
Troy Hunt's Blog
G
GRAHAM CLULEY
N
Netflix TechBlog - Medium
Vercel News
Vercel News
量子位
The Register - Security
The Register - Security
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
U
Unit 42
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News and Events Feed by Topic

博客园 - 菜鸟乙

提示词 大模型实战 2-4 提示词聚合网站 提示词 大模型实战 1-1 提示词工程师导学 中间件 ZK分布式专题与Dubbo微服务入门 8-5 暴露商品服务 0-4min 中间件 ZK分布式专题与Dubbo微服务入门 9-4 获取分布式锁的流程 中间件 ZK分布式专题与Dubbo微服务入门 8-8 使用dubbo内置main打包jar启动 中间件 ZK分布式专题与Dubbo微服务入门 8-6 使用tomcat启动dubbo服务 中间件 ZK分布式专题与Dubbo微服务入门 8-4 重构商品服务,抽取抽象工程 中间件 ZK分布式专题与Dubbo微服务入门 8-3 单体到分层模式代码演示 中间件 ZK分布式专题与Dubbo微服务入门 9-2 分布式锁的概念与数据最终不一致性的场景 中间件 ZK分布式专题与Dubbo微服务入门 7-9 zk-watcher实例 统一更新N台节点的配置文件 中间件 ZK分布式专题与Dubbo微服务入门 7-10 curator之acl权限操作与认证授权 中间件 ZK分布式专题与Dubbo微服务入门 9-1 死锁与活锁的概念 中间件 ZK分布式专题与Dubbo微服务入门 7-8 curator之PathChildrenCache子节点监听 中间件 ZK分布式专题与Dubbo微服务入门 8-1 架构演变过程 中间件 ZK分布式专题与Dubbo微服务入门 7-7 curator之nodeCache一次注册N次监听 中间件 ZK分布式专题与Dubbo微服务入门 7-6 curator之usingWatcher 中间件 ZK分布式专题与Dubbo微服务入门 7-5 查询节点相关信息 中间件 ZK分布式专题与Dubbo微服务入门 8-2 dubbo 入门简介 中间件 ZK分布式专题与Dubbo微服务入门 7-4 修改节点以及删除节点
中间件 ZK分布式专题与Dubbo微服务入门 8-7 使用main主线程启动dubbo服务
菜鸟乙 · 2024-04-23 · via 博客园 - 菜鸟乙

0    课程地址

https://coding.imooc.com/lesson/201.html#mid=12745

1    重点关注

1.1    本节内容

使用main主线程启动dubbo服务

1.2    已解决问题

本节service没有依赖成功api,

经查询可能是sts版本问题,没有重新加载的选项(mavenrepositories没有rebuild index选项,并且仓库不可修改在c盘,后边有时间重新换个版本的试试)

答复:

问题已解决,需要在父项目(父项目的pom文件有modules),右键run as ->maven install即可生成jar包

<modules>
        <module>imooc-dubbo-common</module>
        <module>imooc-dubbo-item-api</module>
        <module>imooc-dubbo-item-service</module>
        <module>imooc-dubbo-order-api</module>
        <module>imooc-dubbo-order-service</module>
        <module>imooc-dubbo-web</module>
    </modules>

2    课程内容

3    Coding

3.1    使用tomcat启动dubbo服务

  • 主要改造点:

涉及父项目,common项目,service和api项目共4个,

涉及

a  将启动的main方法写到service子项目,main方法加载主配置文件

b  主配置文件将所有配置文件聚合到一起

 
  • a  将启动的main方法写到service子项目,main方法加载主配置文件

ItemApplication

package com.imooc.item.starter;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ItemApplication {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                new String[] {"classpath:spring/spring-context.xml"});
        context.start();
        // press any key to exit
        System.in.read();
    }

}
  • b  主配置文件将所有配置文件聚合到一起

spring-context.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
        
    <import resource="classpath:spring/applicationContext-dao.xml"/>
    <import resource="classpath:spring/applicationContext-dubbo-provider.xml"/>
    <import resource="classpath:spring/applicationContext-service.xml"/>
    <import resource="classpath:spring/applicationContext-transaction.xml"/>
    
</beans>
  • c  启动main方法即可