如下错误信息:
Using PHOENIX_HOME:   D:\javatool\james\james-2.2.0
Using PHOENIX_TMPDIR: D:\javatool\james\james-2.2.0\temp
Using JAVA_HOME:      C:\j2sdk1.4.2_08Phoenix 4.0.1There was an uncaught exception:
---------------------------------------------------------
--- Message ---
Error building configuration from file:/D:/javatool/james/james-2.2.0/apps/james/SAR-INF/config.xml.
--- Stack Trace ---
org.apache.avalon.phoenix.interfaces.DeploymentException: Error building configuration from file:/D:/javatool/james/james-2.2.0/apps/james/SAR-INF/config.xml.
at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.getConfigurationFor(DefaultDeployer.java:499)
at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:325)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:498)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:491)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFiles(DefaultEmbeddor.java:476)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployDefaultApplications(DefaultEmbeddor.java:466)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.execute(DefaultEmbeddor.java:224)
at org.apache.avalon.phoenix.frontends.CLIMain.run(CLIMain.java:158)
at org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:144)
at org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:94)
at org.apache.avalon.phoenix.launcher.Main.main(Main.java:46)
Caused by: org.xml.sax.SAXParseException: Attribute "class" was already specified for element "accounts".
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1183)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:129)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:116)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:97)
at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.getConfigurationFor(DefaultDeployer.java:493)
... 15 more
rethrown from
org.xml.sax.SAXParseException: Attribute "class" was already specified for element "accounts".
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1183)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:129)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:116)
at org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder.build(ConfigurationBuilder.java:97)
at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.getConfigurationFor(DefaultDeployer.java:493)
at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:325)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:498)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:491)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFiles(DefaultEmbeddor.java:476)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployDefaultApplications(DefaultEmbeddor.java:466)
at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.execute(DefaultEmbeddor.java:224)
at org.apache.avalon.phoenix.frontends.CLIMain.run(CLIMain.java:158)
at org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:144)
at org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:94)
at org.apache.avalon.phoenix.launcher.Main.main(Main.java:46)---------------------------------------------------------
The log file may contain further details of error.
Please check the configuration files and restart Phoenix.
If the problem persists, contact the Avalon project.  See
http://jakarta.apache.org/avalon for more information.
Shutting down Phoenix.
我的config.xml
==============================================================
服务器段:
<servernames autodetect="true" autodetectIP="true">
<!-- CONFIRM? -->
         <servername>mcgk</servername>
      </servernames>
DNS设置:
 <dnsserver>
      <servers>
         <!--Enter ip address of your DNS server, one IP address per server -->
         <!-- element. -->
         <server>202.100.192.68</server>
          <server>202.100.199.8</server>
         
      </servers>
      <!-- Change autodiscover to false if you would like to turn off autodiscovery -->
      <!-- and set the DNS servers manually in the <servers> section -->
      <autodiscover>false</autodiscover>
      <authoritative>false</authoritative>
   </dnsserver>

