gpt4 book ai didi

mysql - 尝试运行 Web 应用程序时出现 fatal error :3:2: The markup in the document following the root element must be well-formed.

转载 作者:行者123 更新时间:2023-11-28 23:40:05 25 4
gpt4 key购买 nike

我第一次遇到这个错误。我不知道发生了什么,但它似乎与我的 context.xml 文件有关。

这是来自tomcat的错误

[Fatal Error] :3:2: The markup in the document following the root element must be well-formed.
C:\Users\Nyco.tony-PC\Documents\NetBeansProjects\Apo\nbproject\build-impl.xml:724:
Deployment error:
Tomcat configuration file C:\Users\Nyco.tony-PC\Documents\NetBeansProjects\Apo\web\META- INF\context.xml seems to be broken. Please make sure it is parseable and valid.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:232)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor313.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

Caused by: org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException: Tomcat configuration file C:\Users\Nyco.tony-PC\Documents\NetBeansProjects\Apo\web\META-INF\context.xml seems to be broken. Please make sure it is parseable and valid.
at org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration.getContext(TomcatModuleConfiguration.java:176)
at org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration.getDatasources(TomcatModuleConfiguration.java:201)
at org.netbeans.modules.j2ee.deployment.config.ConfigSupportImpl.getDatasources(ConfigSupportImpl.java:398)
at org.netbeans.modules.j2ee.deployment.impl.DeploymentHelper.deployJdbcDrivers(DeploymentHelper.java:87)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:180)
... 16 more
Caused by: java.lang.RuntimeException: DOM graph creation failed: org.netbeans.modules.schema2beans.Schema2BeansRuntimeException: Failed to create the XML-DOM Document. Check your XML to make sure it is correct.
The markup in the document following the root element must be well-formed.
at org.netbeans.modules.tomcat5.config.gen.Context.createGraph(Context.java:3178)
at org.netbeans.modules.tomcat5.config.gen.Context.createGraph(Context.java:3162)
at org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration.getContext(TomcatModuleConfiguration.java:169)
... 20 more

并认为我的 context.xml 文件中只有 3 行

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/Apo"/>
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/apo" password="user" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/apo" username="myUser"/>

最佳答案

尝试将 Resource 标签放在 Context 标签内,例如:

<Context antiJARLocking="true" path="/Apo">
<Resource auth="Container" .../>
</Context>

关于mysql - 尝试运行 Web 应用程序时出现 fatal error :3:2: The markup in the document following the root element must be well-formed.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20549533/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com