<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                1.4.1. 拆分工程 1)將表現層工程獨立出來: buy-manager-web 2)將原來的 buy-manager 改為如下結構 buy-manager |--buy-manager-dao |--buy-manager-interface |--buy-manager-pojo |--buy-manager-service(打包方式改為 war) 1.4.2. 服務層工程 第一步:把 buy-manager 的 pom 文件中刪除 buy-manager-web 模塊。 ~~~ <modules> <module>buy-manager-pojo</module> <module>buy-manager-dao</module> <module>buy-manager-interface</module> <module>buy-manager-service</module> </modules> ~~~ 第二步:把 buy-manager-web 文件夾移動到 buy-manager 同一級目錄。 第三步:buy-manager-service 的 pom 文件修改打包方式 `<packaging>war</packaging> ` 第四步:在 buy-manager-service 工程中添加 web.xml 文件 第五步:把 buy-manager-web 的配置文件復制到 buy-manager-service 中。 刪除 springmvc.xml 第六步:web.xml 中只配置 spring 容器。刪除前端控制器 第七步:發布服務 1、在 buy-manager-Service 工程中添加 dubbo 依賴的 jar 包。 ~~~ <!-- dubbo相關 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> <exclusion> <groupId>org.jboss.netty</groupId> <artifactId>netty</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> </dependency> ~~~ 2、在 spring 的配置文件 aplicationContext-service.xml 中添加 dubbo 的約束,然后使用 dubbo:service 發布服務 ~~~ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 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-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd"> <context:component-scan base-package="com.igeek.service"/> <!-- 發布dubbo服務 --> <!-- 配置application名稱 --> <dubbo:application name="buy-manager"/> <!-- 配置注冊中心的信息 --> <dubbo:registry protocol="zookeeper" address="192.168.11.190:2181"/> <!-- 配置dubbo服務以及端口號 --> <dubbo:protocol name="dubbo" port="20880"/> <!-- 申明需要暴露的服務的接口 --> <dubbo:service interface="com.igeek.service.ItemService" ref="itemServiceImpl"/> </beans> ~~~ 1.4.3. 表現層工程 改造 buy-manager-web 工程。 第一步:刪除 mybatis、和 spring 的配置文件。只保留 springmvc.xml 第二步:修改 buy-manager-web 的 pom 文件, 1、修改 parent 為 buy-parent 2、添加 spring 和 springmvc 的 jar 包的依賴 3、刪除 buy-mangager-service 的依賴 4、添加 dubbo 的依賴 ~~~ <!-- dubbo 相關 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> <exclusion> <groupId>org.jboss.netty</groupId> <artifactId>netty</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> </dependency> ~~~ 5、buy-mangager-web 添加對 buy-manager-Interface 的依賴。 第三步:修改 springmvc.xml,在 springmvc 的配置文件中添加服務的引用。 ~~~ <?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:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> <context:component-scan base-package="com.igeek.egobuy.controller" /> <mvc:annotation-driven /> <!-- 視圖解析器 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <!-- 引用dubbo服務 --> <!-- 在注冊中心的應用的名稱 --> <dubbo:application name="buy-manager-web"/> <!-- 配置注冊中心的相關信息 --> <dubbo:registry protocol="zookeeper" address="192.168.11.101:2181"/> <!-- 配置dubbo服務和端口號 --> <dubbo:protocol name="dubbo" port="20881"/> <!—引用指定的服務 --> <dubbo:reference interface="com.igeek.egobuy.service.ItemService" id="itemService"/> </beans> ~~~ 第四步:在 buy-manager-web 工程中添加 tomcat 插件配置。 ~~~ <build> <plugins> <!-- 配置 Tomcat 插件 --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <configuration> <path>/</path> <port>8081</port> </configuration> </plugin> </plugins> </build> ~~~ 1.5. Dubbo 監控中心 ![](https://box.kancloud.cn/4f5e4ee7d7a5c16fd39c8c7061ace6b5_372x150.png) 需要安裝 tomcat,然后部署監控中心即可。 1、把dubbo-admin-2.5.4war放到apache-tomcat-7.0.57/webapps 目錄下 2、啟動 tomcat ![](https://box.kancloud.cn/85baba07abbbfb251b0eba5460dd37c0_859x153.png) 3、訪問 http://192.168.11.190:8080/dubbo-admin-2.5.4/ 用戶名:root 密碼:root ![](https://box.kancloud.cn/91913ffa94dacba4ddde66f0a71f9b3a_954x319.png) 如果監控中心和注冊中心在同一臺服務器上,可以不需要任何配置。 如果不在同一臺服務器,需要修改配置文件: /root/apache-tomcat-7.0.47/webapps/dubbo-admin/WEB-INF/dubbo.properties ![](https://box.kancloud.cn/a058837bf6a56ed078b17385713adcdb_963x91.png) tail -f ../logs/catalina.out
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看