- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
尝试使用上述技术实现 SSE,但微服务部署失败 -
Resource -
@Path("/status-management")
public interface ISocketResource {
@GET
@Path("/v1/statusSocket")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void stockEvents(
@QueryParam("entityProcessContexts") List<String> entityProcessContexts,
@Context Sse sse,
@Context SseEventSink sseEventSink);
}
CXF 服务器注册 -
@Bean
public Server cxfServer() {
List<Object> serviceBeans = new ArrayList<Object>(ctx.getBeansWithAnnotation(Path.class).values());
List<Object> providers = new ArrayList<Object>(ctx.getBeansWithAnnotation(Provider.class).values());
providers.add(new FormEncodingProvider<Object>());
JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
factory.setBus(ctx.getBean(SpringBus.class));
factory.setServiceBeans(serviceBeans);
factory.setProviders(providers);
factory.setFeatures(Arrays.asList(new SseFeature()));// registering SseFeature
Server server = factory.create();
return server;
}
异常 - 当 jersey 尝试加载 ext @Provider 类 - CXF 包的 OutboundSseEventBodyWriter 时失败。
OutboundSseEventBodyWriter 类有一个 protected 构造函数,不会导致问题。
WARNING: HK2 service reification failed for [org.apache.cxf.jaxrs.sse.OutboundSseEventBodyWriter] with an exception:
MultiException stack 1 of 2
java.lang.NoSuchMethodException: Could not find a suitable constructor in org.apache.cxf.jaxrs.sse.OutboundSseEventBodyWriter class.
at org.glassfish.jersey.inject.hk2.JerseyClassAnalyzer.getConstructor(JerseyClassAnalyzer.java:192)
at org.jvnet.hk2.internal.Utilities.getConstructor(Utilities.java:180)
at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:129)
at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:180)
at org.jvnet.hk2.internal.SystemDescriptor.internalReify(SystemDescriptor.java:740)
at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:694)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:464)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2310)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$1200(ServiceLocatorImpl.java:128)
at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1390)
at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:128)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1452)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1377)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServiceHandles(ServiceLocatorImpl.java:1366)
....
.
.
.
.
.
MultiException stack 2 of 2
java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
implementation=org.apache.cxf.jaxrs.sse.OutboundSseEventBodyWriter
contracts={javax.ws.rs.ext.MessageBodyWriter}
scope=javax.inject.Singleton
qualifiers={org.glassfish.jersey.internal.inject.Custom}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=
rank=0
loader=null
proxiable=null
proxyForSameScope=null
analysisName=null
id=189
locatorId=0
identityHashCode=1355595726
reified=false)
at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:705)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:464)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2310)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$1200(ServiceLocatorImpl.java:128)
at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl$9.compute(ServiceLocatorImpl.java:1390)
.
.
.
.
<Nov 20, 2018, 11:19:17,989 AM IST> <Error> <HTTP> <BEA-101216> <Servlet: "JAX-RS/Jersey#1" failed to preload on startup in Web application: "/businessstatus-ms".
A MultiException has 2 exceptions. They are:
1. java.lang.InstantiationException
2. java.lang.IllegalStateException: Unable to perform operation: create on org.apache.cxf.jaxrs.provider.AbstractResponseViewProvider
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:392)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:83)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:71)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
Truncated. see log file for complete stacktrace
Caused By: java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375)
at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:272)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:366)
Truncated. see log file for complete stacktrace
最佳答案
在此处查看有关如何在 WebLogic 上使用 Apache CXF 的建议: http://cxf.apache.org/docs/jax-rs-deployment.html查看 WebLogic 部分。
关于java - SSE实现(Weblogic 12.2.1.2.0 + Jax-RS 2.1(用于注册资源)+ CXF 3.2.5+ + Springboot + jersey 2.25.1),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53480167/
我将Eclipse Helios Service Release 2版本用于apache cxf。当我转到windo->首选项-> Web服务-> CXF 2.x首选项,并设置cxf运行时时,版本和类
我是任何开放框架的新手(我是基于 java 的解决方案工程师)并试图构建一个 cxf 项目。 我知道我需要 applicationContext.xml文件和内容之类的
我想为不同的目的注册不同的类,以便在同一阶段调用 (Phase.PRE_INVOKE)。是否可以? 最佳答案 看这里http://cxf.apache.org/docs/interceptors.ht
我想使用 wsdl2java(CXF) 命令生成自定义包。 我的 WSDL 结构是: wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/w
我在通过 JAXRSClientFactoryBean.create 创建的 CXF 中有一个 JAX-RS 客户端。如何设置连接/接收超时? 我想我需要掌握管道,但不知道如何操作。这个项目没有使用
鉴于来自 fuse 源的 apache-servicemix-4.4.1-fuse-00-08 的“cxf-osgi”示例,使用 maven 3.0.3 构建,将其部署到 apache karaf 2
这个问题在这里已经有了答案: How do I fix a NoSuchMethodError? (33 个答案) 关闭 29 天前。 我刚刚尝试通过 Maven 使用 Apache CXF 和 S
我正在尝试使用 Apache CXF 开发一个 API 调用,该调用会随请求一起接收附件。我遵循了 this 教程,这就是我到目前为止所得到的。 @POST @Path("/upload") @Req
'org.apache.cxf.tools.wsdlto.WSDLToJava' 将 wsdl 转换为 java 类。 它是在内部使用 JAXB 吗?为什么这个命令能够生成类似于“xjc”创建的类?有
我已经使用 CXF 和 Spring 开发了一个 Java Web 服务。 由于安全原因,我想隐藏 WSDL,尽管 WS 仍然可用。 有没有办法使用 CXF 做到这一点? 最佳答案 您可以在 web.
我有一个生成的 JAXB 类(来自 XSD)。我能够以 XML 和 JSON 的形式返回,但是一旦我将 text/html 添加到我的 Produces 注释中,我就会得到: "No message
我创建了一个非常简单的基于 cxf 的非 spring Servlet,它加载了一个 javax.ws.rs.Application类型。 这是 web.xml: CXFSe
我正在使用 JBOSS EAP 6.2 来部署 restful web 服务。 restful web 服务使用 apache cxf,它取自 jboss eap。目前它使用 jar cxf-api-
我有一个服务方法定义为: public JaxbList getDeal() { List deals = new ArrayList(); Deal type = new Deal(
我需要将 wadl 转换为 java pojo,为此我已经下载了 apache cxf 3.0.1 版本。但是当我在命令提示符下运行 wadl2java bat 文件时,出现以下异常 D:\softw
这个问题在这里已经有了答案: 9年前关闭。 Possible Duplicate: Which maven2 artifacts are necessary to build a WS with CX
我想将一个简单的 CXF Jax-Ws 服务器部署到 ServiceMix。它只是一个同时具有服务接口(interface)和 impl 类的 OSGI 包。我需要将它部署到不同的 ServiceMi
是否可以在 wso2 ESB 中部署 CXF Web 服务? 目前我已经开始从 WSO2 User Guide 引用 wso2 的文档。我想将现有的 CXF Web 服务部署到 ESB。因此,有关这方
我想了解 cxf-bundle和 cxf-bundle-jaxrs jar 。它们是两个不同的 jar ,还是前者本身包含后者? 谢谢,巴蒂亚 最佳答案 前者包含后者。 但是,您实际上不应该使用其中任
我已经built and deployed a custom web services consumer in Java on Domino using the available CXF frame
我是一名优秀的程序员,十分优秀!