camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Smith <jerry.smith...@gmail.com>
Subject Re: ClassCastException: DirectVmEndpoint cannot be cast to HttpCommonEndpoint
Date Fri, 27 Oct 2017 15:13:19 GMT
I have some routes that are utility type routes that I wanted to have
available to my other contexts, using something like activemq seemed like
overkill.  I didn't realize direct-vm was not really recommended to use.

On Fri, Oct 27, 2017 at 9:59 AM Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Hi
>
> Yeah its a little bug, you are welcome to log a JIRA.
>
> And btw why are you using direct-vm? Its not really a good idea to
> have some static hard dependency like that in a JVM.
>
> On Fri, Oct 27, 2017 at 3:57 PM, Jerry Smith <jerry.smith.ii@gmail.com>
> wrote:
> > java.lang.ClassCastException:
> > org.apache.camel.component.directvm.DirectVmEndpoint cannot be cast to
> > org.apache.camel.http.common.HttpCommonEndpoint
> >                                                 at
> > org.apache.camel.http.common.HttpMessage.getEndpoint(HttpMessage.java:84)
> > [107:org.apache.camel.camel-http-common:2.19.3]
> >                                                 at
> > org.apache.camel.http.common.HttpMessage.createBody(HttpMessage.java:72)
> > [107:org.apache.camel.camel-http-common:2.19.3]
> >                                                 at
> > org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:50)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:162)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:153)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.impl.DefaultExchange.copy(DefaultExchange.java:116)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.impl.DefaultExchange.copy(DefaultExchange.java:90)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.util.ExchangeHelper.createCopy(ExchangeHelper.java:300)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.RedeliveryErrorHandler.defensiveCopyExchangeIfNeeded(RedeliveryErrorHandler.java:695)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:419)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.component.directvm.DirectVmProcessor.process(DirectVmProcessor.java:57)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.component.directvm.DirectVmProducer.process(DirectVmProducer.java:68)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
> > [100:org.apache.camel.camel-core:2.19.3]
> >                                                 at
> >
> org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:206)
> > [109:org.apache.camel.camel-jetty-common:2.19.3]
> >                                                 at
> > org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
> > [107:org.apache.camel.camel-http-common:2.19.3]
> >                                                 at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> > [80:javax.servlet-api:3.1.0]
> >                                                 at
> > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
> > [187:org.eclipse.jetty.servlet:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
> > [187:org.eclipse.jetty.servlet:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> > [187:org.eclipse.jetty.servlet:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.server.Server.handle(Server.java:534)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> > [186:org.eclipse.jetty.server:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
> > [178:org.eclipse.jetty.io:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> > [178:org.eclipse.jetty.io:9.3.14.v20161028]
> >                                                 at
> > org.eclipse.jetty.io
> .SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> > [178:org.eclipse.jetty.io:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> > [189:org.eclipse.jetty.util:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> > [189:org.eclipse.jetty.util:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> > [189:org.eclipse.jetty.util:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> > [189:org.eclipse.jetty.util:9.3.14.v20161028]
> >                                                 at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> > [189:org.eclipse.jetty.util:9.3.14.v20161028]
> >                                                 at
> > java.lang.Thread.run(Thread.java:748) [?:?]
> >
> > On Fri, Oct 27, 2017 at 1:51 AM Claus Ibsen <claus.ibsen@gmail.com>
> wrote:
> >
> >> Can you show the stacktrace
> >>
> >> On Thu, Oct 26, 2017 at 10:12 PM, Jerry Smith <jerry.smith.ii@gmail.com
> >
> >> wrote:
> >> > Hello all,
> >> >
> >> > Using 2.19.3 I'm getting - java.lang.ClassCastException:
> >> > org.apache.camel.component.directvm.DirectVmEndpoint cannot be cast to
> >> > org.apache.camel.http.common.HttpCommonEndpoint
> >> >
> >> > Context A
> >> >         <rest path="/api/parcel/">
> >> >             <delete uri="external/{external}/manifest">
> >> >                 <to uri="direct:removeFromManifestJson"/>
> >> >             </delete>
> >> >         </rest>
> >> >         <route id="removeFromManifestJson">
> >> >             <from uri="direct:removeFromManifestJson"/>
> >> > error -->   <to uri="direct-vm:setJsonReturnType"/>
> >> >             <to uri="direct:removeFromManifest"/>
> >> >             <to uri="direct-vm:setJsonHttp200"/>
> >> >         </route>
> >> >         <route id="removeFromManifest">
> >> >             <from uri="direct:removeFromManifest"/>
> >> >             <setHeader headerName="action">
> >> >                 <constant>removeFromManifest</constant>
> >> >             </setHeader>
> >> >             <inOut uri="activemq:queue:ParcelQueue"/>
> >> >         </route>
> >> >
> >> > Context B
> >> >         <route id="setJsonReturnType">
> >> >             <from uri="direct-vm:setJsonReturnType"/>
> >> >             <log message="setting json returnType"/>
> >> >             <setHeader headerName="returnType">
> >> >                 <constant>json</constant>
> >> >             </setHeader>
> >> >         </route>
> >> >
> >> > Any idea what I'm doing wrong here?
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message