eclipse 中运行mapreduce程序相关配置

2023-05-16

本文主要包括三部分内容

一.编译hadoop插件

   可以直接下载使用编译好的hadoop-eclipse-plugin.jar,只要版本兼容就行。我本来一开始就连接成功了,被一个异常迷惑了(这个异常下面将会提到),以为下载的版本问题,就决定重新编译了。如果直接使用编译好的可以直接跳过第一部分

二.在eclipse中连接hadoop集群

三.运行wordcount实例


第一部分 hadoop版本为2.7.4(64位版本)

本来在虚拟机中的linux环境中编译,但是异常看着比较费劲(jar包找不到问题),最后决定在windows中编译。

1.下载Ant,设置环境变量


查看版本测试是否配置成功,如下图。



2.下载hadoop2x-eclipse-plugin-master.zip


3.编译插件(2.7.4)

hadoop版本为2.7.4,插件版本需要一致。我本地编译好的hadoop2.7.4放在E:\Hadoop文件夹,编译前需要修改一些配置信息

3.1 jar包版本修改

hadoop目录E:\Hadoop\hadoop-2.7.4\share\hadoop\common\lib中jar包和插件配置文件(hadoop2x-eclipse-plugin-master\ivy\libraries.properties)中的版本信息要一致

以下是我的libraries.properties

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

#This properties file lists the versions of the various artifacts used by hadoop and components.
#It drives ivy and the generation of a maven POM

# This is the version of hadoop we are generating
hadoop.version=2.7.4
hadoop-gpl-compression.version=0.1.0

#These are the versions of our dependencies (in alphabetical order)
apacheant.version=1.7.0
ant-task.version=2.0.10

asm.version=3.2
aspectj.version=1.6.5
aspectj.version=1.6.11

checkstyle.version=4.2

commons-cli.version=1.2
commons-codec.version=1.4
commons-collections.version=3.2.2
commons-configuration.version=1.6
commons-daemon.version=1.0.13
commons-httpclient.version=3.1
commons-lang.version=2.6
commons-logging.version=1.1.3
commons-logging-api.version=1.1.3
commons-math.version=3.1.1
commons-el.version=1.0
commons-fileupload.version=1.2
commons-io.version=2.4
commons-net.version=3.1
core.version=3.1.1
coreplugin.version=1.3.2

hsqldb.version=1.8.0.10
htrace.version=3.1.0-incubating

ivy.version=2.1.0

jasper.version=5.5.12
jackson.version=1.9.13
#not able to figureout the version of jsp & jsp-api version to get it resolved throught ivy
# but still declared here as we are going to have a local copy from the lib folder
jsp.version=2.1
jsp-api.version=5.5.12
jsp-api-2.1.version=6.1.14
jsp-2.1.version=6.1.14
jets3t.version=0.6.1
jetty.version=6.1.26
jetty-util.version=6.1.26
jersey-core.version=1.8
jersey-json.version=1.8
jersey-server.version=1.8
junit.version=4.5
jdeb.version=0.8
jdiff.version=1.0.9
json.version=1.0

kfs.version=0.1

log4j.version=1.2.17
lucene-core.version=2.3.1

mockito-all.version=1.8.5
jsch.version=0.1.42

oro.version=2.0.8

rats-lib.version=0.5.1

servlet.version=4.0.6
servlet-api.version=2.5
slf4j-api.version=1.7.10
slf4j-log4j12.version=1.7.10

wagon-http.version=1.0-beta-2
xmlenc.version=0.52
xerces.version=1.4.4

protobuf.version=2.5.0
guava.version=11.0.2
netty.version=3.6.2.Final



3.2 修改\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin\build.xml

  3.2.1去掉retrieve-common依赖 否则编译的时候会卡住,如下图


修改该前

<target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
    <echo message="contrib: ${name}"/>
    <javac
     encoding="${build.encoding}"
     srcdir="${src.dir}"
     includes="**/*.java"
     destdir="${build.classes}"
     debug="${javac.debug}"
     deprecation="${javac.deprecation}">
     <classpath refid="classpath"/>
    </javac>
  </target>


修改后,去掉 depends="init, ivy-retrieve-common"

