apache camel - how to setup a fuse/blueprint cxf test - NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I -
my camel-blueprint project contains simple rest endpoint provide status. works fine.
but want create integration test , need run rest route within junit test. have many working tests extend camelblueprinttestsupport
.
but can't working test serves rest endpoint. fought through many exceptions added many dependencies. added stuff mentioned in this example (i using current versions). exeptions occurred on booting context gone now.
but on fireing request against configured endpoint still exception: nosuchmethoderror: javax.servlet.http.httpservletresponse.getstatus()i
here stacktrace:
org.apache.cxf.interceptor.fault: !(jetty || servlet 3.0 || continuationfilter) while invoking public abstract java.lang.string ...servicestatusinterface.requestget() params []. @ org.apache.cxf.service.invoker.abstractinvoker.createfault(abstractinvoker.java:166) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:140) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:200) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:99) @ org.apache.cxf.interceptor.serviceinvokerinterceptor$1.run(serviceinvokerinterceptor.java:59) @ org.apache.cxf.interceptor.serviceinvokerinterceptor.handlemessage(serviceinvokerinterceptor.java:96) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:308) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:121) @ org.apache.cxf.transport.http.abstracthttpdestination.invoke(abstracthttpdestination.java:252) @ org.apache.cxf.transport.http_jetty.jettyhttpdestination.doservice(jettyhttpdestination.java:234) @ org.apache.cxf.transport.http_jetty.jettyhttphandler.handle(jettyhttphandler.java:70) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1129) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1065) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:544) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745) caused by: java.lang.illegalstateexception: !(jetty || servlet 3.0 || continuationfilter) @ org.eclipse.jetty.continuation.continuationsupport.getcontinuation(continuationsupport.java:108) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationwrapper.<init>(jettycontinuationwrapper.java:46) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:64) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:52) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.getcontinuation(cxfrsinvoker.java:78) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.performinvocation(cxfrsinvoker.java:66) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:96) ... 21 more 2016-11-17 17:48:10,749 warn [ty-service] org.apache.cxf.phase.phaseinterceptorchain: exception in handlefault on interceptor org.apache.cxf.jaxrs.interceptor.jaxrsdefaultfaultoutinterceptor@3231c28a org.apache.cxf.interceptor.fault: !(jetty || servlet 3.0 || continuationfilter) while invoking public abstract java.lang.string ...servicestatusinterface.requestget() params []. @ org.apache.cxf.service.invoker.abstractinvoker.createfault(abstractinvoker.java:166) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:140) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:200) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:99) @ org.apache.cxf.interceptor.serviceinvokerinterceptor$1.run(serviceinvokerinterceptor.java:59) @ org.apache.cxf.interceptor.serviceinvokerinterceptor.handlemessage(serviceinvokerinterceptor.java:96) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:308) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:121) @ org.apache.cxf.transport.http.abstracthttpdestination.invoke(abstracthttpdestination.java:252) @ org.apache.cxf.transport.http_jetty.jettyhttpdestination.doservice(jettyhttpdestination.java:234) @ org.apache.cxf.transport.http_jetty.jettyhttphandler.handle(jettyhttphandler.java:70) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1129) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1065) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:544) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745) caused by: java.lang.illegalstateexception: !(jetty || servlet 3.0 || continuationfilter) @ org.eclipse.jetty.continuation.continuationsupport.getcontinuation(continuationsupport.java:108) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationwrapper.<init>(jettycontinuationwrapper.java:46) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:64) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:52) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.getcontinuation(cxfrsinvoker.java:78) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.performinvocation(cxfrsinvoker.java:66) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:96) ... 21 more 2016-11-17 17:48:10,751 error [ty-service] org.apache.cxf.interceptor.abstractfaultchaininitiatorobserver: error occurred during error handling, give up! org.apache.cxf.interceptor.fault: !(jetty || servlet 3.0 || continuationfilter) while invoking public abstract java.lang.string ...servicestatusinterface.requestget() params []. @ org.apache.cxf.service.invoker.abstractinvoker.createfault(abstractinvoker.java:166) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:140) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:200) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:99) @ org.apache.cxf.interceptor.serviceinvokerinterceptor$1.run(serviceinvokerinterceptor.java:59) @ org.apache.cxf.interceptor.serviceinvokerinterceptor.handlemessage(serviceinvokerinterceptor.java:96) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:308) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:121) @ org.apache.cxf.transport.http.abstracthttpdestination.invoke(abstracthttpdestination.java:252) @ org.apache.cxf.transport.http_jetty.jettyhttpdestination.doservice(jettyhttpdestination.java:234) @ org.apache.cxf.transport.http_jetty.jettyhttphandler.handle(jettyhttphandler.java:70) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1129) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1065) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:544) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745) caused by: java.lang.illegalstateexception: !(jetty || servlet 3.0 || continuationfilter) @ org.eclipse.jetty.continuation.continuationsupport.getcontinuation(continuationsupport.java:108) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationwrapper.<init>(jettycontinuationwrapper.java:46) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:64) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:52) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.getcontinuation(cxfrsinvoker.java:78) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.performinvocation(cxfrsinvoker.java:66) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:96) ... 21 more 2016-11-17 17:48:10,751 warn [ty-service] org.eclipse.jetty.server.httpchannel: /cxf/status/atacama-security-service java.lang.illegalstateexception: !(jetty || servlet 3.0 || continuationfilter) @ org.eclipse.jetty.continuation.continuationsupport.getcontinuation(continuationsupport.java:108) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationwrapper.<init>(jettycontinuationwrapper.java:46) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:64) @ org.apache.cxf.transport.http_jetty.continuations.jettycontinuationprovider.getcontinuation(jettycontinuationprovider.java:52) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.getcontinuation(cxfrsinvoker.java:78) @ org.apache.camel.component.cxf.jaxrs.cxfrsinvoker.performinvocation(cxfrsinvoker.java:66) @ org.apache.cxf.service.invoker.abstractinvoker.invoke(abstractinvoker.java:96) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:200) @ org.apache.cxf.jaxrs.jaxrsinvoker.invoke(jaxrsinvoker.java:99) @ org.apache.cxf.interceptor.serviceinvokerinterceptor$1.run(serviceinvokerinterceptor.java:59) @ org.apache.cxf.interceptor.serviceinvokerinterceptor.handlemessage(serviceinvokerinterceptor.java:96) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:308) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:121) @ org.apache.cxf.transport.http.abstracthttpdestination.invoke(abstracthttpdestination.java:252) @ org.apache.cxf.transport.http_jetty.jettyhttpdestination.doservice(jettyhttpdestination.java:234) @ org.apache.cxf.transport.http_jetty.jettyhttphandler.handle(jettyhttphandler.java:70) @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1129) @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1065) @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:141) @ org.eclipse.jetty.server.handler.contexthandlercollection.handle(contexthandlercollection.java:215) @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97) @ org.eclipse.jetty.server.server.handle(server.java:499) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:311) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:544) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745) 2016-11-17 17:48:10,753 warn [1185459-29] org.eclipse.jetty.util.thread.queuedthreadpool: java.lang.nosuchmethoderror: javax.servlet.http.httpservletresponse.getstatus()i @ org.apache.cxf.transport.http_jetty.jettyhttpserverengine$1.handle(jettyhttpserverengine.java:361) @ org.eclipse.jetty.server.response.senderror(response.java:597) @ org.eclipse.jetty.server.httpchannel.handleexception(httpchannel.java:487) @ org.eclipse.jetty.server.httpconnection$httpchanneloverhttp.handleexception(httpconnection.java:594) @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:399) @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:257) @ org.eclipse.jetty.io.abstractconnection$2.run(abstractconnection.java:544) @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:635) @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:555) @ java.lang.thread.run(thread.java:745)
so it?
edit
the test doesn't anything:
@test public void flow() throws interruptedexception { mockendpointresult.setexpectedmessagecount(1); mockendpointresult.setresultwaittime(60000); //context().createproducertemplate().sendbody(in,""); assertmockendpointssatisfied(); }
i set breakpoint on assert , try reach rest route via browser. (all works fine if deployed on fuse)
Comments
Post a Comment