Julien,

Tried the MINA mapping. Its not working for me. It throws
java.net.PortUnreachableException exception.
Tried capturing packet, but no packets are sent. My agent simulator is
running on port 8001.

Here are the traces

[DEBUG] 2009-09-14 18:43:25,437 [main] Got session (0x00000001: nio
datagram, client, /10.100.207.73:2067 => LWUS1B066/10.100.207.73:0)
[DEBUG] 2009-09-14 18:43:25,437 [NioProcessor-1] session opened
(0x00000001: nio datagram, client, /10.100.207.73:2067 =>
LWUS1B066/10.100.207.73:0)
[DEBUG] 2009-09-14 18:43:25,609 [main] Running pending async request
with handle PduHandle[1331093115] and retry count left 1
[DEBUG] 2009-09-14 18:43:25,609 [main] Sending message to
10.100.207.73/8001 with length 37:
30:23:02:01:01:04:06:70:75:62:6c:69:63:a5:16:02:04:4f:56:de:7b:02:01:00:02:01:0a:30:08:30:06:06:02:2b:06:05:00
[DEBUG] 2009-09-14 18:43:25,703 [NioProcessor-1] sent :
HeapBuffer[pos=0 lim=37 cap=37: 30 23 02 01 01 04 06 70 75 62 6C 69 63
A5 16 02...]
[ERROR] 2009-09-14 18:43:25,734 [NioProcessor-1] Network exception
java.net.PortUnreachableException
        at sun.nio.ch.DatagramDispatcher.read0(Native Method)
        at sun.nio.ch.DatagramDispatcher.read(DatagramDispatcher.java:25)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
        at sun.nio.ch.IOUtil.read(IOUtil.java:206)
        at sun.nio.ch.DatagramChannelImpl.read(DatagramChannelImpl.java:324)
        at 
org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:179)
        at 
org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:41)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:592)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:563)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:552)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:56)
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:891)
        at 
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
[DEBUG] 2009-09-14 18:43:25,734 [NioProcessor-1] session closed
[ WARN] 2009-09-14 18:43:26,609 [Timer-0] Sending confirmed PDU
GETBULK[requestID=1331093115, errorStatus=Success(0), errorIndex=10,
VBS[1.3.6 = Null]] to target 10.100.207.73/8001 although transport
mapping org.snmp4j.mina.minaudptransportmapp...@1f934ad is not
listening for a response
[DEBUG] 2009-09-14 18:43:26,609 [Timer-0] Running pending async
request with handle PduHandle[1331093115] and retry count left 0
[DEBUG] 2009-09-14 18:43:26,609 [Timer-0] Sending message to
10.100.207.73/8001 with length 37:
30:23:02:01:01:04:06:70:75:62:6c:69:63:a5:16:02:04:4f:56:de:7b:02:01:00:02:01:0a:30:08:30:06:06:02:2b:06:05:00
[DEBUG] 2009-09-14 18:43:27,609 [Timer-0] Request timed out: 1331093115
[DEBUG] 2009-09-14 18:43:27,640 [Timer-0] Cancelling pending request
with handle PduHandle[1331093115]


Am I missing something here?

thanks
ashish


On Fri, Sep 11, 2009 at 8:05 PM, Ashish <[email protected]> wrote:
> Ok! Porting done to MINA 2.0 M6
>
> Porting was easy. The thread didn't had answer to why an Agent need
> access to Logger?
> So, if we use MINA Transport mapping, we will definitely need SLF4J,
> and that shouldn't be an issue :-)
>
> Should I change this code
>
> ConnectFuture cf = connector.connect(new
> InetSocketAddress(getAddress().getInetAddress(),
> getAddress().getPort()));
>        cf.awaitUninterruptibly();
>
> to
>
> for (;;) {
>              try {
>                  ConnectFuture future = connector.connect(new
> InetSocketAddress(
>                          HetAddress().getInetAddress(),
> getAddress().getPort()));
>                  future.awaitUninterruptibly();
>                  session = future.getSession();
>                  break;
>              } catch (RuntimeIoException e) {
>                  System.err.println("Failed to connect.");
>                  e.printStackTrace();
>              }
>          }
>
>
> Will test this tomorrow. Not sure if SNMP4J guys have any test suite for this
>
> thanks
> ashish
>
> On Fri, Sep 11, 2009 at 7:42 PM, Julien Vermillard
> <[email protected]> wrote:
>> Le Fri, 11 Sep 2009 19:35:49 +0530,
>> Ashish <[email protected]> a écrit :
>>
>>> On Fri, Sep 11, 2009 at 7:26 PM, Julien Vermillard
>>> <[email protected]> wrote:
>>> > Le Fri, 11 Sep 2009 19:08:49 +0530,
>>> > Ashish <[email protected]> a écrit :
>>> >> >
>>> >> > Here a MINA based transport for SNMP4J :
>>> >> > http://people.apache.org/~jvermillard/snmp4j/
>>> >> >
>>> >> > Julien
>>> >>
>>> >> Interesting. Never knew it existed :-)
>>> >>
>>> >> Great work. I would love to use it. The most interesting part
>>> >> would be to benchmark the two implementations.
>>> >> A good topic to write about :-)
>>> >>
>>> > Wowow a possible user ;)
>>> > Perhaps you'll need to fix the code for use latest MINA 2, but it's
>>> > probably trivial.
>>> >
>>> > Julien
>>>
>>>
>>> Yes I would be very keen on using this.
>>> By any chance, do SNMP4J guys know about this? I read that they were
>>> looking for porting their lib to NIO.
>>>
>>> As I write this mail, I am integrating your code in SNMP4J code on my
>>> machine. Once I am done, will definitely blog about this.
>>>
>> Here the thread on SMP4J ML (was crossposted to mina-dev)
>> http://lists.agentpp.org/pipermail/snmp4j/2008-May/002935.html
>> Julien
>>
>
>
>
> --
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal
>



-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Reply via email to