Quantcast

RE: [servicemix-user] HTTP Binding Example gives null pointer exc eption

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [servicemix-user] HTTP Binding Example gives null pointer exc eption

Anshuman Das
Hi Ian

I also got this exception today. But I tink this occurs when a response to
the HTTP input is not set.

try this as the MessageExchangeListener

        public void onMessageExchange(MessageExchange exchange)
                        throws MessagingException {
                NormalizedMessage message = getInMessage(exchange);
                try {
                        // on recieving first send an acknowledgement
                        NormalizedMessage outMessage =
exchange.createMessage();
       
outMessage.setContent(CapeUtils.createSource("<Received/>"));
                        ((MessageExchangeImpl)
exchange).setOutMessage(outMessage);

                        process(exchange, message);
                        done(exchange);
                } catch (MessagingException e) {
                        fail(exchange, e);
                }
        }


Thanks

Anshuman Das

-----Original Message-----
From: Ian de Beer [mailto:[hidden email]]
Sent: Monday, November 07, 2005 6:34 PM
To: [hidden email]
Subject: [servicemix-user] HTTP Binding Example gives null pointer
exception


Hi
I have tried the HTPPBinding example from both the 2.0 SNAPSHOT and  
the 1.1 release. On both of these I get the following exception. (The  
1.0.1 release does not have this problem.)
[INFO] DeliveryChannel - default destination serviceName for  
httpReceiver = {http://servicemix.org/demo/}stockQuote
14:29:07.121 WARN!! Exception for /
java.lang.NullPointerException
         at org.servicemix.components.http.HttpMarshaler.toResponse
(HttpMarshaler.java:65)
         at  
org.servicemix.components.http.HttpInOutBinding.processInOut
(HttpInOutBinding.java:63)
         at org.servicemix.components.http.HttpInOutBinding.process
(HttpInOutBinding.java:46)
         at org.servicemix.components.http.BindingServlet.doPost
(BindingServlet.java:77)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.mortbay.jetty.servlet.ServletHolder.handle
(ServletHolder.java:354)
         at org.mortbay.jetty.servlet.ServletHandler.dispatch
(ServletHandler.java:657)
         at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:567)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
         at org.mortbay.http.HttpServer.service(HttpServer.java:879)
         at org.mortbay.http.HttpConnection.service
(HttpConnection.java:790)
         at org.mortbay.http.HttpConnection.handleNext
(HttpConnection.java:961)
         at org.mortbay.http.HttpConnection.handle
(HttpConnection.java:807)
         at org.mortbay.http.SocketListener.handleConnection
(SocketListener.java:197)
         at org.mortbay.util.ThreadedServer.handle
(ThreadedServer.java:276)
         at org.mortbay.util.ThreadPool$PoolThread.run
(ThreadPool.java:511)
I noticed there is a Jira issue (SM-125) that is somewhat similar,  
but it applies to Invalid messages. In my case I am running the  
example with the supplied request.xml and also get the reported  
exception.

Regards
Ian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [servicemix-user] HTTP Binding Example still gives null pointer exception

Ian de Beer-2
Hi Anshuman
Thank you for your reply.
I seem to get no other response from the mailing list on this issue,  
which makes me wonder - is this a general problem or is it isolated  
to certain configurations/ topologies.
I am running the example on OS X with Java version 1.5.0_05 (latest  
developer build). Your suggestion unfortunately sheds no light on the  
problem, mostly because I am very inexperienced with Servicemix.  
There are two components in the configuration - an HTTPConnector and  
a remote SOAP service accessed via the SaajBinding. The exception  
that is logged does not indicate which component is responsible for  
the exception in terms of a response not being set. Which class do  
you suggest I should override? Also, I assume that the CapeUtils  
class is a utility class that is not generally available.
Regards
Ian
On 07 Nov 2005, at 3:06 PM, Anshuman Das wrote:

> Hi Ian
>
> I also got this exception today. But I tink this occurs when a  
> response to
> the HTTP input is not set.
>
> try this as the MessageExchangeListener
>
> public void onMessageExchange(MessageExchange exchange)
> throws MessagingException {
> NormalizedMessage message = getInMessage(exchange);
> try {
> // on recieving first send an acknowledgement
> NormalizedMessage outMessage =
> exchange.createMessage();
>
> outMessage.setContent(CapeUtils.createSource("<Received/>"));
> ((MessageExchangeImpl)
> exchange).setOutMessage(outMessage);
>
> process(exchange, message);
> done(exchange);
> } catch (MessagingException e) {
> fail(exchange, e);
> }
> }
>
>
> Thanks
>
> Anshuman Das
>
> -----Original Message-----
> From: Ian de Beer [mailto:[hidden email]]
> Sent: Monday, November 07, 2005 6:34 PM
> To: [hidden email]
> Subject: [servicemix-user] HTTP Binding Example gives null pointer
> exception
>
>
> Hi
> I have tried the HTPPBinding example from both the 2.0 SNAPSHOT and
> the 1.1 release. On both of these I get the following exception. (The
> 1.0.1 release does not have this problem.)
> [INFO] DeliveryChannel - default destination serviceName for
> httpReceiver = {http://servicemix.org/demo/}stockQuote
> 14:29:07.121 WARN!! Exception for /
> java.lang.NullPointerException
>          at org.servicemix.components.http.HttpMarshaler.toResponse
> (HttpMarshaler.java:65)
>          at
> org.servicemix.components.http.HttpInOutBinding.processInOut
> (HttpInOutBinding.java:63)
>          at org.servicemix.components.http.HttpInOutBinding.process
> (HttpInOutBinding.java:46)
>          at org.servicemix.components.http.BindingServlet.doPost
> (BindingServlet.java:77)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:
> 760)
>          at javax.servlet.http.HttpServlet.service(HttpServlet.java:
> 853)
>          at org.mortbay.jetty.servlet.ServletHolder.handle
> (ServletHolder.java:354)
>          at org.mortbay.jetty.servlet.ServletHandler.dispatch
> (ServletHandler.java:657)
>          at org.mortbay.jetty.servlet.ServletHandler.handle
> (ServletHandler.java:567)
>          at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
>          at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
>          at org.mortbay.http.HttpServer.service(HttpServer.java:879)
>          at org.mortbay.http.HttpConnection.service
> (HttpConnection.java:790)
>          at org.mortbay.http.HttpConnection.handleNext
> (HttpConnection.java:961)
>          at org.mortbay.http.HttpConnection.handle
> (HttpConnection.java:807)
>          at org.mortbay.http.SocketListener.handleConnection
> (SocketListener.java:197)
>          at org.mortbay.util.ThreadedServer.handle
> (ThreadedServer.java:276)
>          at org.mortbay.util.ThreadPool$PoolThread.run
> (ThreadPool.java:511)
> I noticed there is a Jira issue (SM-125) that is somewhat similar,
> but it applies to Invalid messages. In my case I am running the
> example with the supplied request.xml and also get the reported
> exception.
>
> Regards
> Ian

Loading...