Renato Araújo Ferreira | 1 Sep 2008 16:15
Picon

Re: java.lang.IllegalArgumentException: port out of range:555555

OMG!, someone configured one host to use this port... The programmers are 
sabotaging me...

----- Original Message ----- 
From: "Eugene R. Snider" <gene@...>
To: "Renato Araújo Ferreira" <renato@...>
Cc: <snmp4j@...>
Sent: Friday, August 29, 2008 6:05 PM
Subject: Re: [SNMP4J] java.lang.IllegalArgumentException: port out of 
range:555555

> Most likely because you mistyped the port number as 555555 instead of the 
> 55555 you probably wanted.
>
> Renato Araújo Ferreira wrote:
>> Why it happen?
>>
>> java.lang.IllegalArgumentException: port out of range:555555
>>         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:83)
>>         at 
>> org.snmp4j.transport.DefaultUdpTransportMapping.sendMessage(Unknown 
>> Source)
>>         at org.snmp4j.MessageDispatcherImpl.sendMessage(Unknown Source)
>>         at org.snmp4j.MessageDispatcherImpl.sendPdu(Unknown Source)
>>         at org.snmp4j.util.MultiThreadedMessageDispatcher.sendPdu(Unknown 
>> Source)
>>         at org.snmp4j.Snmp.sendMessage(Unknown Source)
>>         at org.snmp4j.Snmp$PendingRequest.run(Unknown Source)
>>         at java.util.TimerThread.mainLoop(Timer.java:512)
>>         at java.util.TimerThread.run(Timer.java:462)
(Continue reading)

Renato Araújo Ferreira | 1 Sep 2008 20:03
Picon

Re: some SNMP4j issues...

Frank,

I found that someone that configured the system to try to use the wrong port 
(555555), but when I solved this error the timeout problem and the 
ConcurrentModificationException stopped to ocurr. Is it an incorrect 
exception handling of IllegalArgumentException inside the 
DefaultUdpTransportMapping? Because an isolated error affect all SNMP 
processing of snmp4j in VM.

Renato A. Ferreira

----- Original Message ----- 
From: "Frank Fock" <fock@...>
To: "Renato Araújo Ferreira" <renato@...>
Cc: <snmp4j@...>
Sent: Wednesday, August 27, 2008 6:58 PM
Subject: Re: [SNMP4J] some SNMP4j issues...

> Hello Renato,
>
> Are you sure that each session is closed only once?
> The last error you reported (ConcurrentMofificationException)
> suggests that.
>
> The other errors/delays are caused by Java and
> probably caused by heavy session (=UDP port)
> creation and closing.
> Changing the JRE (version) may help too.
>
> Best regards,
(Continue reading)

Frank Fock | 1 Sep 2008 23:22
Favicon

Re: some SNMP4j issues...

Renato,

This is not a problem of the exception handling inside
SNMP4J. There is no resource blocked or held inconsistently
by SNM4J when this runtime exception is thrown.

Best regards,
Frank

Renato Araújo Ferreira wrote:
> Frank,
> 
> I found that someone that configured the system to try to use the wrong 
> port (555555), but when I solved this error the timeout problem and the 
> ConcurrentModificationException stopped to ocurr. Is it an incorrect 
> exception handling of IllegalArgumentException inside the 
> DefaultUdpTransportMapping? Because an isolated error affect all SNMP 
> processing of snmp4j in VM.
> 
> Renato A. Ferreira
> 
> ----- Original Message ----- From: "Frank Fock" <fock@...>
> To: "Renato Araújo Ferreira" <renato@...>
> Cc: <snmp4j@...>
> Sent: Wednesday, August 27, 2008 6:58 PM
> Subject: Re: [SNMP4J] some SNMP4j issues...
> 
> 
>> Hello Renato,
>>
(Continue reading)

Eugene R. Snider | 3 Sep 2008 05:39

Re: some SNMP4j issues...

Renato,

No, the concurrent modification exception is probably what happens when 
multiple threads attempt to use the wrong port (555555). If one thread 
is in the middle of exception processing for the illegal argument any 
other threads will get the ConcurrentModificationException, if enough 
threads gets started they will also generate timeouts.

It's not an isolated error, it's a continuous cycle of sends in multiple 
threads.

Also I agree with Frank that you should upgrade your Java version.

Gene

Renato Araújo Ferreira wrote:
> Frank,
>
> I found that someone that configured the system to try to use the 
> wrong port (555555), but when I solved this error the timeout problem 
> and the ConcurrentModificationException stopped to ocurr. Is it an 
> incorrect exception handling of IllegalArgumentException inside the 
> DefaultUdpTransportMapping? Because an isolated error affect all SNMP 
> processing of snmp4j in VM.
>
Renato Araújo Ferreira | 3 Sep 2008 18:09
Picon

Re: some SNMP4j issues...

Gene,

Multiple thread access many targets with SNMP4J, but only one target has a 
wrong snmp port configured as 555555. Now I configured our database to 
accept only values between 0~65535 to avoid this problem, but I'm worried 
yet about any other system or communication error that could happen and 
bring back these erros.

