[AGENT++] Strange bugs in AgenPro
Mike Nuss
nmx at fromtheshadows.net
Fri Dec 15 18:08:26 CET 2006
I'm trying out the demo of AgenPro 2. While I'm happy with it overall
so far, I've run into a couple of weird problems.
I'm using the supplied java_code.vm to generate code for snmp4j. The
first issue is that if I define an object with an enumerated integer
type, the enumeration constants simply don't show up in the generated
Java source unless I set its MAX-STATUS to "read-write". If it's
"read-only", I have to add the enumeration constants manually to the
generated Java file.
The second issue is that in some circumstances, I get the following error:
1015 [main] DEBUG Generator - Found 0 existing code snippets
1069 [main] ERROR Velocity - Method getModuleName threw exception for
reference $agenUtils in template /home/mike/src/snmp/code.vm at
[506,31]
1069 [main] ERROR Velocity - Method getModuleName threw exception for
reference $tcModules in template /home/mike/src/snmp/code.vm at
[506,16]
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getModuleName' in class com.agentpp.agenpro.util.AgenUtils
threw exception class java.lang.NullPointerException : null
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:309)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:207)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:357)
at org.apache.velocity.runtime.parser.node.ASTMethod.doIntrospection(ASTMethod.java:145)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:209)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:207)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:357)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:135)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:344)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:153)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:271)
at org.apache.velocity.Template.merge(Template.java:296)
at com.agentpp.agenpro.Generator.run(Unknown Source)
at com.agentpp.agenpro.AgenPro.main(Unknown Source)
1092 [main] ERROR Generator - Invocation of method 'getModuleName' in
class com.agentpp.agenpro.util.AgenUtils threw exception class
java.lang.NullPointerException : null
1092 [main] INFO AgenPro.Console - Finished all jobs with 1 error(s),
AgenPro terminated.
I seem to get this error if I define an object as having syntax
DisplayString, unless the object also happens to be a column of a
table, in which case it works fine. If I have a scalar object defined
as a DisplayString, I get this error. If I just change the syntax to
something else (for example, OCTET STRING), it works fine. My MIB
compiles without any errors, and I'm importing DisplayString, so this
looks to me like a bug.
Both of these issues are easily reproducible.
Thanks in advance,
Mike
More information about the AGENTPP
mailing list