camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: camel mina udp throws exception "Already released buffer"
Date Fri, 23 May 2008 01:20:31 GMT
Hi Aruch

Did you use maven to create the IDE work space?  If so you need change 
your pom.xml to use the 1.4.0-SNAPSHOT version.
I tested the your case by changing the UDPTest[1], you may trace it 
against the late trunk code.
The MinaConverter will be called ;)

[1]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaUdpTest.java

Willem

aruch wrote:
> Willem,
>
> I've downloaded the trunk, including your fixes, but it still seems to be an
> issue for me. I've run the code through a debugger and the MinaConverter
> where you made the change never seems to be executed. Do I have to do
> something to tell it to use the converter?
>
> Thanks.
>
>
> willem.jiang wrote:
>   
>> I just reproduced the error with the trunk code , so it still a bug of 
>> camel, so you do n
>> I added a JIRA[1] for it , and will commit a patch for it , so you do 
>> not need to write a custom mina 2.0 component any more :).
>>
>> [1]https://issues.apache.org/activemq/browse/CAMEL-534
>>
>> Willem
>> aruch wrote:
>>     
>>> Yes. I downloaded the camel 1.3.0 binary dist. There was mention of mina
>>> 2.0
>>> in the issue. If I wrote a custom mina 2.0 component, could this fix the
>>> issue or is the problem somewhere else?
>>>
>>>
>>>
>>> willem.jiang wrote:
>>>   
>>>       
>>>> Hi
>>>>
>>>> Did you use the Camel 1.3 release version ?
>>>> I am sure we had fix this issue in Camel1.3. You can find more 
>>>> information here [1]
>>>>
>>>> [1] https://issues.apache.org/activemq/browse/CAMEL-257
>>>>
>>>> Willem
>>>> aruch wrote:
>>>>     
>>>>         
>>>>> Hello,
>>>>>
>>>>> I was trying to get familiar with camel by writing a simple udp
>>>>> example.
>>>>> I
>>>>> wanted to read off one port, increment a counter, then write to another
>>>>> port. I'm using Java 1.6, Camel 1.3, and Mina 1.1.7. The message is
>>>>> read
>>>>> in
>>>>> correctly and forwarded out, but I keep getting the following
>>>>> exception.
>>>>>
>>>>> May 20, 2008 8:35:20 AM
>>>>> org.apache.camel.component.mina.MinaProducer$ResponseHandler
>>>>> exceptionCaught
>>>>> SEVERE: Exception on receiving message from address: /10.10.2.1:5555
>>>>> using
>>>>> connector:
>>>>> org.apache.mina.transport.socket.nio.DatagramConnector@39ab89
>>>>> java.lang.IllegalStateException: Already released buffer.  You released
>>>>> the
>>>>> buffer too many times.
>>>>> 	at
>>>>> org.apache.mina.common.PooledByteBufferAllocator$PooledByteBuffer.release(PooledByteBufferAllocator.java:310)
>>>>> 	at
>>>>> org.apache.mina.util.ByteBufferUtil.releaseIfPossible(ByteBufferUtil.java:39)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageSent(AbstractIoFilterChain.java:581)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageSent(AbstractIoFilterChain.java:320)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain.access$1200(AbstractIoFilterChain.java:53)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageSent(AbstractIoFilterChain.java:653)
>>>>> 	at
>>>>> org.apache.mina.filter.codec.ProtocolCodecFilter.messageSent(ProtocolCodecFilter.java:193)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageSent(AbstractIoFilterChain.java:320)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain.access$1200(AbstractIoFilterChain.java:53)
>>>>> 	at
>>>>> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageSent(AbstractIoFilterChain.java:653)
>>>>> 	at
>>>>> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:222)
>>>>> 	at
>>>>> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
>>>>> 	at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>>>> 	at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>>>> 	at
>>>>> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
>>>>> 	at java.lang.Thread.run(Thread.java:619)
>>>>> 	
>>>>> 	
>>>>> 	
>>>>> Here is the code.
>>>>>
>>>>> inIp = "10.10.1.1";
>>>>> inPort = "4444";
>>>>> outIp = "10.10.2.1";
>>>>> outPort = "5555";
>>>>>
>>>>> context.addRoutes(new RouteBuilder() {
>>>>>     public void configure() throws Exception {
>>>>>         from("mina:udp://" + inIp + ":" + inPort).process(new
>>>>> Processor(){
>>>>>             public void process(Exchange exchange) throws Exception {
>>>>>                 msgCount++;
>>>>>             }
>>>>>         }).to("mina:udp://" + outIp + ":" + outPort);
>>>>>     }
>>>>> });
>>>>>
>>>>> System.out.println("Starting context...");
>>>>> context.start();
>>>>>
>>>>>
>>>>> Am I doing something wrong? Do I need to configure/customize something?

>>>>>
>>>>> Thanks.
>>>>>
>>>>> aruch2002@go.com
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Mime
View raw message