The ConcurrentModificationException and the bad timeout behaviour happen 
when the IllegalArgumentException is thrown to only one target and only one 
thread. And the ConcurrentModificationException, for example, happen at 
final of process on thread "main", when all threads and instantes of snmp 
were already closed. When I see the message 'Exception in thread "Timer-0" 
java.lang.IllegalArgumentException: port out of range:555555', I think that 
the "Timer-0" thread is dead without finish their job, what could leak some 
resources.

Is there something that I can do to do a diagnose of this problema to prove 
if It's happening or not? A specific profiler or debugger that runs under 
linux console mode?

Renato A. Ferreira

----- Original Message ----- 
From: "Eugene R. Snider" <gene@...>
To: "Renato Araújo Ferreira" <renato@...>
Cc: <snmp4j@...>
Sent: Wednesday, September 03, 2008 12:39 AM
Subject: Re: [SNMP4J] some SNMP4j issues...

(Continue reading)

Abhinandan Sonvane | 4 Sep 2008 08:10
Picon

Null Response in ResponsePDU

Hi All,
 I am getting null respose for the following code

import java.io.IOException;
import org.snmp4j.PDU;
import org.snmp4j.ScopedPDU;
import org.snmp4j.Snmp;
import org.snmp4j.TransportMapping;
import org.snmp4j.UserTarget;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.mp.MPv3;
import org.snmp4j.mp.MessageProcessingModel;
import org.snmp4j.mp.SnmpConstants;
import org.snmp4j.security.AuthMD5;
import org.snmp4j.security.PrivDES;
import org.snmp4j.security.SecurityLevel;
import org.snmp4j.security.SecurityModels;
import org.snmp4j.security.SecurityProtocols;
import org.snmp4j.security.USM;
import org.snmp4j.security.UsmUser;
import org.snmp4j.smi.Address;
import org.snmp4j.smi.GenericAddress;
import org.snmp4j.smi.Integer32;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.transport.DefaultTcpTransportMapping;
import org.snmp4j.transport.DefaultUdpTransportMapping;

/**
(Continue reading)

johan.rask | 4 Sep 2008 14:12
Picon

Registering multiple DefaultMOTable instances

Hi,

I am trying to register multiple DefaultMOTable instances with the 
DefaultMOServer.
I create the DefaultMOTable similar to how it is created in TestAgent.

table1 = new DefaultMOTable(
                new OID("1.3.6.1.4.1.29868.1.4.3"), indexDef, columns);

table2 = new DefaultMOTable(
                new OID("1.3.6.1.4.1.29868.1.5.4"), indexDef, columns);

server.register(table1,null);
server.register(table2,null)

Second registstration generates a
org.snmp4j.agent.DuplicateRegistrationException with msg:
org.snmp4j.agent.DefaultMOContextScope[
context=null,
lowerBound=1.3.6.1.4.1.29868.1.4.3,
lowerIncluded=false,
upperBound=1.3.6.1.4.1.29868.1.4.4,
upperIncluded=false]

I am obviously missing something here, why are these equal?

Regards /Johan
johan.rask | 4 Sep 2008 15:16
Picon

Re: Registering multiple DefaultMOTable instances

Solved, my mistake.

The REAL issue had nothing todo with multiple instances of
tables, rather that I hade registered a new MO with
OID = 1.3.6.1.4.1.29868.1.4.1 but I had not added a trailing
zero ->1.3.6.1.4.1.29868.1.4.1.0

/johan

2008-09-04 johan.rask@... wrote:

Hi,
>
>I am trying to register multiple DefaultMOTable instances with the 
>DefaultMOServer.
>I create the DefaultMOTable similar to how it is created in TestAgent.
>
>table1 = new DefaultMOTable(
>                new OID("1.3.6.1.4.1.29868.1.4.3"), indexDef, columns);
>
>table2 = new DefaultMOTable(
>                new OID("1.3.6.1.4.1.29868.1.5.4"), indexDef, columns);
>
>server.register(table1,null);
>server.register(table2,null)
>
>Second registstration generates a
>org.snmp4j.agent.DuplicateRegistrationException with msg:
>org.snmp4j.agent.DefaultMOContextScope[
>context=null,
(Continue reading)

Abhinandan Sonvane | 8 Sep 2008 06:27
Picon

Please explain this term....SecurityName

Hi All,
I have used a method setSecurityName() in my program.What parameter should
I  pass in this method and also explain me its importance.

Thanks and Regards
    Abhinandan
Jochen Katz | 8 Sep 2008 21:29
Favicon

Re: Please explain this term....SecurityName

Hi,

> I have used a method setSecurityName() in my program.What parameter should
> I  pass in this method and also explain me its importance.

from rfc3414:
   securityName
      A human-readable string representing the user in a format that is
      Security Model independent.  There is a one-to-one relationship
      between userName and securityName.

   userName
      A string representing the name of the user.

Regards,
  Jochen

Gmane