解决方案 »

  1.   

    Caused by: org.xml.sax.SAXParseException: Attribute "class" was already specified for element "accounts".
    是你配置文件的格式不对,贴个完整的来。这种xml配置错误,与james没什么关系。自2.2.0之后,james3.x版本到现在也不出来,郁闷 :(
      

  2.   

    <?xml version="1.0"?>
    <!DOCTYPE config [
    <!ENTITY listserverConfig SYSTEM "../conf/james-listmanager.xml">
    <!ENTITY listserverStores SYSTEM "../conf/james-liststores.xml">
    <!ENTITY fetchmailConfig SYSTEM "../conf/james-fetchmail.xml">
    ]><!--  Configuration file for the ASF James server --><!--  This file contains important settings that control the behaviour -->
    <!--  of all of the services and repositories. --><!--                               README!                            --><!-- This configuration file is designed to run without alteration for simple tests. -->
    <!-- It assumes you have a DNS server on localhost and assigns a root password of root. --><!-- In case the defaults do not suit you, the items you are most likely to need to change -->
    <!-- are preceded by a CHECKME! or CONFIRM? comment in the left margin. --><!-- For production use you will probably need to make more extensive changes, see -->
    <!-- http://james.apache.org/documentation_2_1.html --><!-- $Revision: 1.40.2.26 $ Committed on $Date: 2004/06/16 02:42:08 $ by: $Author: noel $ --><config>
       <James><!-- CHECKME! -->
          <!-- This is the postmaster email address for this mail server. -->
          <!-- Set this to the appropriate email address for error reports -->
          <!-- If this is set to a non-local email address, the mail server -->
          <!-- will still function, but will generate a warning on startup. -->
          <postmaster>Postmaster@mcgk</postmaster>      <!-- servernames identifies the DNS namespace served by this instance of James. -->
          <!-- These servernames are used for both matcher/mailet processing and SMTP auth -->
          <!-- to determine when a mail is intended for local delivery. -->
          <!-- -->
          <!-- If autodetect is TRUE, James wil attempt to discover its own host name AND -->
          <!-- use any explicitly specified servernames. -->
          <!-- If autodetect is FALSE, James will use only the specified servernames. -->
          <!-- -->
          <!-- If autodetectIP is not FALSE, James will also allow add the IP address for each servername. -->
          <!-- The automatic IP detection is to support RFC 2821, Sec 4.1.3, address literals. -->
          <!-- -->
          <!-- To override autodetected server names simply add explicit servername elements. -->
          <!-- In most cases this will be necessary. -->
          <!-- By default, the servername 'localhost' is specified. This can be removed, if required. -->
          <!-- -->
          <!-- Warning: If you are using fetchpop it is important to include the -->
          <!-- fetched domains in the server name list to prevent looping.       -->
          <servernames autodetect="true" autodetectIP="true">
    <!-- CONFIRM? -->
             <servername>mcgk</servername>
          </servernames>      <!-- Set whether user names are case sensitive or case insensitive -->
          <!-- Set whether to enable local aliases -->
          <!-- Set whether to enable forwarding -->
          <usernames ignoreCase="true" enableAliases="true" enableForwarding="true"/>      <!-- The inbox repository is the location for users inboxes -->
          <!-- Default setting: file based repository - enter path ( use  "file:///" for absolute) -->
          <inboxRepository>
             <repository destinationURL="file://var/mail/inboxes/" type="MAIL"/>
          </inboxRepository>      <!-- Alternative inbox repository definition for DB use. -->
          <!-- The format for the destinationURL is "db://<data-source>/<table>" -->
          <!-- <data-source> is the datasource name set up in the database-connections block, below -->
          <!-- <table> is the name of the table to store user inboxes in -->
          <!-- The user name is used as <repositoryName> for this repository config. -->
          <!--
          <inboxRepository>
             <repository destinationURL="db://maildb/inbox/" type="MAIL"/>
          </inboxRepository>
          -->
      

  3.   

    <!-- Alternative inbox repository definition for DB use. -->
          <!-- Stores message body in file system, rest in database -->
          <!--
          <inboxRepository>
             <repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
          </inboxRepository>
          -->      <!-- Alternative inbox repository definition for mbox use. -->
          <!-- This method uses UNIX standard mbox files and is meant for people using mbox files -->
          <!-- with systems such as mail list archive displayers -->
          <!-- Note that dot-locking is not currently supported -->
          <!-- so network (write) accesses may cause mbox corruption -->
          <!-- the sample mbox URL is an absolute URL; mbox:///var/mail will put the users mbox files in /var/mail/-->
          <!--
          <inboxRepository>
             <repository destinationURL="mbox:///var/mail/" type="MAIL"/>
          </inboxRepository>
          -->
       </James>   <!-- Fetch pop block, fetches mail from POP3 servers and inserts it into the incoming spool -->
       <!-- Warning: It is important to prevent mail from looping by setting the  -->
       <!-- fetched domains in the <servernames> section of the <James> block     -->
       <!-- above. This block is disabled by default.                             -->
       <!-- FetchPOP is being deprecated in favor of FetchMail                    -->
        <fetchpop enabled="false">
            <!-- You can have as many fetch tasks as you want, but each must have a -->
            <!-- unique name by which it identified -->
            <fetch name="mydomain.com">
                <!-- Host name or IP address -->
                <host>mail.mydomain.com</host>
                <!-- Account login username -->
                <user>username</user>
                <!-- Account login password -->
                <password>pass</password>
                <!-- How frequently this account is checked - in milliseconds. 600000 is every ten minutes -->
                <interval>600000</interval>
            </fetch>
        </fetchpop>    <!-- This is an example configuration for FetchMail, a JavaMail based gateway  -->
        <!-- service that pulls messages from other sources, and inserts them into the -->
        <!-- spool.  They are then processed normally, although FetchMail generally    -->
        <!-- has to fabricate some of the envelope information.  FetchMail should be   -->
        <!-- considered a mail gateway, rather than a relay, in RFC terms.             -->
        <!-- Fetchmail is a functionally richer replacement for FetchPOP.              -->
        <!-- CHECKME: FetchMail is disabled by default, and must be configured to use. -->
        <!-- Edit the file referred to by fetchmailConfig to enable and configure.     -->
           <!-- The James Spool Manager block  -->
       <!-- -->
       <!-- This block is responsible for processing messages on the spool. -->
       <fetchmail>
          <!-- Number of spool threads -->
          <fetch>
                   <accounts match="RelayLimit=30" class="Null" name="error" class="org.apache.james.mailrepository.JDBCSpoolRepository">SYNCHRONOUS<!-- To destroy all messages, uncomment this matcher/mailet configuration -->
                   <!-- Uncomment this if you want to bind to a specific inetaddress -->ASYNCHRONOUS<!--
          <bind> </bind>
          -->
                   <!-- The news groups hosted in this NNTP repository. -->CACHE<!-- Groups here will be added to those found in the file system,
               but removing groups from here will NOT remove them from the
               server.  Change <newsgroups> to <newsgroups only="true"> to
               restrict newsgroups to ONLY those found in this list.  -->
                <!-- Change autodiscover to false if you would like to turn off autodiscovery -->
             <!-- This is the name used by the server to identify itself in the SMTP -->
          <!-- protocol.  If autodetect is TRUE, the server will discover its -->
       <!-- own host name and use that in the protocol.  If discovery fails, -->   <!-- The Connection Manager block -->
       <!-- -->
       <!-- The idle-timeout is the number of milliseconds that it will take for idle -->
       <!-- client connections managed by this connection manager to be ed at timed out. -->
       <!-- If no value is specified, the value defaults to 5 minutes, 300000 milliseconds -->
       <!-- A value of 0 means that client sockets will not timeout. -->
       <!-- -->
       <!-- The max-connections parameter specifies the default maximum number of client -->
       <!-- connections that this connection manager will allow per managed server socket. -->
       <!-- This value can be overridden by each individual service. -->
       <!-- If no value is specified, the value defaults to 30. -->
       <!-- A value of 0 means that there is no limit imposed by the connection manager, although -->
       <!-- resource limitations imposed by other components (i.e. max # of threads) may -->
       <!-- serve to limit the number of open connections. -->
       <!-- -->
       <alllocal match="All" class="ToRepository" autodetect="true" match="All" class="ToRepository">
          <!-- Set the Java packages from which to load mailets and matchers -->300000<!- 1:n mapping ->
          <!-- Changing the repositoryPath, as in this commented out example, will -->><!-- These repositories store message delivery and headers in the DB, and the body to the filesystem -->
       <!--
             <authRequired>true</authRequired>
             -->
      

  4.   

    <!-- The Socket Manager block -->
       <!-- -->
       <!-- The server-sockets element has a number of factory sub-elements. -->
       <!-- Each of the factory elements has a name and class attribute -->
       <!-- The name attribute for each factory element must be unique.  -->
       <!-- The class attribute is the name of a class that implements the -->
       <!-- interface org.apache.avalon.cornerstone.services.ServerSocketFactory -->
       <!-- Specific factory elements may require some sub-elements.  This is -->
       <!-- factory class dependent. -->
       <!-- -->
       <!-- The client-sockets element has a number of factory sub-elements. -->
       <!-- Each of the factory elements has a name and class attribute -->
       <!-- The name attribute for each factory element must be unique.  -->
       <!-- The class attribute is the name of a class that implements the -->
       <!-- interface org.apache.avalon.cornerstone.services.SocketFactory -->
       <!-- Specific factory elements may require some sub-elements.  This is -->
       <!-- factory class dependent. -->
       <!-- -->
       <account name="root" match="InSpammerBlacklist=query.bondedsender.org"
                     class="ToProcessor" autodetect="true" match="All" class="ToRepository">
          <!-- If the host is handled by this server and it did not get -->
             <!-- File based repositories.  These repositories store all message data -->
             <!--
             <factory name="ssl" class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory">
                <keystore>
                   <file>conf/keystore</file>
                   <password>secret</password>
                   <type>JKS</type>
                   <protocol>TLS</protocol>
                   <algorithm>SunX509</algorithm>
                   <authenticate-client>false</authenticate-client>
                </keystore>
             </factory>
             -->
          <!-- Disabling blocks will stop them from listening, -->
          <!-- but does not free as many resources as removing them would -->
             <!-- NNTP-specific: if you disable the NNTP Server, you should also set the nntp-repository's
             threadCount to 0, otherwise there will be threads active and polling  -->
          <!-- This processor handles messages that are for foreign domains, where relaying is denied -->
       <!-- THE NNTP PROTOCOL IS EXPERIMENTAL AND NOT AS WELL TESTED AS SMTP AND POP3 IN THIS RELEASE.
            The James project recommends that you check the James web site for updates to the NNTP
            service.  -->   <!-- The Thread Manager block -->
       <!-- -->
       <!-- The thread manager provides thread pools for use throughout the server. -->
       <!-- -->
       <!-- A thread pool with the name "default" must be defined in this thread manager -->
       <!-- configuration. -->
       <!-- -->
       <!-- Each thread pool is defined with a "thread-group" element. -->
       <!-- Each of these elements has the following required sub-elements: -->
       <!--   name - the name of the thread pool, used by other components to -->
       <!--          lookup the thread pool -->
       <!--   priority - the thread priority for threads in the pool.  This is -->
       <!--              a value between 0 and 10, with 5 being the normal -->
       <!--              priority and 10 being the maximum. -->
       <!--   is-daemon - whether the threads in the pool are daemon threads. -->
       <!--   max-threads - the maximum number of threads allowed in the pool. -->
       <!--   min-threads - the minimum number of threads allowed in the pool. (not implemented) -->
       <!--   min-spare-threads - (not implemented) -->
       <!-- Set the authRequired value to true to enable authenticated NNTP -->
          <!-- will use the specified value. -->
             <!-- Currently, this works if the OS has a unix-like /etc/resolv.conf,-->default<!-- or the system is Windows based with ipconfig or winipcfg.-->
             <!-- -->5<!-- If no DNS servers are found and you have not specified any below, 127.0.0.1 will be used-->
             <!-- Spool repository configuration -->false<!-- The spool repository is the location where incoming mails are temporarily stored -->
             <!-- before being processed. -->100<!-- Disabling blocks will stop them from listening, -->
             <!-- but does not free as many resources as removing them would -->20<!-- The servers element can have multiple server children. -->
             <!-- Alternative spool repository definition for JDBC use -->20<!--
          <spoolRepository>
             <repository destinationURL="db://maildb/spool/spool" type="SPOOL"/>
          </spoolRepository>
          -->
          <!-- Alternative spool repository definition for JDBC use -->
       <!-- Stores message body in file system, rest in database -->
    <!--
          <spoolRepository>
             <repository destinationURL="dbfile://maildb/spool/spool" type="SPOOL"/>
          </spoolRepository>
          -->
    </accounts>      <!-- The User Storage block -->
       <host name="LocalUsers" class="org.apache.james.userrepository.UsersFileRepository">   <!--
                  James has previously used an in-house connection pool, Mordred.
                  Mordred is being deprecated in favor of Jakarta Commons DBCP.
                  To use DBCP:    org.apache.james.util.dbcp.JdbcDataSource
                  To use Mordred: org.apache.james.util.mordred.JdbcDataSource              Change it back, of course, to use Mordred.              NOTE: DBCP is configured to recover from a database server outage.
                        This, alone, may be reason for you to give it a try.
             -->
      

  5.   

    <!-- This block is responsible for processing messages on the spool. -->
       <fetchmail>
          <!-- Number of spool threads -->
          <fetch>
                   <accounts match="RelayLimit=30" class="Null" name="error" class="org.apache.james.mailrepository.JDBCSpoolRepository">SYNCHRONOUS<!-- To destroy all messages, uncomment this matcher/mailet configuration -->
                   <!-- Uncomment this if you want to bind to a specific inetaddress -->ASYNCHRONOUS<!--
          <bind> </bind>
          -->这段有问题啊,竟然有两个class属性。不熟悉的话建议不要乱动xml文件,你最好找个xml编辑器检查一下的xml是否正确。
      

  6.   

    建议不要将JAMES安装在Program Files目录下,JAMES有时不能正确解析带有空格的路径,换一个简单的路径试一下