<target name="compile" unless="skip.contrib">
    <echo message="contrib: ${name}"/>
    <javac
     encoding="${build.encoding}"
     srcdir="${src.dir}"
     includes="**/*.java"
     destdir="${build.classes}"
     debug="${javac.debug}"
     deprecation="${javac.deprecation}">
     <classpath refid="classpath"/>
    </javac>
  </target>



    3.2.2.添加文件拷贝

    <copy file="${hadoop.home}/share/hadoop/common/lib/servlet-api-${servlet-api.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-io-${commons-io.version}.jar"  todir="${build.dir}/lib" verbose="true"/>


 找到<attribute name="Bundle-ClassPath"添加

 lib/servlet-api-${servlet-api.version}.jar,
 lib/commons-io-${commons-io.version}.jar


 完整的\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin\build.xml文件

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<project default="jar" name="eclipse-plugin">

  <import file="../build-contrib.xml"/>

  <path id="eclipse-sdk-jars">
    <fileset dir="${eclipse.home}/plugins/">
      <include name="org.eclipse.ui*.jar"/>
      <include name="org.eclipse.jdt*.jar"/>
      <include name="org.eclipse.core*.jar"/>
      <include name="org.eclipse.equinox*.jar"/>
      <include name="org.eclipse.debug*.jar"/>
      <include name="org.eclipse.osgi*.jar"/>
      <include name="org.eclipse.swt*.jar"/>
      <include name="org.eclipse.jface*.jar"/>

      <include name="org.eclipse.team.cvs.ssh2*.jar"/>
      <include name="com.jcraft.jsch*.jar"/>
    </fileset> 
  </path>

  <path id="hadoop-sdk-jars">
    <fileset dir="${hadoop.home}/share/hadoop/mapreduce">
      <include name="hadoop*.jar"/>
    </fileset> 
    <fileset dir="${hadoop.home}/share/hadoop/hdfs">
      <include name="hadoop*.jar"/>
    </fileset> 
    <fileset dir="${hadoop.home}/share/hadoop/common">
      <include name="hadoop*.jar"/>
    </fileset> 
  </path>



  <!-- Override classpath to include Eclipse SDK jars -->
  <path id="classpath">
    <pathelement location="${build.classes}"/>
    <!--pathelement location="${hadoop.root}/build/classes"/-->
    <path refid="eclipse-sdk-jars"/>
    <path refid="hadoop-sdk-jars"/>
  </path>

  <!-- Skip building if eclipse.home is unset. -->
  <target name="check-contrib" unless="eclipse.home">
    <property name="skip.contrib" value="yes"/>
    <echo message="eclipse.home unset: skipping eclipse plugin"/>
  </target>

 <target name="compile" unless="skip.contrib">
    <echo message="contrib: ${name}"/>
    <javac
     encoding="${build.encoding}"
     srcdir="${src.dir}"
     includes="**/*.java"
     destdir="${build.classes}"
     debug="${javac.debug}"
     deprecation="${javac.deprecation}">
     <classpath refid="classpath"/>
    </javac>
  </target>

  <!-- Override jar target to specify manifest -->
  <target name="jar" depends="compile" unless="skip.contrib">
    <mkdir dir="${build.dir}/lib"/>
    <copy  todir="${build.dir}/lib/" verbose="true">
          <fileset dir="${hadoop.home}/share/hadoop/mapreduce">
           <include name="hadoop*.jar"/>
          </fileset>
    </copy>
    <copy  todir="${build.dir}/lib/" verbose="true">
          <fileset dir="${hadoop.home}/share/hadoop/common">
           <include name="hadoop*.jar"/>
          </fileset>
    </copy>
    <copy  todir="${build.dir}/lib/" verbose="true">
          <fileset dir="${hadoop.home}/share/hadoop/hdfs">
           <include name="hadoop*.jar"/>
          </fileset>
    </copy>
    <copy  todir="${build.dir}/lib/" verbose="true">
          <fileset dir="${hadoop.home}/share/hadoop/yarn">
           <include name="hadoop*.jar"/>
          </fileset>
    </copy>

    <copy  todir="${build.dir}/classes" verbose="true">
          <fileset dir="${root}/src/java">
           <include name="*.xml"/>
          </fileset>
    </copy>

    <copy file="${hadoop.home}/share/hadoop/common/lib/htrace-core-${htrace.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/servlet-api-${servlet-api.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-io-${commons-io.version}.jar"  todir="${build.dir}/lib" verbose="true"/>

    <copy file="${hadoop.home}/share/hadoop/common/lib/protobuf-java-${protobuf.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/log4j-${log4j.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-cli-${commons-cli.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-configuration-${commons-configuration.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-lang-${commons-lang.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-collections-${commons-collections.version}.jar"  todir="${build.dir}/lib" verbose="true"/>  
    <copy file="${hadoop.home}/share/hadoop/common/lib/jackson-core-asl-${jackson.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/jackson-mapper-asl-${jackson.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/slf4j-log4j12-${slf4j-log4j12.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/slf4j-api-${slf4j-api.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/guava-${guava.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/hadoop-auth-${hadoop.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-cli-${commons-cli.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    <copy file="${hadoop.home}/share/hadoop/common/lib/netty-${netty.version}.jar"  todir="${build.dir}/lib" verbose="true"/>

    <jar
      jarfile="${build.dir}/hadoop-${name}-${hadoop.version}.jar"
      manifest="${root}/META-INF/MANIFEST.MF">
      <manifest>
   <attribute name="Bundle-ClassPath" 
    value="classes/, 
 lib/hadoop-mapreduce-client-core-${hadoop.version}.jar,
 lib/hadoop-mapreduce-client-common-${hadoop.version}.jar,
 lib/hadoop-mapreduce-client-jobclient-${hadoop.version}.jar,
 lib/hadoop-auth-${hadoop.version}.jar,
 lib/hadoop-common-${hadoop.version}.jar,
 lib/hadoop-hdfs-${hadoop.version}.jar,
 lib/protobuf-java-${protobuf.version}.jar,
 lib/log4j-${log4j.version}.jar,
 lib/commons-cli-${commons-cli.version}.jar,
 lib/commons-configuration-${commons-configuration.version}.jar,
 lib/commons-httpclient-${commons-httpclient.version}.jar,
 lib/commons-lang-${commons-lang.version}.jar,  
 lib/commons-collections-${commons-collections.version}.jar,  
 lib/jackson-core-asl-${jackson.version}.jar,
 lib/jackson-mapper-asl-${jackson.version}.jar,
 lib/slf4j-log4j12-${slf4j-log4j12.version}.jar,
 lib/slf4j-api-${slf4j-api.version}.jar,
 lib/guava-${guava.version}.jar,
 lib/netty-${netty.version}.jar,
 lib/htrace-core-${htrace.version}.jar,
 lib/servlet-api-${servlet-api.version}.jar,
 lib/commons-io-${commons-io.version}.jar" />
   </manifest>
      <fileset dir="${build.dir}" includes="classes/ lib/"/>
      <!--fileset dir="${build.dir}" includes="*.xml"/-->
      <fileset dir="${root}" includes="resources/ plugin.xml"/>
    </jar>
  </target>

