You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Supriya Prakash <su...@rediffmail.com> on 2008/02/04 11:55:52 UTC

Re: Unable to send a file using BlobMessage via HTTP transport

Hi,

I'm facing the same problem. The publisher sends the message but a
NullPointerException is thrown at subscriber's end on the following line : -
InputStream in = bMsg.getInputStream();

On debugging I found that blobUploader attribute of the Blob message
received is null. Whereas this attribute had the entire content and blob
transfer policy when sent by the publisher.

I am using ActiveMQ 5.0. Any pointers or updates??

Thanks,
supriya


Mani.. wrote:
> 
> Hi, 
> 
> I am trying to send a file using BlobMessage over Http. But I am not able
> to read at consumer side [ Code hang here when I am trying to read
> InputStream......]
> Even getting WARN message on broker side everytime when I send a file:
> 
> WARN  ManagedTransportConnection     - Failed to register MBean:
> org.apache.activemq:BrokerName=localhost,Type=Connection,ConnectorName=http,ViewType=address,Name=blockingQueue
> 
> Code at producer side:
> ActiveMQSession mSession = (ActiveMQSession) session;
> InputStream in = new FileInputStream("C:/file.txt");
> BlobMessage message = mSession.createBlobMessage(in);
> producer.send(message);
> 
> Code at consumer side:
> if (message instanceof BlobMessage) {
> try {
>         bMsg = (BlobMessage) message;
> 	InputStream in = bMsg.getInputStream();
>         //Code hang here when I am trying to read InputStream......
> }
> 
> can anybody help in this regard?
> 
> Thanks in advance!
> Manish Gupta
> 

-- 
View this message in context: http://www.nabble.com/Unable-to-send-a-file-using-BlobMessage-via-HTTP-transport-tp14554898s2354p15265747.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Unable to send a file using BlobMessage via HTTP transport

Posted by Marco Buss <ma...@gmx.de>.
Did you check your blob repository if the file was successfuly uploaded?
BlobMessageing dosent work out of the box, if you use the binary distribution.
You must download the source and build it by your own. An artifact called activemq-fileserver will create an webapp wich can be used to upload the files. Install this webapp in a webcontainer (for example in the embedded jetty in activemq) an point the blobUpluadUrl to this webapp.


-------- Original-Nachricht --------
> Datum: Mon, 4 Feb 2008 02:55:52 -0800 (PST)
> Von: Supriya Prakash <su...@rediffmail.com>
> An: dev@activemq.apache.org
> Betreff: Re: Unable to send a file using BlobMessage via HTTP transport

> 
> Hi,
> 
> I'm facing the same problem. The publisher sends the message but a
> NullPointerException is thrown at subscriber's end on the following line :
> -
> InputStream in = bMsg.getInputStream();
> 
> On debugging I found that blobUploader attribute of the Blob message
> received is null. Whereas this attribute had the entire content and blob
> transfer policy when sent by the publisher.
> 
> I am using ActiveMQ 5.0. Any pointers or updates??
> 
> Thanks,
> supriya
> 
> 
> Mani.. wrote:
> > 
> > Hi, 
> > 
> > I am trying to send a file using BlobMessage over Http. But I am not
> able
> > to read at consumer side [ Code hang here when I am trying to read
> > InputStream......]
> > Even getting WARN message on broker side everytime when I send a file:
> > 
> > WARN  ManagedTransportConnection     - Failed to register MBean:
> >
> org.apache.activemq:BrokerName=localhost,Type=Connection,ConnectorName=http,ViewType=address,Name=blockingQueue
> > 
> > Code at producer side:
> > ActiveMQSession mSession = (ActiveMQSession) session;
> > InputStream in = new FileInputStream("C:/file.txt");
> > BlobMessage message = mSession.createBlobMessage(in);
> > producer.send(message);
> > 
> > Code at consumer side:
> > if (message instanceof BlobMessage) {
> > try {
> >         bMsg = (BlobMessage) message;
> > 	InputStream in = bMsg.getInputStream();
> >         //Code hang here when I am trying to read InputStream......
> > }
> > 
> > can anybody help in this regard?
> > 
> > Thanks in advance!
> > Manish Gupta
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Unable-to-send-a-file-using-BlobMessage-via-HTTP-transport-tp14554898s2354p15265747.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.