I wrote a simple publication management system, which allows the user to input some authors when entering a new publication. It uses the following code:

entity Publication {
   key     :: String
   title   :: String
   authors <> List<Author>
}

entity Author {
   name :: String
}

define page newPublication() {
   var p := PublishedVolume {}
   form{
      <p> "Key" </p>
      <p> input(p.key) </p>
      <p> "Title" </p>
      <p> input(p.title) </p>
      <p> "Publisher" </p>
      <p> input(p.publisher) </p>
      <p> "Authors" </p>
      <p> input(p.authors) </p>	
      submit submitPub() { "Submit" }
   }

   action submitPub() {
      p.save();
      return root();
   }
}

On opening the new publication page, I get a NullPointerException (there are authors present in the database):

java.lang.NullPointerException
   at webdsl.generated.templates.RefArg_inputListEntity_1_newPublicationpc3.getAllowed(RefArg_inputListEntity_1_newPublicationpc3.java:102)
   at webdsl.generated.templates.inputListEntity_Template.renderInternal(inputListEntity_Template.java:161)
   at utils.TemplateServlet.render(TemplateServlet.java:89)
   at webdsl.generated.templates.newPublication_Template.renderInternal(newPublication_Template.java:526)
   at utils.TemplateServlet.render(TemplateServlet.java:89)
   at webdsl.generated.templates.NewPublicationPage.render(NewPublicationPage.java:235)
   at webdsl.generated.templates.NewPublicationPage.serve(NewPublicationPage.java:161)

I guess it has something to do with the list not being initialized, but from a WebDSL perspective, this should be irrelevant (right?). The publication initialization should create an empty list for me.

Submitted by Sander Vermolen on 23 May 2011 at 12:24

On 23 May 2011 at 12:30 Sander Vermolen commented:

I tried to initialize the list before using it now, but this does not solve the problem. Additionally I get the following errors:

reflection property not found: authors
Problem occurred in template call: inputListEntityListEntity(list, list.getAllowed()) 
at ../.servletapp/src-webdsl-template/built-in.app:1064/6

On 23 May 2011 at 12:30 Danny Groenewegen commented:

What happens to the page when this error occurs?


On 23 May 2011 at 12:32 Danny Groenewegen commented:

Does it work when you change it to

authors -> List<Author>

On 23 May 2011 at 12:38 Sander Vermolen commented:

Changing <> to -> makes no difference (same error). When the error occurs, the page loads but I do not get an input box for authors. Saving a publication (without authors) works fine.


On 23 May 2011 at 13:10 Danny Groenewegen commented:

I am able to reproduce it, working on a fix. The bug occurs when the property is in a superclass.


On 23 May 2011 at 15:45 Danny Groenewegen commented:

fixed in r4679


On 23 May 2011 at 15:45 Danny Groenewegen closed this issue.

On 23 May 2011 at 15:46 Danny Groenewegen tagged 1.2.8

Log in to post comments