</project>



 3.3.cd到\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin目录

   运行ant jar -Dversion=2.7.4 -Dhadoop.version=2.7.4 -Declipse.home=E:\IDE\eclipse -Dhadoop.home=E:\Hadoop\hadoop-2.7.4,如下图则编译成功

    

说明:1. 2.7.4为hadoop版本号

    2. Declipse.home为eclipse的安装目录

    3. -Dhadoop.home为本地hadoop的存放地址

 编译成功后\hadoop2x-eclipse-plugin-master\build\contrib\eclipse-plugin文件夹下将会出现hadoop-eclipse-plugin-2.7.4.jar


第二部分在eclipse中连接hadoop集群

1.eclipse中指定hadoop路径,如下图

Windows-->Rreferences


2.拷贝hadoop-eclipse-plugin-2.7.4.jar到eclipse路径下的plugins文件夹,重启eclipse。

3.eclipse中点击Window-->show view-->other 如下图,选择后点击OK。

此时eclipse下方出现Map/Reduce Location选项卡,如下图


下方鼠标右键选择new hadoop location下图为我的配置


配置完成后点击finish

注意:此时点击下图中的箭头会有错



出现这种情况网上有些解决办法,但是我试过之后问题依然存在,纠结了好久,以为没有连接成功,其实在左侧的Project Explorer中可以正常显示,如下图


