BUFFER_OVERFLOW
Hi All, I have written an Client/Server application. When my server is trying to send a big chink of data, i am getting the following exception javax.net.ssl.SSLException: SSLEngine error during encrypt: BUFFER_OVERFLOW src: java.nio.HeapByteBuffer[pos=16384 lim=16418 cap=16418]outNetBuffer: java.nio.HeapByteBuffer[pos=16421 lim=32836 cap=32836] at org.apache.mina.filter.ssl.SslHandler.encrypt(SslHandler.java:380) at org.apache.mina.filter.ssl.SslFilter.filterWrite(SslFilter.java:506) at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) at org.apache.mina.common.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:38) at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:745) at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolEncoderOutputImpl.flush(ProtocolCodecFilter.java:384) at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:210) at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) at org.apache.mina.common.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:38) at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:745) at org.apache.mina.common.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:671) at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) at org.apache.mina.common.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:415) at org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:241) at org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:200) I get this problem in my office network ( Tested on 3 different machines) but i am not able to reproduce it in my home network ( tried on 2 different machines). is it related to https://issues.apache.org/jira/browse/DIRMINA-471 ? Saurabh -- View this message in context: http://www.nabble.com/BUFFER_OVERFLOW-tp14281194s16868p14281194.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: BUFFER_OVERFLOW
Hi, I am using mina-core-2.0.0-M1-SNAPSHOT which i compiled from trunk from revision number 581243 (This is the highest reviosion number of the files on my machine) Thanks Saurabh Trustin Lee wrote: > > Could you let us know the version number of MINA you are using? > > Trustin > > On Dec 12, 2007 4:18 AM, Saurabh Jain <[EMAIL PROTECTED]> wrote: >> >> Hi All, >> >> I have written an Client/Server application. When my server is trying to >> send a big chink of data, i am getting the following exception >> >> javax.net.ssl.SSLException: SSLEngine error during encrypt: >> BUFFER_OVERFLOW >> src: java.nio.HeapByteBuffer[pos=16384 lim=16418 cap=16418]outNetBuffer: >> java.nio.HeapByteBuffer[pos=16421 lim=32836 cap=32836] >> at >> org.apache.mina.filter.ssl.SslHandler.encrypt(SslHandler.java:380) >> at >> org.apache.mina.filter.ssl.SslFilter.filterWrite(SslFilter.java:506) >> at >> org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) >> at >> org.apache.mina.common.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:38) >> at >> org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:745) >> at >> org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolEncoderOutputImpl.flush(ProtocolCodecFilter.java:384) >> at >> org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:210) >> at >> org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) >> at >> org.apache.mina.common.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:38) >> at >> org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:745) >> at >> org.apache.mina.common.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:671) >> at >> org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:421) >> at >> org.apache.mina.common.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:415) >> at >> org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:241) >> at >> org.apache.mina.common.AbstractIoSession.write(AbstractIoSession.java:200) >> >> I get this problem in my office network ( Tested on 3 different machines) >> but i am not able to reproduce it in my home network ( tried on 2 >> different >> machines). >> >> is it related to https://issues.apache.org/jira/browse/DIRMINA-471 ? >> >> Saurabh >> >> -- >> View this message in context: >> http://www.nabble.com/BUFFER_OVERFLOW-tp14281194s16868p14281194.html >> Sent from the Apache MINA Support Forum mailing list archive at >> Nabble.com. >> >> > > > > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ > -- > PGP Key ID: 0x0255ECA6 > > -- View this message in context: http://www.nabble.com/BUFFER_OVERFLOW-tp14281194s16868p14320888.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Problem with dispose(); Access denied Exception.
Hi, I am using NioSocketConnector in my application. At the time of quiting the client I am trying to call dispose() on the connector. On calling dispose my application throws an exception and the application hangs. At the same time the CPU usage of the client goes to 100%. The exception generated at the client side is as under: 20-Jan-2008 23:30:51 org.apache.mina.common.DefaultExceptionMonitor exceptionCaught WARNING: Unexpected exception. java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.util.concurrent.ThreadPoolExecutor.shutdownNow(ThreadPoolExecutor.java:959) at java.util.concurrent.ScheduledThreadPoolExecutor.shutdownNow(ScheduledThreadPoolExecutor.java:475) at org.apache.mina.common.IdleStatusChecker.stop(IdleStatusChecker.java:120) at org.apache.mina.common.IdleStatusChecker.removeService(IdleStatusChecker.java:103) at org.apache.mina.common.AbstractIoService$1.serviceDeactivated(AbstractIoService.java:50) at org.apache.mina.common.IoServiceListenerSupport.fireServiceDeactivated(IoServiceListenerSupport.java:153) at org.apache.mina.common.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:222) at org.apache.mina.common.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:330) at org.apache.mina.common.AbstractPollingIoProcessor.remove(AbstractPollingIoProcessor.java:300) at org.apache.mina.common.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:43) at org.apache.mina.common.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:678) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) 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) Please let me know what is going wrong here. Regards, Saurabh -- View this message in context: http://www.nabble.com/Problem-with-dispose%28%29--Access-denied-Exception.-tp14984654s16868p14984654.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: Problem with dispose(); Access denied Exception.
Hi Trustin, I am running a desktop application. This application is built on top of the netbeans platform and the exception is on calling the close() method on the IOSession object. The netbeans platform does implement some kind of security manager. I would like to mention that the application was working fine with the 1.x version. Is ther any change in the permissions required? But the application still hangs and the CPU usage goes to 100% as soon as I call dispose() on the connector. Thanx, Saurabh Trustin Lee wrote: > > Hi Saurbh, > > What's the environment of your application? Are you running it as a > Java Applet or something similar with strict security Manager? > > Trustin > > On Jan 21, 2008 3:10 AM, Saurabh Jain <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I am using NioSocketConnector in my application. At the time of quiting >> the >> client I am trying to call dispose() on the connector. On calling dispose >> my >> application throws an exception and the application hangs. At the same >> time >> the CPU usage of the client goes to 100%. >> >> The exception generated at the client side is as under: >> >> 20-Jan-2008 23:30:51 org.apache.mina.common.DefaultExceptionMonitor >> exceptionCaught >> WARNING: Unexpected exception. >> java.security.AccessControlException: access denied >> (java.lang.RuntimePermission modifyThread) >> at >> java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) >> at >> java.security.AccessController.checkPermission(AccessController.java:427) >> at >> java.util.concurrent.ThreadPoolExecutor.shutdownNow(ThreadPoolExecutor.java:959) >> at >> java.util.concurrent.ScheduledThreadPoolExecutor.shutdownNow(ScheduledThreadPoolExecutor.java:475) >> at >> org.apache.mina.common.IdleStatusChecker.stop(IdleStatusChecker.java:120) >> at >> org.apache.mina.common.IdleStatusChecker.removeService(IdleStatusChecker.java:103) >> at >> org.apache.mina.common.AbstractIoService$1.serviceDeactivated(AbstractIoService.java:50) >> at >> org.apache.mina.common.IoServiceListenerSupport.fireServiceDeactivated(IoServiceListenerSupport.java:153) >> at >> org.apache.mina.common.IoServiceListenerSupport.fireSessionDestroyed(IoServiceListenerSupport.java:222) >> at >> org.apache.mina.common.AbstractPollingIoProcessor.removeNow(AbstractPollingIoProcessor.java:330) >> at >> org.apache.mina.common.AbstractPollingIoProcessor.remove(AbstractPollingIoProcessor.java:300) >> at >> org.apache.mina.common.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:43) >> at >> org.apache.mina.common.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:678) >> at >> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) >> 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) >> >> Please let me know what is going wrong here. >> >> Regards, >> Saurabh >> >> -- >> View this message in context: >> http://www.nabble.com/Problem-with-dispose%28%29--Access-denied-Exception.-tp14984654s16868p14984654.html >> Sent from the Apache MINA Support Forum mailing list archive at >> Nabble.com. >> >> > > > > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ > -- > PGP Key ID: 0x0255ECA6 > > -- View this message in context: http://www.nabble.com/Problem-with-dispose%28%29--Access-denied-Exception.-tp14984654s16868p15025185.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
How to gracefully shutdown a connection from client
Hi, I am writting a Client-Server application with mina. I am having problem in gracefully shutting down the client. the way i am trying to do is: - The client sends a logout request to the server. - The server does the clean up and closes the connection. - The client is waiting for the connection to be closed by the server. - As soon as the connection is closed the client does the cleanup and exit. The first two steps are fine. But the client is not recieving close notification, due to this the client is hanging. The code is as under: On server side when I recieve LOGOUT: session.close(); On Client Side: GenericRequest req = new GenericRequest(Constants.REQ_LOGOUT, null); WriteFuture future = session.write(req); future.awaitUninterruptibly(); conHandler.shutdown(); pinger.shutDown(); System.out.println("Waiting to close::"); this.session.getCloseFuture().awaitUninterruptibly(); System.out.println("Closed "); The client is hanging on this.session.getCloseFuture().awaitUninterruptibly(); Please let me know what is the right way to gracefully shut down a client application. Thanx, Saurabh -- View this message in context: http://www.nabble.com/How-to-gracefully-shutdown-a-connection-from-client-tp15189221s16868p15189221.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
Re: How to gracefully shutdown a connection from client
When i try to use close at client side then i get a java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread) due to the Security manager implementation of my application. Does close operation require any specific permissions? Also I have gone through the examples and i think this is the same mechanism used in the examples. (May be I have missed something [:(] ) I followed the chat example. Saurabh. Niklas Therning wrote: > > Saurabh Jain wrote: >> Hi, >> >> I am writting a Client-Server application with mina. I am having problem >> in >> gracefully shutting down the client. the way i am trying to do is: >> - The client sends a logout request to the server. >> - The server does the clean up and closes the connection. >> - The client is waiting for the connection to be closed by the server. >> - As soon as the connection is closed the client does the cleanup and >> exit. >> >> The first two steps are fine. But the client is not recieving close >> notification, due to this the client is hanging. >> >> The code is as under: >> >> On server side when I recieve LOGOUT: >> session.close(); >> >> On Client Side: >> GenericRequest req = new >> GenericRequest(Constants.REQ_LOGOUT, null); >> WriteFuture future = session.write(req); >> future.awaitUninterruptibly(); >> conHandler.shutdown(); >> pinger.shutDown(); >> System.out.println("Waiting to close::"); >> this.session.getCloseFuture().awaitUninterruptibly(); >> System.out.println("Closed "); >> >> The client is hanging on >> this.session.getCloseFuture().awaitUninterruptibly(); >> >> Please let me know what is the right way to gracefully shut down a client >> application. >> >> Thanx, >> Saurabh >> >> >> > > Maybe the client session's CloseFuture is only notified when you call > session.close() on the client side. I'm not sure how it's supposed to > be. If you use > > this.session.close().awaitUninterruptibly(); > > it might work better? > > -- > Niklas Therning > www.spamdrain.net > > > - > Niklas Therning > www.spamdrain.net > -- View this message in context: http://www.nabble.com/How-to-gracefully-shutdown-a-connection-from-client-tp15189221s16868p15211665.html Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.