public int getTPMin() {
                 return Integer.parseInt(config.get("ThreadPool-MinThread"));         }
         /**
          * 得到线程池能够运行的线程最大数量
          * @return int
          */
         public int getTPMax() {
                 return Integer.parseInt(config.get("ThreadPool-MaxThread"));         }         /**
          * 得到连接延迟时间
          */
         public int getTPKeepAliveTime() {
                 return Integer.parseInt(config.get("ThreadPool-KeepAliveTime"));         }         /**
          * 得到线程工作长度
          */
         public int getTPWorkQueueLength() {
                 return Integer.parseInt(config.get("ThreadPool-WorkQueueLength"));         }         /**
          * 得到数据库服务器Ip地址
          */
         public String getDBIp() {
                 return config.get("DataBaseIp");         }         /**
          * 得到数据库名
          */
         public String getDBName() {
                 return config.get("DataBaseName");              
         }         /**
          * 得到数据库用户名
          */
         public String getDBUserName() {
                 return config.get("DBName");         }         /**
          * 得到数据库用户密码
          */
         public String getDBPassWord() {
                 return config.get("DBPassWord");         }         /**
          * 得到数据库查询类型
          */
         public String getDBType() {
                 return config.get("DataBaseType");         }         /**
          * 得到数据安装的路径
          * @return String
          *  返回数据库安装的路径
          */
         public String getDBInstallPath()
         {
            return config.get("DataBasePath");
         }         public String getDataInstallPath()
       {
          return config.get("DataPath");
       }
         /**
          * 得到数据库端口号
          */
         public int getDBPort() {
                 return Integer.parseInt(config.get("DataBasePort"));         }         /**
          * 得到数据库连接池的最小连接数量
          *
          */
         public int getDBPoolMin() {
                 return Integer.parseInt(config.get("DataBasePool-MinCon"));         }         /**
          * 得到数据库连接池的最大连接数量
          *
          */
         public int getDBPoolMax() {
                 return Integer.parseInt(config.get("DataBasePool-MaxCon"));         }
         /**
          * 得到免费通道指向的页面
          */
         public String getpagefree() {
                 return config.get("page-free");
         }         /**
          * 得到收费通道指向的页面
          */
         public String getpagecharge() {
                 return config.get("page-charge");
         }         /**
          * 得到注册名
          */
         public String getName() {
                 return config.get("Name");
         }         /**
          * 得到注册密码
          */
         public String getpwd() {
                 return config.get("pwd");
         }         /**
          * 得到从网页定制时用户的IP地址
          */
         public String getoverip() {
                 return config.get("overip");
         }
         /**
          * 得到栏目不存在的错误提示信息
          */
         public String getErroritemcode() {
                 return config.get("Error-Erroritemcode");
         }
         /**
          *  得到信息不存在的错误提示信息
          * @return String
          */
         public String getErrorMessage() {
                 return config.get("Error-ErrorMessage");
         }         /**
          *
          * 得到栏目代码和信道不一致信息
          */
         public String getErrorchannel() {
                 return config.get("Error-Errorchannel");
         }
    public static void main(String[] args) {
        Readxml rdxml = new Readxml("test.xml");
        System.out.println(rdxml.getDBName());
        System.out.println(rdxml.getDBIp());
        System.out.println(rdxml.getDBPassWord());
        //System.out.println(rdxml.getDBPoolMax());
        System.out.println(rdxml.getDBType());
    }}大虾帮我看看  为什么执行到
Document mydoc1 = ss.build(eFile);          // 读出该xml文件
就出现异常了呢

解决方案 »

  1.   

    我分了两段   因为帖子不能太长  还有个xml文件
    test.xml<?xml version="1.0" encoding="UTF-8"?>
    <test>
       <ThreadPool>
    <MinThread>20</MinThread>
    <MaxThread>50</MaxThread>
    <KeepAliveTime>500</KeepAliveTime>
    <WorkQueueLength>500</WorkQueueLength>
      </ThreadPool>
      <DataBaseType>mysql</DataBaseType>
      <DataBasePath>C:\"Program Files"\MySQL\"MySQL Server 5.0"\bin\</DataBasePath>
      <DataPath>C:\Program Files\MySQL\MySQL Server 5.0\data</DataPath>
      <DataBaseName>test</DataBaseName>
      <DataBaseIp>127.0.0.1</DataBaseIp>
      <DataBasePort>3306</DataBasePort>
      <DBName>root</DBName>
      <DBPassWord>today</DBPassWord>
      <DataBasePool>
        <MinCon>10</MinCon>
        <MaxCon>40</MaxCon>
      </DataBasePool>
      <page>
        <free>you.jsp</free>
        <charge>me.jsp</charge>
      </page>
      <Name>daocha</Name>
      <pwd>daocha</pwd>
      <overip>http://127.0.0.1:8080/index.jsp</overip>
      <Error>
      <Errorchannel>栏目代码和信道不一致</Errorchannel>
      <Erroritemcode>错误的栏目代码</Erroritemcode>
      <ErrorMessage>没有需要的信息</ErrorMessage>
      </Error>
     </test>
      

  2.   

    用这句换Document mydoc1 = ss.build(new FileInputStream(xmlFile));
      

  3.   

    <Errorchannel>栏目代码和信道不一致</Errorchannel>
      <Erroritemcode>错误的栏目代码</Erroritemcode>
      <ErrorMessage>没有需要的信息</ErrorMessage>
    这句里面的中文换成英文就OK了但是老师给的例题是这样的 我也可以运行  只是不知道我自己做就不能读中文?
      

  4.   

    ohh...
    it's okay now ???