出现上图表明eclipse链接hadoop成功了,具体为啥一直抛异常还不知道。


第三部分 运行wordcount实例

 1.创建mapreduce程序

 File-->New-->Other


点击Next,只要输入工程名Project name,点击Finish即可。

src下新建包名org.apache.hadoop.examples

拷贝WordCount源码,在Hadoop的源码目录下\hadoop-2.7.4-src\hadoop-mapreduce-project\hadoop-mapreduce-examples\src\main\java\org\apache\hadoop\examples\WordCount.java,直接拷贝到新建的包名下

注:hadoop-2.7.4-src为hadoop编译前的源码解压后的文件夹。

2.运行前需要先添加控制台的日志输出,否则控制台无法看见异常信息。

在工程目录的src下面添加log4j.properties文件,文件中配置如下

### set log levels ###
log4j.rootLogger = INFO , C , D , E 

### console ###
log4j.appender.C = org.apache.log4j.ConsoleAppender
log4j.appender.C.Target = System.out
log4j.appender.C.layout = org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern = [Hadoop][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n

### log file ###
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = ../logs/Hadoop_info.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = INFO 
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = [Hadoop][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n

### exception ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File = ../logs/Hadoop_info.log
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR 
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = [Hadoop][%p] [%-d{yyyy-MM-dd HH:mm:ss}] %C.%M(%L) | %m%n

工程截图如下图所示


3.右键WordCount.java Run As -> Run Configurations,配置WordCount运行的参数Arguments,分别为HDFS输入文件和输出文件,如下图



4.下载hadoop.dll和winutils.exe(我下载的hadoop.dll要是64位的),将winutils.exe放到Windows中hadoop安装目录的bin目录下,把hadoop.dll拷贝到C:\Windows\System32下面

5.windows添加两个系统环境变量,并将MAVEN_HOME添加到PATH中,如下图


6.配置完重启eclipse,运行wordcount.java

右键WorkCount.java Run As-->Run On Hadoop,出现如下信息则表示运行成功



说明:可能运行的时候还有其他的错误出现,只要根据控制台出现的异常信息去搜索基本都可以解决,所以要先把日志配起来。

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

eclipse 中运行mapreduce程序相关配置 的相关文章

随机推荐

  • golang学习笔记 casbin授权库学习记录

    目录 权限控制管理模型ACLRBACABAC Casbin介绍Casbin概述Casbin工作原理请求策略匹配器效果 Casbin结合golang基本使用添加policy结合gorm适配器使用对policy经行增删改查 自定义匹配函数 权限
  • 【洛谷】P1626象棋比赛

    题目描述 有 span class hljs keyword N span 个人要参加国际象棋比赛 xff0c 该比赛要进行 span class hljs keyword K span 场对弈 每个人最多参加两场对弈 xff0c 最少参加
  • 四、SLAM学习笔记—— Ubuntu18.04交叉编译OpenCV4.5.5至ARM64位平台firefly-RK3566

    概述 交叉编译大概的意思是指 在PC x86 x64 的机器上编译其他平台如ARM平台的代码 xff0c 这个过程叫做交叉编译 对于交叉编译 xff0c 我们首先确定目标平台的架构 xff0c RK3566的架构是ARMv8 xff0c 6
  • 关于金蝶组件各类报错问题

    最近维护金蝶K3wish xff0c 遇到个别客户端的组件报错问题 xff0c 现整理问题解决方法 xff1a 1 打开金蝶的追踪程序 xff0c 在本机金蝶安装盘下搜索 xff1a KdMainDBG exe程序 xff1b 2 加载进入
  • Charles + Postern 安卓模拟器抓包

    首先 xff0c 要注意的是 xff0c 在安卓7 0以后 xff0c Fiddle和charles这些抓包工具安装的证书 xff0c 会被默认不相信 xff0c 所以按照很多旧的抓包工具的配置过程 xff0c 没有办法成功抓包 今天就在这
  • HTML(一天学完)总结。附上html思维导图

    3 24 偷懒了几天 昨天加今天看完了狂神说的html 因为html和mysql是一起学的 xff0c 我看腻了mysql就去看html 在这里写一篇总结 附上html思维导图 HTML Hyper Text Markup Language
  • TGP漏洞:lol无法正常登录问题

    今天下午发现了个有趣的现象 xff0c 本来是要设置路由器的 xff0c 结果路由器设置好后 xff0c 上网之类的都正常 但就是玩不了lol xff0c 登进去总是提示与服务器无法连接 xff0c 您的网络有问题 好郁闷啊 xff0c 我
  • 代码参数里的 payload 是什么意思???

    首先解释一下什么是 payload payload 字面意思 有效载荷 xff0c 有效负荷 xff0c 有效载重 payload 维基百科payload中的解释 xff1a 在计算机科学与电信领域 xff0c 负载 xff08 英语 xf
  • 树莓派 Volumio 3.5触摸屏(GPIO) 配置教程

    最近咸鱼淘了一个树莓派3B 买成210血亏哦 200以下差不多 做数播 装的Volumio系统 和少帅的i2c转同轴的板 连同壳子140 43 后来又淘了一个3 5寸的TFT小屏幕3 5inch RPi Display LCD wiki 我
  • Ubuntu 16.04 LTS 一键安装VNC

    Ubuntu 16 04 LTS 安装VNC xff0c 在百度和谷歌找了很多教程 xff0c 不是太老 xff0c 就是说的驴唇不对马嘴 xff0c 所以忍不住写一些以正视听 Ubuntu 16 04 LTS是最近出的LTS版本系统 xf
  • OpenMP简介

    01 OpenMP简介 OpenMP xff08 开放式多处理 xff09 是一种应用程序编程接口 xff08 API xff09 xff0c 支持C xff0c C 43 43 和Fortran中的多平台共享内存 多 处 理
  • windows10 ubuntu18.04 CUDA9.2 caffe tensorflow pytorch安装

    文章目录 windows10 安装ubuntu18 04 系统安装1 制作U盘启动盘2 更改英文路径3 更新源4 设置root账号5 安装NVIDIA驱动6 CUDA安装7 CUDNN安装8 Anaconda安装9 Pytorch安装10
  • 场景分类资料

    1 https blog csdn net Wayne2019 article details 78629204 2 场景分类 xff08 1 xff09 研究方法 一 两个步骤 xff08 一 xff09 从图像中获得表现图像场景的图像特
  • ubuntu如何降级到之前的版本

    找出系统已经安装的内核版本 xff0c 在终端里输入命令 xff1a dpkg get selections grep linux image 然后会显示系统中已安装的内核 xff0c 例如 xff1a linux image 3 0 0
  • 你真的了解 bash 的 exec 命令吗?

    前言 bash exec 命令不太常用 xff0c 我对它提供的功能也仅知一二 xff0c 没有掌握全貌 最近遇到了几个问题 xff0c 从问题出发研究了一通找到 exec 命令头上 xff0c 问题迎刃而解后 xff0c 才对 exec
  • [转] linux定义命令别名alias

    转载自 http www linuxso com command alias html 命 令 alias 功能说明 xff1a 设置指令的别名 语 法 xff1a alias 别名 61 指令名称 补充说明 xff1a 用户可利用alia
  • 出现的错误:Cause: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 16; 必须声明元素类型 “configuration

    一 首先上问题程序 Caused by org springframework beans factory BeanCreationException Error creating bean with name 39 sqlSessionF
  • 根据数组对象中的某个属性值删除元素(ts环境)

    原数组 outputItems 61 code 39 0001 39 name this i18n t 39 wordLib bumon 39 code 39 0002 39 name this i18n t 39 wordLib supp
  • 未来已来:数字化时代的商业模式创新-读书笔记

    这段时间 xff0c 读书的效率确实很高 xff0c 趁着这段时期 xff0c 多读几本书 同时梅溪书院的工作人员也很热心 xff0c 可以把新书拆开供读者阅读 这本书站在数字化时代的视野来分析商业模式上的变量与常量 xff0c 帮助理解数
  • eclipse 中运行mapreduce程序相关配置

    本文主要包括三部分内容 一 编译hadoop插件 可以直接下载使用编译好的hadoop eclipse plugin jar xff0c 只要版本兼容就行 我本来一开始就连接成功了 xff0c 被一个异常迷惑了 xff08 这个异常下面将会