-
1. Re: Exception delivery to a consumer component
ozkin May 10, 2015 10:29 AM (in response to ozkin)I am using SY-1.1.0-Final and curious if it is related to https://issues.jboss.org/browse/SWITCHYARD-1950 ??
-
2. Re: Exception delivery to a consumer component
tadayosi May 10, 2015 8:31 PM (in response to ozkin)1 of 1 people found this helpfulCheck your provider component's MEP to see if it's related to SWITCHYARD-1950. If it's IN_ONLY, it's possible that your issue is related to SWITCHYARD-1950.
-
3. Re: Exception delivery to a consumer component
ozkin May 11, 2015 3:20 AM (in response to tadayosi)Yes, it is IN_ONLY and I have to use the workaround to add a return type.. I assume in SY2.0 it is fixed..
-
4. Re: Exception delivery to a consumer component
ozkin May 12, 2015 4:29 PM (in response to ozkin)What if a bean invokes a method of reference interface of, say, SQL reference binding? Such method has no return type. It is also IN_ONLY. How to propagate an exception (in this case some SqlException) from SQL reference binding back to the bean? If I change "void" to some other return type for this method, there will be NullPointerException at run-time...
-
5. Re: Exception delivery to a consumer component
igarashitm May 12, 2015 7:39 PM (in response to ozkin)I've never seen NPE is thrown when I just change the return type of service operation from void to something else. Can you attach a reproducer?
-
6. Re: Exception delivery to a consumer component
ozkin May 13, 2015 7:37 AM (in response to igarashitm)I don't have a reproducer at hand, but this is the exception thrown:
Caused by: java.lang.NullPointerException
at com.sun.proxy.$Proxy51.execute(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:45)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
at org.jboss.weld.proxies.MyDBService$1366014922$Proxy$_$$_WeldClientProxy.execute(MyDBService$1366014922$Proxy$_$$_WeldClientProxy.java)
at com.my.test.db.insertRecord(MyBean.java:88)
... 205 more
This problem is noticed only when calling SQLBinding reference binding service operation.
I see no issues with bean calling another bean or calling other reference bindings.
-
7. Re: Exception delivery to a consumer component
ozkin May 14, 2015 5:26 PM (in response to igarashitm)Here I attached a reproducer app.
Service operation returns boolean instead of void and during invocation it throws following exception:
00:19:01,439 ERROR [stderr] (http-/127.0.0.1:8080-1) java.lang.NullPointerException
00:19:01,440 ERROR [stderr] (http-/127.0.0.1:8080-1) at com.sun.proxy.$Proxy32.execute(Unknown Source)
00:19:01,441 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:19:01,441 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
00:19:01,442 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:19:01,442 ERROR [stderr] (http-/127.0.0.1:8080-1) at java.lang.reflect.Method.invoke(Method.java:606)
00:19:01,443 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:45)
00:19:01,444 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
00:19:01,444 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.jboss.weld.proxies.MyDBService$1366014918$Proxy$_$$_WeldClientProxy.execute(MyDBService$1366014918$Proxy$_$$_WeldClientProxy.java)
00:19:01,445 ERROR [stderr] (http-/127.0.0.1:8080-1) at com.example.switchyard.reproducer_npe_sql.MyServiceBean.test(MyServiceBean.java:17)
00:19:01,445 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
00:19:01,446 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
00:19:01,446 ERROR [stderr] (http-/127.0.0.1:8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:19:01,447 ERROR [stderr] (http-/127.0.0.1:8080-1) at java.lang.reflect.Method.invoke(Method.java:606)
00:19:01,448 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.component.bean.ServiceProxyHandler.handle(ServiceProxyHandler.java:163)
00:19:01,448 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.component.bean.ServiceProxyHandler.handleMessage(ServiceProxyHandler.java:94)
00:19:01,449 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.processors.ProviderProcessor.process(ProviderProcessor.java:29)
00:19:01,449 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
00:19:01,450 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,451 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,451 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,452 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,452 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,453 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,453 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
00:19:01,454 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,455 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,455 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,456 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
00:19:01,456 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,457 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,457 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,458 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:46)
00:19:01,459 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
00:19:01,459 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,460 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
00:19:01,460 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,461 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
00:19:01,461 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
00:19:01,462 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,463 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:104)
00:19:01,463 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:78)
00:19:01,464 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,464 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,465 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,466 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
00:19:01,466 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,467 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,467 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,468 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
00:19:01,468 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,469 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,469 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,470 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:46)
00:19:01,471 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
00:19:01,471 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,472 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
00:19:01,472 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
00:19:01,473 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,473 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)
00:19:01,474 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
00:19:01,474 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,475 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,476 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
00:19:01,476 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
00:19:01,477 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
00:19:01,477 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
00:19:01,478 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
00:19:01,478 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
00:19:01,479 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
00:19:01,479 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
00:19:01,480 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
00:19:01,481 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
00:19:01,481 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)
00:19:01,482 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)
00:19:01,482 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)
00:19:01,483 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)
00:19:01,483 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:153)
00:19:01,484 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:106)
00:19:01,485 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:92)
00:19:01,485 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.ExchangeDispatcher.dispatch(ExchangeDispatcher.java:87)
00:19:01,486 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.CamelExchange.sendInternal(CamelExchange.java:234)
00:19:01,487 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.bus.camel.CamelExchange.send(CamelExchange.java:171)
00:19:01,488 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.component.http.InboundHandler.invoke(InboundHandler.java:115)
00:19:01,488 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.component.http.HttpGatewayServlet.handle(HttpGatewayServlet.java:143)
00:19:01,489 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.switchyard.component.http.HttpGatewayServlet.service(HttpGatewayServlet.java:114)
00:19:01,489 ERROR [stderr] (http-/127.0.0.1:8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
00:19:01,490 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
00:19:01,490 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
00:19:01,491 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
00:19:01,491 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
00:19:01,492 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
00:19:01,493 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
00:19:01,493 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
00:19:01,494 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
00:19:01,494 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
00:19:01,495 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
00:19:01,496 ERROR [stderr] (http-/127.0.0.1:8080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
00:19:01,496 ERROR [stderr] (http-/127.0.0.1:8080-1) at java.lang.Thread.run(Thread.java:745)
This is SY-1.1.0-final.
To run a test I execute: "curl -v -X POST http://localhost:8080/test"
-
reproducer.tgz 9.8 KB
-
-
8. Re: Exception delivery to a consumer component
ozkin May 20, 2015 3:55 AM (in response to ozkin)Was there any chance to run the reproducer app and get the same exception?
-
9. Re: Exception delivery to a consumer component
igarashitm May 20, 2015 10:36 AM (in response to ozkin)I tried the reproducer with SwitchYard 2.0 branch and got a NPE from here:
So I changed the return type from boolean to java.lang.Boolean and also changed the SQL to select 'dummy' then it worked.
-
10. Re: Exception delivery to a consumer component
ozkin May 20, 2015 5:41 PM (in response to igarashitm)Thanks!! Changing to Boolean fixed the problem.