爲了簡化開發我的端點返回JSON,我想啓用prettyprinting。WildFly 10 NoDefClassFound com/fasterxml/jackson/jaxrs/cfg/ObjectWriterModifier
solution I'm tyring to implement正在添加一個過濾器,該過濾器注入一個ObjectWriterModifier以啓用默認漂亮打印機,如果查詢字符串是?pretty = 1。因爲它無法找到這是我WildFly 10安裝modules/system/layer/base/com/fasterxml/jackson/core/jaxrs/jackson-jaxrs-json-provider
下包含在jackson-jaxrs-base-2.7.4.jar
類com/fasterxml/jackson/jaxrs/cfg/ObjectWriterModifier
部署失敗。
在我的build.gradle我做指定dependicy爲提供:
dependencies {
providedCompile 'javax:javaee-api:7.0'
providedCompile 'com.fasterxml.jackson.core:jackson-core:2.7.4'
providedCompile 'com.fasterxml.jackson.core:jackson-annotations:2.7.4'
providedCompile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.7.4'
}
這裏是module.xml爲傑克遜JAXRS JSON的提供商
<module xmlns="urn:jboss:module:1.3" name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider">
<resources>
<resource-root path="jackson-jaxrs-json-provider-2.7.4.jar"/>
<resource-root path="jackson-jaxrs-base-2.7.4.jar"/>
<resource-root path="jackson-module-jaxb-annotations-2.7.4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.ws.rs.api"/>
<module name="javax.xml.bind.api"/>
<module name="com.fasterxml.jackson.core.jackson-annotations"/>
<module name="com.fasterxml.jackson.core.jackson-core"/>
<module name="com.fasterxml.jackson.core.jackson-databind"/>
</dependencies>
</module>
我沒有看到WildFly如何找不到它所提供的其中一個罐子裏面的班級