Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, I see now the problem isn't with reading the xml itself, rather with bootstraping with it, as changing Service name to lovercase helped. I use ReaderService to read xml file with addresses and build address objects. Here is mine Bootstrap code: `</p> <pre><code>class BootStrap { def readService def init = { servletContext -&gt; def xml = readService.read() println xml def adress = new mobilmed.Adres(ulica:xml.adress.street, dom:xml.adress.house, miejscowość:xml.adress.residance, kodPocztowy:xml.adress.postCode, poczta:xml.adress.post).save() if(adres.hasErrors()){ println adres.errors} } } </code></pre> <p>When I run it, I got classical "no such property" error.</p> <pre><code>| Error 2012-08-28 06:42:36,784 [pool-7-thread-1] ERROR context.GrailsContextLoader - Error executing bootstraps: No such property: adres for class: BootStrap Message: No such property: adres for class: BootStrap Line | Method -&gt;&gt; 10 | doCall in BootStrap$_closure1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 301 | evaluateEnvironmentSpecificBlock in grails.util.Environment | 294 | executeForEnvironment . . . . . in '' | 270 | executeForCurrentEnvironment in '' | 303 | innerRun . . . . . . . . . . . . in java.util.concurrent.FutureTask$Sync | 138 | run in java.util.concurrent.FutureTask | 886 | runTask . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . . . . . . . . . . . . . in java.lang.Thread </code></pre> <p>Of course, i checked, and Boostraping for defined variables works just fine, like this:</p> <pre><code>def karolzam = new mobilmed.Adres(ulica:"Turkusowa", dom:"8/22", miejscowość:"Lublin", kodPocztowy:"20-572", poczta:"Lublin").save() if(karolzam.hasErrors()){ println karolzam.errors} </code></pre> <p>Looks like the Bootstrap don't "seeing" variables that can print on console. :/ </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload