There is actually one error in the HandlerBean.java provided on the tutorial
page. Go to this file and locate the bit

<code>
 /**
    * handles the incoming provider messages
    * 
    * @param exchange
    * @throws MessagingException
    */
    private void onProviderExchange(MessageExchange exchange) throws
MessagingException {
        ...
        ...
        if (attNames.size()==1) {
            if (it.hasNext()) {
                try {
                    File file = new File(it.next().toString());
                    fileName = file.getName();
                    content = in.getAttachment(file.getAbsolutePath());
        ...
        ...
    }
</code>

Change file.getAbsolutePath() to file.getName()

Then it should work! Enjoy

Good luck.


steff aka sid wrote:
> 
> Hello,
> I am new to servicemix and I've a problem with the http upload tutorial. I
> can deploy the SA file an all is fine. But when I select a file an upload
> it. I got following error message on the servicemix console:
> 
> ERROR - BeanComponent                  - Error processing exchange InOut[
>   id: ID:127.0.1.1-1185b214ac4-43:0
>   status: Active
>   role: provider
>   service: {http://brockhaus-gruppe.de/ex}httphandler
>   endpoint: handlerEndpoint
>   in: <?xml version="1.0" encoding="UTF-8"?><payload/>
> ]
> java.lang.NullPointerException
>         at javax.activation.MimeType.parse(MimeType.java:99)
>         at javax.activation.MimeType.<init>(MimeType.java:65)
>         at javax.activation.DataHandler.getBaseType(DataHandler.java:637)
>         at
> javax.activation.DataHandler.getDataContentHandler(DataHandler.java:598)
>         at javax.activation.DataHandler.writeTo(DataHandler.java:315)
>         at
> org.apache.servicemix.jbi.HandlerBean.onProviderExchange(HandlerBean.java:152)
>         at
> org.apache.servicemix.jbi.HandlerBean.onMessageExchange(HandlerBean.java:56)
>         at
> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)
>         at
> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> 
> The browser shows me the following:
> 
> <error>
> java.lang.NullPointerException
>       at javax.activation.MimeType.parse(MimeType.java:99)
>       at javax.activation.MimeType.<init>(MimeType.java:65)
>       at javax.activation.DataHandler.getBaseType(DataHandler.java:637)
>       at
> javax.activation.DataHandler.getDataContentHandler(DataHandler.java:598)
>       at javax.activation.DataHandler.writeTo(DataHandler.java:315)
>       at
> org.apache.servicemix.jbi.HandlerBean.onProviderExchange(HandlerBean.java:152)
>       at
> org.apache.servicemix.jbi.HandlerBean.onMessageExchange(HandlerBean.java:56)
>       at
> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)
>       at 
> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)
>       at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
>       at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
>       at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
>       at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
>       at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
>       at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>       at java.lang.Thread.run(Thread.java:595)
> </error>
> 
> 
> I've searched for related problems but haven't found anything...
> 
> Anyone an idea? Could it be that there is a special MimeType required or
> something like that?
> 
> Regards
> /Steffen
> 

-- 
View this message in context: 
http://www.nabble.com/Http-Upload-Tutorial-tp15714716p16437475.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to