When I loop through attributes in a cartridge Velocity template and try to get the 
default value, I get this exception:

Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of 
method 'getDefaultValue' in  class 
org.andromda.metafacades.uml14.AttributeFacadeLogicImpl threw exception class 
java.lang.NullPointerException : null
        at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246)
        at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
        at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
        at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166)
        at 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
        at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
        at org.apache.velocity.Template.merge(Template.java:256)
        at 
org.andromda.templateengines.velocity.VelocityTemplateEngine.processTemplate(VelocityTemplateEngine.java:204)
        at 
org.andromda.core.cartridge.Cartridge.processWithTemplate(Cartridge.java:329)
        ... 66 more


Here's the code:
#foreach ($att in $class.attributes)
// Default value for $att.name: $att.defaultValue
#end

Has anybody seen and resolved this issue?

  --Bob Muller


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to