ssl in chat example
-------------------

                 Key: DIRMINA-728
                 URL: https://issues.apache.org/jira/browse/DIRMINA-728
             Project: MINA
          Issue Type: Bug
          Components: Example
    Affects Versions: 2.0.0-M6
         Environment: Ubuntu 9.04, Sun Java 6, m2eclipse
            Reporter: Lars Bohl


The SwingChatClient (org.apache.mina.example.chat.SwingChatClient.java) won't 
work with SSL activated.
How to reproduce:

- start the server from the chat example (SwingMain.java)
- start the client from the chat example (SwingChatClient.java)

(i checked out the mina source, which includes the examples, via svn, and set 
up an ad-hoc m2eclipse project for these first 2 steps .. )

- click "Connect" in the window opened by SwingChatClient.java
- in the Connect dialogue, select "Use SSL" and click "OK"

Here's the output I get (I put the example classes in packages named 
"springBastelKurs.bastelArtefakt" and "springBastelKurs.bastelArtefakt.client"):

7591 [NioProcessor-1] INFO org.apache.mina.filter.logging.LoggingFilter - 
CREATED
7592 [AWT-EventQueue-0] WARN org.apache.mina.filter.logging.LoggingFilter - 
EXCEPTION :
java.lang.ClassCastException: java.lang.String cannot be cast to 
org.apache.mina.core.buffer.IoBuffer
        at org.apache.mina.filter.ssl.SslFilter.filterWrite(SslFilter.java:533)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:505)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:813)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:739)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:505)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:497)
        at 
org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:427)
        at 
org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:368)
        at 
springBastelKurs.bastelArtefakt.client.ChatClientSupport.login(ChatClientSupport.java:102)
        at 
springBastelKurs.bastelArtefakt.client.ChatClientSupport.connect(ChatClientSupport.java:92)
        at 
springBastelKurs.bastelArtefakt.client.SwingChatClient$LoginAction.actionPerformed(SwingChatClient.java:177)
        at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at 
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6216)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5981)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4583)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
7593 [AWT-EventQueue-0] WARN org.apache.mina.core.service.IoHandlerAdapter - 
EXCEPTION, please implement 
springBastelKurs.bastelArtefakt.client.SwingChatClientHandler.exceptionCaught() 
for proper handling:
java.lang.ClassCastException: java.lang.String cannot be cast to 
org.apache.mina.core.buffer.IoBuffer
        at org.apache.mina.filter.ssl.SslFilter.filterWrite(SslFilter.java:533)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:505)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:47)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:813)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:739)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:505)
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:497)
        at 
org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:427)
        at 
org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:368)
        at 
springBastelKurs.bastelArtefakt.client.ChatClientSupport.login(ChatClientSupport.java:102)
        at 
springBastelKurs.bastelArtefakt.client.ChatClientSupport.connect(ChatClientSupport.java:92)
        at 
springBastelKurs.bastelArtefakt.client.SwingChatClient$LoginAction.actionPerformed(SwingChatClient.java:177)
        at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at 
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6216)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5981)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4583)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
7594 [NioProcessor-1] INFO org.apache.mina.filter.logging.LoggingFilter - OPENED
7600 [NioProcessor-1] INFO org.apache.mina.filter.logging.LoggingFilter - SENT: 
HeapBuffer[pos=0 lim=100 cap=130: 80 62 01 03 01 00 39 00 00 00 20 00 00 04 01 
00...]
7603 [NioProcessor-1] INFO org.apache.mina.filter.logging.LoggingFilter - CLOSED

Note: I met elecharny in #mina and he was able reproduce the error. He thinks 
that the bug is probably not in SslFilter, since he's using it a lot and it 
works fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to