为什么James在改动config.xml后,再启动run.bat服务就一闪而过呢?然后再也联不上4555端口了?
解答:首先看log文件,里面有启动的信息:
INFO 2011-04-11 22:11:49.843 [Phoenix ] (): Logger started
WARN 2011-04-11 22:11:49.875 [Phoenix ] (): Phoenix was not started by the daemon thus it will not be possible to restart the JVM via the Management interface.
INFO 2011-04-11 22:11:50.015 [Phoenix.] (): Installing Sar located at file:/D:/james-2.3.2/apps/james.sar.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/sqlResources.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/sqlResources.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/james-fetchmail.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/james-fetchmail.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/james-smtphandlerchain.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/james-smtphandlerchain.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/miResources.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/miResources.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/james-listmanager.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/james-listmanager.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.187 [Phoenix.] (): The file conf/james-liststores.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/james-liststores.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/maxMessageSize.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/maxMessageSize.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/oneAccountManyUsers.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/oneAccountManyUsers.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/oneAccountManyUsersDynamic.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/oneAccountManyUsersDynamic.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/oneAccountPerUser.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/oneAccountPerUser.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/oneAccountPerUserDynamic.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/oneAccountPerUserDynamic.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file conf/samples/fetchmail/remoteReceivedHeader.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/conf/samples/fetchmail/remoteReceivedHeader.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file SAR-INF/config.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/SAR-INF/config.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file SAR-INF/assembly.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/SAR-INF/assembly.xml because there is a file in the way.
WARN 2011-04-11 22:11:50.203 [Phoenix.] (): The file SAR-INF/environment.xml can not be extracted from the Sar "file:/D:/james-2.3.2/apps/james.sar" into directory D:/james-2.3.2/apps/james/SAR-INF/environment.xml because there is a file in the way.
ERROR 2011-04-11 22:11:50.265 [Phoenix.] (): Error building configuration from file:/D:/james-2.3.2/apps/james/SAR-INF/config.xml.
org.xml.sax.SAXParseException: The string "--" is not permitted within comments.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanComment(XMLScanner.java:774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanComment(XMLDocumentFragmentScannerImpl.java:1040)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2953)
注意:里面有除了一个ERROR,其它的都是WARN警告,问题就出现在这里,这说在改动config.xml文件时出也错,一定要注意改动.xml文件的规则,我的问题出现在.xml注释那个地方:
我把那段要注释的地方改成了这样,这是不对的,看上去很是对,但是不满足xml文件的注释格式。
<!--mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
<processor> relay-denied </processor>
<notice>550 - Requested action not taken: relaying denied</notice>
</mailet>
正确的格式是这样的:
<!--
<mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
<processor> relay-denied </processor>
<notice>550 - Requested action not taken: relaying denied</notice>
</mailet>
-->