camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Wein (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-10539) When bridging http endpoints and end users do not enable the bridgeEndpoint option they may get a NPE exception
Date Mon, 28 Nov 2016 09:07:58 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-10539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Frank Wein updated CAMEL-10539:
-------------------------------
    Description: 
I noticed that you get a NullPointerException when you forget the bridgeEndpoint=true option
when bridging two HTTP endpoints (first endpoint is a REST Jetty endpoint, second one also
uses Jetty). Maybe Camel can warn in this case that the bridgeEndpoint parameter is missing.

Simplified basic code (Java):
 restConfiguration().component("jetty").host("0.0.0.0").port(8080)
                .dataFormatProperty("prettyPrint", "true")
                .bindingMode(RestBindingMode.auto);

rest("/API/").get("/{ID}/").to("jetty:http://www.google.com");

HTTP Request to http://localhost:8080/API/1/ results in NullPointerException.

Stacktrace:
java.lang.NullPointerException
	at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:521)
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
	at org.apache.camel.component.jetty9.JettyContentExchange9.send(JettyContentExchange9.java:228)
	at org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:247)
	at org.apache.camel.component.jetty.JettyHttpProducer.process(JettyHttpProducer.java:86)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:191)
	at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)


This issue is probably a bit related to the already resolved CAMEL-4242.

  was:
I noticed that you get a NullPointerException when you forget the bridgeEndpoint=true option
when bridging two HTTP endpoints (first endpoint is a REST Jetty endpoint, second one also
uses Jetty). Maybe Camel can warn in this case that the bridgeEndpoint parameter is missing.

Simplified basic code (Java):
 restConfiguration().component("jetty").host("0.0.0.0").port(8080)
                .dataFormatProperty("prettyPrint", "true")
                .bindingMode(RestBindingMode.auto);

        rest("/API/")
                .get("/{ID}/")
                .to("jetty:http://www.google.com");

HTTP Request to http://localhost:8080/API/1/ results in NullPointerException.

Stacktrace:
java.lang.NullPointerException
	at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:521)
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
	at org.apache.camel.component.jetty9.JettyContentExchange9.send(JettyContentExchange9.java:228)
	at org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:247)
	at org.apache.camel.component.jetty.JettyHttpProducer.process(JettyHttpProducer.java:86)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:191)
	at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)


This issue is probably a bit related to the already resolved CAMEL-4242.


> When bridging http endpoints and end users do not enable the bridgeEndpoint option they
may get a NPE exception
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-10539
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10539
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http, camel-jetty
>    Affects Versions: 2.18.0
>            Reporter: Frank Wein
>            Priority: Minor
>
> I noticed that you get a NullPointerException when you forget the bridgeEndpoint=true
option when bridging two HTTP endpoints (first endpoint is a REST Jetty endpoint, second one
also uses Jetty). Maybe Camel can warn in this case that the bridgeEndpoint parameter is missing.
> Simplified basic code (Java):
>  restConfiguration().component("jetty").host("0.0.0.0").port(8080)
>                 .dataFormatProperty("prettyPrint", "true")
>                 .bindingMode(RestBindingMode.auto);
> rest("/API/").get("/{ID}/").to("jetty:http://www.google.com");
> HTTP Request to http://localhost:8080/API/1/ results in NullPointerException.
> Stacktrace:
> java.lang.NullPointerException
> 	at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:521)
> 	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:694)
> 	at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:678)
> 	at org.apache.camel.component.jetty9.JettyContentExchange9.send(JettyContentExchange9.java:228)
> 	at org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:247)
> 	at org.apache.camel.component.jetty.JettyHttpProducer.process(JettyHttpProducer.java:86)
> 	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> 	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> 	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
> 	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
> 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
> 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
> 	at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:191)
> 	at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:74)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
> 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
> 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
> 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
> 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:499)
> 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
> 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
> 	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
> 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
> 	at java.lang.Thread.run(Thread.java:745)
> This issue is probably a bit related to the already resolved CAMEL-4242.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message