Using the same "demo" code provided on the site fails to operate correctly in the "device" environment (JamVM):
2013-02-04 09:22:49,673 1 [main] INFO com.pyrasol.ltk.tests.LtkToolkitTest Initiate LLRP connection: 10.0.101.94
2013-02-04 09:22:52,557 2885 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPIoHandlerAdapterImpl session is opened:(SOCKET, R: /10.0.101.94:5084, L: null, S: /10.0.101.94:5084)
2013-02-04 09:22:52,673 3001 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder determine length of message
2013-02-04 09:22:53,340 3668 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder length already determined, see if enough bytes are available
2013-02-04 09:22:53,345 3673 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder message completely received
2013-02-04 09:22:53,348 3676 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder start decoding message
2013-02-04 09:22:53,347 3675 [main] ERROR com.pyrasol.ltk.tests.LtkToolkitTest connect failed
org.llrp.ltk.net.LLRPConnectionAttemptFailedException: Connection request timed out after 500000 ms.
at org.llrp.ltk.net.LLRPConnection.checkLLRPConnectionAttemptStatus(LLRPConnection.java:69)
at org.llrp.ltk.net.LLRPConnector.connect(LLRPConnector.java:149)
at com.pyrasol.ltk.tests.LtkToolkitTest.configure(LtkToolkitTest.java:54)
at com.pyrasol.ltk.tests.LtkToolkitTest.<init>(LtkToolkitTest.java:41)
at com.pyrasol.ltk.tests.LtkToolkitTest.main(LtkToolkitTest.java:155)
at LTKLauncher.main(LTKLauncher.java:10)
On my desktop environment everything works correctly (Sun VM):
2013-02-04 10:51:13,919 0 [main] INFO com.pyrasol.ltk.tests.LtkToolkitTest Initiate LLRP connection: 10.0.101.94
2013-02-04 10:51:14,018 99 [AnonymousIoService-1] DEBUG org.llrp.ltk.net.LLRPIoHandlerAdapterImpl session is opened:(SOCKET, R: /10.0.101.94:5084, L: /10.0.0.213:54741, S: /10.0.101.94:5084)
2013-02-04 10:51:14,213 294 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder determine length of message
2013-02-04 10:51:14,214 295 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder length already determined, see if enough bytes are available
2013-02-04 10:51:14,214 295 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder message completely received
2013-02-04 10:51:14,214 295 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder start decoding message
2013-02-04 10:51:14,289 370 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPBinaryDecoder message decoded: class org.llrp.ltk.generated.messages.READER_EVENT_NOTIFICATION
2013-02-04 10:51:14,289 370 [AnonymousIoService-2] INFO org.llrp.ltk.net.LLRPIoHandlerAdapterImpl message class org.llrp.ltk.generated.messages.READER_EVENT_NOTIFICATION received in session (SOCKET, R: /10.0.101.94:5084, L: /10.0.0.213:54741, S: /10.0.101.94:5084)
2013-02-04 10:51:14,693 774 [AnonymousIoService-2] DEBUG org.llrp.ltk.net.LLRPIoHandlerAdapterImpl <?xml version="1.0" encoding="UTF-8"?>
<llrp:READER_EVENT_NOTIFICATION xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="110975">
<llrp:ReaderEventNotificationData>
<llrp:UTCTimestamp>
<llrp:Microseconds>2013-02-04T04:51:21.003330-05:00</llrp:Microseconds>
</llrp:UTCTimestamp>
<llrp:ConnectionAttemptEvent>
<llrp:Status>Success</llrp:Status>
</llrp:ConnectionAttemptEvent>
</llrp:ReaderEventNotificationData>
</llrp:READER_EVENT_NOTIFICATION>
Why is the "L" socket NULL? I have tried turning on additional LOG4J but i am not getting additional information. I poked around the source code locations in the stack trace, and it appears the MINA IoSession does not successfully open that connection, nor does it report any error.
I am also guessing the "connection timeout" message is in a race with the parsing of the initial incoming message, since it appears to have received some bytes and is trying to process them at that time.
It also seems to be ignoring the connect timeout, since I have 500 seconds specified, and the failure is coming back in 4 seconds.
Everything is compiled using J2SE-1.5 settings in Eclipse Juno.
Please advise on how I can provide more information.
Sorry about the double-post.
It looks like the lack of the Local socket makes LTK unable to respond, and the connection process times out.
The SocketChannel that MINA uses for the LLRP session has it's local socket NULL.