Salut,
quende wrote:
> I've just checked that test unit running on Linux Mint 5 with the same build
> of JDK, and it works like a charm. No problems there.
Hum I guess we need to investigate Win32.
>
> Anyway, it's the first time I use SSL, and there is something disappointing
> me. I have a Callable class on the server-side, that has a stack of messages
> it should send to client, specified by clientSelectionKey. If I write
> something like
>
> @Override
> public Object call()
> {
> try
> {
> for(Message message : _messages)
> {
> if (clientSelectionKey.isValid())
> {
>
> SSLOutputWriter.flushChannel(clientSelectionKey.channel(),
> message.getByteBuffer());
> }
> ...
>
> I get
>
> Sep 30, 2008 12:10:10 AM com.sun.grizzly.Controller returnContext
> FINE: returnContext() Context : com.sun.grizzly.Context_at_b82368
>
> java.lang.NullPointerException
> at com.sun.grizzly.util.SSLUtils.wrap(SSLUtils.java:290)
> at
> com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:87)
> at
> com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:69)
> at TestSSLPrj.Client.call(Client.java:137)
> at
> com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:309)
> at
> com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:168)
>
> The ByteBuffer of "message" is not null, the SelectionKey is valid, so I
> wonder, why I can't send data to client. Have I missed something, or is
> there a better practice to send data from server to client with SSL?
Are you spawning you own thread? In Grizzly, we have "special" Thread
that have some attribute. From you code snipped it is hard to diagnose,
but I suspect the caller thread is not an instance of WorkerThread.
Could it be the issue? Make sure when you creates a Thread you create it
using:
https://grizzly.dev.java.net/nonav/apidocs/com/sun/grizzly/util/WorkerThreadFactory.html
https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/util/WorkerThreadFactory.html
Thanks
-- Jeanfrancois
> Thanks in advance,
> -- Quende