gpt4 book ai didi

java - Tomcat 无法解析 web.xml,在提到的代码点没有错误

转载 作者:行者123 更新时间:2023-11-28 22:06:26 26 4
gpt4 key购买 nike

我正在为我的网络服务使用 Jersey,这就是我的 web.xml 的样子:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<servlet>
<servlet-name>jersey</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>

<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-name>com.rohanprabhu.external.interfaces.service.web</param-name>
</init-param>**

<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-name>true</param-name>
</init-param>

<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey</servlet-name>
<url-pattern>*</url-pattern>
</servlet-mapping>
</web-app>

我收到一个错误Occurred at line 10 column 22,这是我在我的文件中标记为“**”的地方(它实际上不在文件中,我只是把它在这里)。这是我得到的堆栈跟踪的(一部分):

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:889)
at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:476)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057)
... 188 more
Occurred at line 10 column 22
Marking this application unavailable due to previous error(s)

这是整个堆栈跟踪,以防有帮助:http://pastebin.com/EX4bMGex

最佳答案

我同意错误消息不是最理想的,但我也确定您想要一个 <param-name>和一个<param-value><init-param> . :-)

关于java - Tomcat 无法解析 web.xml,在提到的代码点没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26103414/

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