zoukankan      html  css  js  c++  java
  • 分布式项目配置工程,在项目间互通要先在linux下开启zookeeper

    一、编写配置文件

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <!--给项目服务起个名字-->
    <dubbo:application name="dubbodemo-service"/>
    <!--配置连接zookeeper的ip和端口号-->
    <dubbo:registry address="zookeeper://192.168.200.128:2181"/>
    <!--配置扫描包,在这个包下实现类中使用@Service注解才会生效-->
    <dubbo:annotation package="cn.zrf.service"/>
    </beans>
    二、编写web.xml配置文件
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd" >

    <web-app>
    <display-name>Archetype Created Web Application</display-name>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext*.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    </web-app>
  • 相关阅读:
    CF 848C
    BZOJ 4025 二分图
    支配树学习笔记
    CF1120D Power Tree
    Codeforces 360A(找性质)
    Codeforces 142D(博弈)
    Codeforces 142B(二分染色、搜索)
    GYM 101981E(开关反转性质)
    Codeforces 1150E(树、线段树)
    Codeforces 1150D(字符串dp)
  • 原文地址:https://www.cnblogs.com/zhangrongfei/p/11289237.html
Copyright © 2011-2022 走看看