camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yuncil <jonas.stei...@hotmail.de>
Subject Spring Boot WS - After receiving request, camel throws NullPointerException
Date Wed, 21 Oct 2015 11:12:53 GMT
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.<init>(DefaultUnitOfWork.java:123)
	at
org.apache.camel.impl.DefaultUnitOfWork.<init>(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:*

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>1.2.7.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId>
            <version>1.2.7.RELEASE</version>
        </dependency>   
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring-ws</artifactId>
            <version>2.16.0</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-test-spring</artifactId>
            <version>2.16.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>2.16.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring-boot</artifactId>
            <version>2.16.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>1.2.7.RELEASE</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring-javaconfig</artifactId>
            <version>2.16.0</version>
        </dependency>
    </dependencies>


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.

Mime
View raw message