[SNMP4J] Strange problem porting console app to web

Frank Fock fock at agentpp.com
Wed Jun 14 23:56:50 CEST 2006


Hi Jeff,

If you refer to an applet application, then this behavior
could be caused by security constraints. In an applet you
are normally only allowed to contact the host from which
the applet has been loaded. See the Java docs for more
information about applet programming.

Best regards,
Frank

jeffrey.j.petter at verizon.com wrote:
> Hi,
> 
> I have a very strange problem that I can't figure out for the life of me
> and wondered if anyone else may have experienced the same thing.
> 
> I have a very basic console app that is based on the SNMP4J code that came
> with "Essential SNMP". In this app, I have hard-coded some OID's of
> interest, so all that happens when the app starts is you enter a hostname
> or IP, and the values are printed to the screen. Very simple, very basic,
> but it works great. Since this code was in class files, it was seemingly
> easy to port it to the web. The only difference is that now the hostname is
> entered into a text field and you click a button, and the returned values
> should populate a text area control.
> 
> It should be a "slam-dunk" piece of cake. However, it doesn't work. I have
> two machines on my desk, and spent all day stepping through each app
> (console and web) at the same time, comparing all values. Everything goes
> great until I hit this function:
> 
>     private static PDU get(Snmp snmp, PDU request, Target target) throws
> IOException {
>       request.setNonRepeaters(0);
>       PDU response = null;
>       int objects = 0;
>       int requests = 0;
> 
>                requests++;
>                ResponseEvent responseEvent = snmp.send(request, target);
>                response = responseEvent.getResponse();
>                if (response != null) {
>                     objects += response.size();
>                }
> 
>       return response;
>     }
> 
> Following the call to snmp.send(request, target), on the console app the
> ResponseEvent structure is fully populated including the response. However,
> on the web app the response is null. As I stated, the primary class files
> doing the work are 100% identical. Stepping through with the debugger, the
> execution matches step for step until this point. To me, this is totally
> crazy...it makes no sense. Has anyone else experienced this? Does anyone
> have a clue as to what I might examine, change, tweak or whatever to get
> past this barrier?
> 
> Thanks,
> Jeff
> 
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list