gpt4 book ai didi

java - Jersey :找不到类的语法元素

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:03:14 25 4
gpt4 key购买 nike

我将 Grails 与 JaxRS 311 plugin 结合使用.我将它与 Jersey 一起使用。

我的应用程序在 tomcat 7.0.55 服务器上运行。我的生产服务器日志显示以下信息消息。我想知道为什么“找不到类的语法元素”是一个 INFO 日志。这是日志:

INFO: Couldn't find grammar element for class test.shared.dto.NotificationDtoCollection
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UserDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDtoCollection
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UploadItemDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.UploadItemDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDetailsDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class test.shared.dto.ItemDetailsDto
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class boolean
Sep 09, 2014 3:01:03 AM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes

我发现了以下问题,但它们对我的情况没有帮助:Jersey: what does "couldn't find grammar element" mean?A JSON object in a POST request for webserver with JERSEY

我所有的类都有一个公共(public)默认构造函数,并且可能是第二个参数化构造函数:

class UserDto {

String id
String firstName
String lastName

public UserDto() { }

public UserDto(User user, User currentUser) {
...
}

}

这些 INFO 日志消息是什么意思,我该如何阻止它们?

最佳答案

如果您在 web.xml 中设置以下参数,这些消息将会消失在你的 <servlet> 的定义里面:

<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
</init-param>

并重启你的serlvet容器使其生效。

关于java - Jersey :找不到类的语法元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25915049/

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