我正在尝试在WebLogic 12c(12.1.3)中运行的简单RESTful中实现JSON-B,该项目的部署没有错误,但是在调用JsonbBuilder.create()时资源.java@POST@Consumes(MediaType.APPLICATION_JSON)@Produces(MediaType.TEXT_PLAIN)public String getText(String arg) { Jsonb jsonb = JsonbBuilder.create(); RespSmsNexmo respFromJson = jsonb.fromJson(arg, RespSmsNexmo.class); return respFromJson.text;}它产生这个:INFO: Initiating Jersey application, version 'Jersey: 1.18.1 02/19/2014 03:28 AM' Jun 26, 2018 11:26:46 AM com.sun.jersey.server.impl.application.DeferredResourceConfig$ApplicationHolder <init>INFO: Instantiated the Application class gt.com.atel.wgtm_0040.AplicationConfig Jun 26, 2018 11:49:44 AM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerExceptionSEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container javax.json.bind.JsonbException: JSON Binding provider org.eclipse.yasson.JsonBindingProvider not found at javax.json.bind.spi.JsonbProvider.provider(JsonbProvider.java:120) at javax.json.bind.JsonbBuilder.create(JsonbBuilder.java:108) at gt.com.atel.wgtm_0040.GenericResource.getText(GenericResource.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at 在pom.xml文件中,我没有声明任何依赖项,因为JDK 8足以使用JSON-B
添加回答
举报
0/150
提交
取消