什么原因导致openfire.xml文件在服务器启动时被截断

时间:2014-09-22 21:31:00

标签: xml openfire

我正在尝试启动一个openfire服务器。 我有一个openfire.xml文件,我已配置为匹配数据库的属性表。 我已多次检查过该文件是否匹配。

但是,当我启动服务器时,会截断几个条目。

例如(更改密码以保护无辜者) xml开始了:

<jive> 
  <adminConsole> 
    <!-- Disable either port by setting the value to -1 -->  
    <port>9090</port>  
    <securePort>9091</securePort> 
  </adminConsole>  
  <locale>en</locale>  
  <!-- Network settings. By default, Openfire will bind to all network interfaces.
      Alternatively, you can specify a specific network interfaces that the server
      will listen on. For example, 127.0.0.1. This setting is generally only useful
       on multi-homed servers. -->  
  <!--
    <network>
        <interface></interface>
    </network>
    -->  
  <connectionProvider>
    <className>org.jivesoftware.database.DefaultConnectionProvider</className>
  </connectionProvider> 
  <database>
    <defaultProvider>
      <driver>com.mysql.jdbc.Driver</driver> 
      <serverURL>jdbc:mysql://127.0.0.1:3306/dbname?rewriteBatchedStatements=true</serverURL> 
      <username encrypted="true">47c7d59aea0f0d694d698fd28ca2c605e5c6dd98da22373c</username> 
      <password encrypted="true">27f0f1a1524c7c617aab9345f5eb51d30b36a4561de0daaa147af209392c0fda</password> 
      <testSQL>select 1</testSQL> 
      <testBeforeUse>false</testBeforeUse> 
      <testAfterUse>false</testAfterUse> 
      <minConnections>5</minConnections> 
      <maxConnections>25</maxConnections> 
      <connectionTimeout>1.0</connectionTimeout>
    </defaultProvider>
  </database>
  <jdbcProvider>
    <driver>com.mysql.jdbc.Driver</driver> 
    <connectionString>jdbc:mysql://127.0.0.1/dbname?user=dbuser&amp;password=dbpass!</connectionString>
  </jdbcProvider> 
  <provider>
    <auth>
      <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
    </auth> 
    <user>
      <className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
    </user>
  </provider> 
  <jdbcAuthProvider>
    <passwordSQL>SELECT user_pass FROM hq_users WHERE user_login=?</passwordSQL> 
    <passwordType>md5</passwordType>
  </jdbcAuthProvider> 
  <jdbcUserProvider>
    <loadUserSQL>SELECT user_nicename,user_email FROM hq_users WHERE user_login=?</loadUserSQL> 
    <userCountSQL>SELECT COUNT(*) FROM hq_users</userCountSQL> 
    <allUsersSQL>SELECT user_login FROM hq_users</allUsersSQL> 
    <searchSQL>SELECT user_login FROM hq_users WHERE</searchSQL> 
    <usernameField>user_login</usernameField> 
    <nameField>user_nicename</nameField> 
    <emailField>user_email</emailField>
  </jdbcUserProvider> 
  <setup>true</setup> 
  <admin>
    <authorizedUsernames>cheng</authorizedUsernames>
  </admin>  
</jive>

但结束:

<jive> 
  <adminConsole> 
    <!-- Disable either port by setting the value to -1 -->  
    <port>9090</port>  
    <securePort>9091</securePort> 
  </adminConsole>  
  <locale>en</locale>  
  <!-- Network settings. By default, Openfire will bind to all network interfaces.
      Alternatively, you can specify a specific network interfaces that the server
      will listen on. For example, 127.0.0.1. This setting is generally only useful
       on multi-homed servers. -->  
  <!--
    <network>
        <interface></interface>
    </network>
    -->  
  <connectionProvider> 
    <className>org.jivesoftware.database.DefaultConnectionProvider</className> 
  </connectionProvider>  
  <database> 
    <defaultProvider> 
      <driver>com.mysql.jdbc.Driver</driver>  
      <serverURL>jdbc:mysql://127.0.0.1:3306/dbname?rewriteBatchedStatements=true</serverURL>  
      <username encrypted="true">47c7d59aea0f0d694d698fd28ca2c605e5c6dd98da22373c</username>  
      <password encrypted="true">27f0f1a1524c7c617aab9345f5eb51d30b36a4561de0daaa147af209392c0fda</password>  
      <testSQL>select 1</testSQL>  
      <testBeforeUse>false</testBeforeUse>  
      <testAfterUse>false</testAfterUse>  
      <minConnections>5</minConnections>  
      <maxConnections>25</maxConnections>  
      <connectionTimeout>1.0</connectionTimeout> 
    </defaultProvider> 
  </database>  
  <jdbcProvider> 
    <connectionString>jdbc:mysql://127.0.0.1/dbname?user=dbuser&amp;password=dbpass!</connectionString> 
  </jdbcProvider>  
  <provider></provider>  
  <setup>true</setup>  
  <admin> 
    <authorizedUsernames>cheng</authorizedUsernames> 
  </admin> 
</jive>

我不知道为什么会发生这种情况,而且error.log不是很直观。 我去哪里寻找这个? 感谢。

1 个答案:

答案 0 :(得分:0)

我发现openfire 3.9.3不再需要修改XML。我用来执行auth JDBC连接的唯一事情是我在ofProperty表中所做的更改。那是我唯一做过的事。当我进行这些更改时,XML文件会在服务器重置时自行修改 我希望这有助于其他人。 感谢。