Servlet启动错误 - "请求的资源不可用"

时间:2017-09-07 13:25:02

标签: java xml tomcat servlets browser

我很清楚已经有很多很多相关的问题已经提出来,以及更多答案。不幸的是,在尝试了所有这些建议后,我仍然无法解决这个问题。

我正在尝试按照教科书中的说明在浏览器中启动一个简单的Java servlet:

Java编程:综合概念与技术,Shelly Cashman系列,ISBN:9781418859855。

我知道这里给出了有关这个/类似问题的其他人的建议,servlet应该优先写在一个软件包下,而不是无包装,但我遵循教科书的指导,并且当然是一本教科书,它的方法必须有效。我在这种方法中寻求帮助。

我有一个名为HTMLBank.java的Java servlet,我成功编译后没有编译错误。现在,根据教科书:

1)将.class文件放入 C:\ Program Files \ Apache Software Foundation \ Tomcat 5.5 \ webapps \ ROOT \ WEB-INF \ classes 文件夹中。是的,教科书使用此默认包和Tomcat的ROOT目录。

2)运行Tomcat服务 - 它正在运行(显示为绿色"播放"屏幕右下角的箭头)。

3)在浏览器中输入网址: http://localhost:8080/servlet/HTMLBank 并输入。执行此操作后,会出现以下错误:

The Error.

现在,我可能会提到我之前曾成功启动过servlet,但这只是我使用了一个包,比如com.example并将其映射到web.xml文件中,但如前所述,这偏离了从教科书中我需要使用默认包和ROOT目录使其工作。

以下是HTMLBank.java servlet文件的代码:

import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;
import java.util.*;

public class HTMLBank extends HttpServlet
{
    public void init() throws ServletException {}

    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        response.setHeader("Expires", "Tues, 01 Jan 1980 00:00:00 GMT");

        out.println("<html>");
            out.println("<title>Online Bank ATM Simulator</title>");
            out.println("<h1>Tester Text.</h1>");
            out.println("<body>This serves to test functioning of the servlet in browser.</body>");
        out.println("</html>");
    }

    public void destroy(){}
}

以下是web.xml文件的代码:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Tomcat
  </description>

<!-- JSPC servlet mappings start -->

    <servlet>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>

<!-- JSPC servlet mappings end -->

<-- added the following for invoker servlet -->
    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
            org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

</web-app>

每个书籍指南修改了web.xml文件,以允许在默认目录中查找匿名servlet。

这是context.xml文件:

<!-- The contents of this file will be loaded for each web application -->
<Context reloadable="true">     <!-- Enabled Tomcat Servlet reloading -->

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>META-INF/context.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

</Context>

此文件已编辑以启用servlet重新加载,也可按照书籍指南进行。

以下是此讨论中涉及的所有文件/文件夹的路径:

C:\ Program Files \ Apache Software Foundation \ Tomcat 5.5 \ webapps \ ROOT \ WEB-INF \ classes - &gt;我创建了&#34;类&#34;文件夹,每本书指南。

C:\ Program Files \ Apache Software Foundation \ Tomcat 5.5 \ webapps \ ROOT \ WEB-INF \ classes \ HTMLBank.class - &gt;我把.class文件放到这里。

C:\ Program Files \ Apache Software Foundation \ Tomcat 5.5 \ webapps \ ROOT \ WEB-INF \ web.xml - &gt;这是已编辑的web.xml文件的位置。

C:\ Program Files \ Apache Software Foundation \ Tomcat 5.5 \ conf \ context.xml 是已编辑的context.xml文件的位置。

所以,正如我所说,我需要在没有包和ROOT的情况下处理servlet。我该怎么做?

我还发布了Tomcat生成的错误日志文件的内容,如果它有助于识别问题:

08 Sep 2017 10:47:53 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
08 Sep 2017 10:47:53 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3887 ms
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08 Sep 2017 10:47:57 AM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 42 column 2: The content of elements must consist of well-formed character data or markup.
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 42 column 2
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
08 Sep 2017 10:47:57 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
08 Sep 2017 10:47:57 AM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
08 Sep 2017 10:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08 Sep 2017 10:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08 Sep 2017 10:47:58 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
08 Sep 2017 10:47:58 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
08 Sep 2017 10:47:58 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/152  config=null
08 Sep 2017 10:47:58 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
08 Sep 2017 10:47:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4765 ms
09 Sep 2017 10:44:16 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
09 Sep 2017 10:44:18 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.jsp_classpath', '/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/servlets-examples/WEB-INF/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-en.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-es.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-fr.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-ja.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/commons-el.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler-jdt.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-runtime.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jsp-api.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory-dbcp.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-resources.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/bin/bootstrap.jar;/C:/Program%20Files/Java/jre6/lib/ext/dnsns.jar;/C:/Program%20Files/Java/jre6/lib/ext/localedata.jar;/C:/Program%20Files/Java/jre6/lib/ext/servlet-api.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunjce_provider.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunmscapi.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunpkcs11.jar')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@257f1b')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('javax.servlet.context.tempdir', 'C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\servlets-examples')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.resources', 'org.apache.naming.resources.ProxyDirContext@1bbdd48')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1d6fbb3')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1d6fbb3')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@126d3df')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.jsp_classpath', '/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/lib/jstl.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/lib/standard.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-en.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-es.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-fr.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-ja.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/commons-el.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler-jdt.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-runtime.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jsp-api.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory-dbcp.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-resources.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/bin/bootstrap.jar;/C:/Program%20Files/Java/jre6/lib/ext/dnsns.jar;/C:/Program%20Files/Java/jre6/lib/ext/localedata.jar;/C:/Program%20Files/Java/jre6/lib/ext/servlet-api.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunjce_provider.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunmscapi.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunpkcs11.jar')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@c5aa00')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('javax.servlet.context.tempdir', 'C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\jsp-examples')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.resources', 'org.apache.naming.resources.ProxyDirContext@11c0d60')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@136d9d8')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@136d9d8')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1827d1')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080

1 个答案:

答案 0 :(得分:0)

好的,伙计们,我解决了这个问题:

错误日志实际上显示web.xml文件的第42行有错误。我检查了那一行,并在开头发现了一个非常愚蠢的错字 - 评论开始标记不正确。差不多3个星期在错误的地方搜索,因为我从来没想过会检查这样的事情。

尽管如此,感谢所有回复的人,非常感谢!