Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6737817AEA for ; Wed, 21 Oct 2015 11:41:14 +0000 (UTC) Received: (qmail 45108 invoked by uid 500); 21 Oct 2015 11:41:14 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 45058 invoked by uid 500); 21 Oct 2015 11:41:13 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 45046 invoked by uid 99); 21 Oct 2015 11:41:13 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Oct 2015 11:41:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3ADC71809A8 for ; Wed, 21 Oct 2015 11:41:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.214 X-Spam-Level: * X-Spam-Status: No, score=1.214 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id vAO5KDl8NkDV for ; Wed, 21 Oct 2015 11:41:00 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 48F1520594 for ; Wed, 21 Oct 2015 11:40:59 +0000 (UTC) Received: by iofz202 with SMTP id z202so53798760iof.2 for ; Wed, 21 Oct 2015 04:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=rbO/AXTtxkHnkCSbVcH+Eh2RBx7uwvL7QmB67VWxaVg=; b=LQaEy0uHyLKK1XdCO5xsxzNAMDDzeZ22ihq4iu3BwvQaMmmhdCBj8j9/3vwERBTGNo d+hS8AGtJUgke8YFgaC39LnSn1NDnAOw8YZwv2+hKkISsfxM4VCvSYLlZATrO6W6QIeg +xIwPAiSByvQ9+fHGFtxD85Njik18tSeqeVTNAZfpk6f7ZnmuRZY/ILeu+Hri56p4D+w zUmLcjc3SGKC4UcfVDDWSEzDXgNNcLQn/0wqBRTCcDATtBlRL3qA32MbVUjqCuK9Bl08 isPKr3TTNhb0l58Vp9C166hnp2aMUEArzFWyXJoO7k9qg9KOAKEBGOLhexuyKjxVWN/Y 3UyQ== X-Received: by 10.107.30.84 with SMTP id e81mr10935850ioe.137.1445427658237; Wed, 21 Oct 2015 04:40:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.117.91 with HTTP; Wed, 21 Oct 2015 04:40:38 -0700 (PDT) In-Reply-To: <1445425973371-5772930.post@n5.nabble.com> References: <1445425973371-5772930.post@n5.nabble.com> From: Claus Ibsen Date: Wed, 21 Oct 2015 13:40:38 +0200 Message-ID: Subject: Re: Spring Boot WS - After receiving request, camel throws NullPointerException To: "users@camel.apache.org" Content-Type: text/plain; charset=UTF-8 Hi Ah the NPE has been fixed in camel-core but its due the component that creates the exchange is likely doing it the wrong way (without telling which endpoint its from). Let me dive into camel-spring-ws to see about that and fix it there too. On Wed, Oct 21, 2015 at 1:12 PM, yuncil wrote: > Hi guys, > > recently I try to expose a SOAP-WS with Spring-Boot and Camel, on > Glassfish-4.0. I send my requests via SOAP-UI and they'll be received > sucessfully by the WS. I can see the messages in the log-files but then > camel throws a NullPointerException. More specific, the > DefaultRuntimeEndpointRegistry class throws it. I think it could be a > problem getting the request URI. Maybe you can help me. > > *Here is my set-up:* > > @Configuration > public class ServiceConfigurator extends WsConfigurerAdapter { > Logger logger = Logger.getLogger(ServiceConfigurator.class); > > private static final String CAMEL_URL_MAPPING = "/ws/*"; > > @Bean > public CamelEndpointMapping endpointMapping(ApplicationContext > applicationContext) { > logger.info("Konfiguriere EndpointMapping..."); > CamelEndpointMapping mapping = new CamelEndpointMapping(); > > return mapping; > } > > @Bean > public ServletRegistrationBean > messageDispatcherServlet(ApplicationContext applicationContext) { > logger.info("Konfiguriere MessageDispatcher..."); > MessageDispatcherServlet servlet = new MessageDispatcherServlet(); > servlet.setApplicationContext(applicationContext); > servlet.setTransformWsdlLocations(true); > ServletRegistrationBean bean = new ServletRegistrationBean(servlet, > CAMEL_URL_MAPPING); > bean.setLoadOnStartup(1); > return bean; > } > > *The Camel-Route looks like this:* > > @Component > public class ServiceRoutes extends RouteBuilder { > Logger logger = Logger.getLogger(ServiceRoutes.class); > > @Override > public void configure() throws Exception { > logger.info("Konfiguriere Camel-Routes..."); > > from("spring-ws:soapaction:mySoapAction#endpointMapping") > .convertBodyTo(String.class) > .log(${body}) > .setBody(simple("MyResponse")) > .end(); > > } > > *Here is my stacktrace:* > > Error notifying event ID-WSU05812-52703-1445423313461-0-2 exchange created: > Exchange[ID-WSB03512-52703-1445423313461-0-2][SpringWebserviceMessage[SaajSoapMessage > {http://example//search]]. This exception will be ignored. > java.lang.NullPointerException > at > org.apache.camel.impl.DefaultRuntimeEndpointRegistry.notify(DefaultRuntimeEndpointRegistry.java:245) > at org.apache.camel.util.EventHelper.doNotifyEvent(EventHelper.java:805) > at > org.apache.camel.util.EventHelper.notifyExchangeCreated(EventHelper.java:411) > at > org.apache.camel.impl.DefaultUnitOfWork.(DefaultUnitOfWork.java:123) > at > org.apache.camel.impl.DefaultUnitOfWork.(DefaultUnitOfWork.java:72) > at > org.apache.camel.impl.DefaultUnitOfWorkFactory.createUnitOfWork(DefaultUnitOfWorkFactory.java:34) > at > oRerg.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.createUnitOfWork(CamelInternalProcessor.java:663) > at > org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.before(CamelInternalProcessor.java:631) > at > org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.before(CamelInternalProcessor.java:608) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:138) > at > org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109) > at > org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87) > at > org.apache.camel.component.spring.ws.SpringWebserviceConsumer.invoke(SpringWebserviceConsumer.java:61) > at > org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:43) > at > org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:236) > at > org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:176) > at > org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:89) > at > org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:61) > at > org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:293) > at > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) > at > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) > at > org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > at > org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) > at > org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:116) > at > org.springframework.boot.context.web.ErrorPageFilter.access$000(ErrorPageFilter.java:60) > at > org.springframework.boot.context.web.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:91) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) > at > org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:109) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) > at > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) > at > org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) > at > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) > at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) > at > org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) > at > com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) > at > org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) > at > org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) > at > org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) > at > org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) > at > org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) > at > org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) > at > org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) > at > org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) > at > org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) > at > org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) > at > org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) > at > org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) > at > org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) > at > org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) > at > org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) > at > org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) > at java.lang.Thread.run(Thread.java:745) > > *Here are my dependencies:* > > > > org.springframework.boot > spring-boot-starter-web > 1.2.7.RELEASE > > > org.springframework.boot > spring-boot-starter-logging > > > org.springframework.boot > spring-boot-starter-tomcat > > > > > org.springframework.boot > spring-boot-starter-log4j > 1.2.7.RELEASE > > > org.apache.camel > camel-spring-ws > 2.16.0 > jar > > > org.apache.camel > camel-test-spring > 2.16.0 > > > org.apache.camel > camel-core > 2.16.0 > > > org.apache.camel > camel-spring-boot > 2.16.0 > > > javax.servlet > javax.servlet-api > 3.1.0 > provided > > > org.springframework.boot > spring-boot-autoconfigure > 1.2.7.RELEASE > jar > > > org.apache.camel > camel-spring-javaconfig > 2.16.0 > > > > > I would be so grateful for help or a hint. > > Thanks in advanced. > > > > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Spring-Boot-WS-After-receiving-request-camel-throws-NullPointerException-tp5772930.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2nd edition: https://www.manning.com/books/camel-in-action-second-edition