Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when try to generateHtmlAsString or generateZip #12

Open
wpoosanguansit opened this issue Feb 13, 2014 · 2 comments
Open

Error when try to generateHtmlAsString or generateZip #12

wpoosanguansit opened this issue Feb 13, 2014 · 2 comments

Comments

@wpoosanguansit
Copy link

Hi,

I am trying to generate a html file following your code in the test folder. However, I do get

[NoSuchElementException: None.get]

from the code below. Does the error come from this line

val ns = schemaXb.targetNamespace.get.toString

in generator.scala? Thank you for your help.

val fi    = new FileInputStream("test/test.xsd")
val oi    = new FileOutputStream("test/test.html")
//val html  = Generator.generateHtmlAsString(fi, "a-", Some("test"))
val html  = Generator.generateZip(fi,oi,"a-", Some("test"))
@davidmoten
Copy link
Owner

Full stack trace would help. Can you supply?

@wpoosanguansit
Copy link
Author

Thank you for your help.

at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.3.jar:na]
Caused by: java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:313) ~[scala-library-2.10.3.jar:na]
at scala.None$.get(Option.scala:311) ~[scala-library-2.10.3.jar:na]
at com.github.davidmoten.xsdforms.Generator$.generateHtmlAsString(generator.scala:133) ~[xsd-forms-generator-0.1-SNAPSHOT.jar:na]
at com.github.davidmoten.xsdforms.Generator$.copyJsCssAndGeneratedForm(generator.scala:85) ~[xsd-forms-generator-0.1-SNAPSHOT.jar:na]
at com.github.davidmoten.xsdforms.Generator$.generateZip(generator.scala:42) ~[xsd-forms-generator-0.1-SNAPSHOT.jar:na]
at controllers.FormGeneratorController$$anonfun$generateHtmlFragment$1.apply(FormGeneratorController.scala:22) ~[classes/:na]
at controllers.FormGeneratorController$$anonfun$generateHtmlFragment$1.apply(FormGeneratorController.scala:18) ~[classes/:na]
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:221) ~[play_2.10.jar:2.2.1]
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:220) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$.invokeBlock(Action.scala:357) ~[play_2.10.jar:2.2.1]
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:309) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109) ~[play_2.10.jar:2.2.1]
at play.utils.Threads$.withContextClassLoader(Threads.scala:18) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:108) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:107) ~[play_2.10.jar:2.2.1]
at scala.Option.map(Option.scala:145) ~[scala-library-2.10.3.jar:na]
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:107) ~[play_2.10.jar:2.2.1]
at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:100) ~[play_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:481) ~[play-iteratees_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:481) ~[play-iteratees_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:517) ~[play-iteratees_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:517) ~[play-iteratees_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:493) ~[play-iteratees_2.10.jar:2.2.1]
at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$13.apply(Iteratee.scala:493) ~[play-iteratees_2.10.jar:2.2.1]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) [scala-library-2.10.3.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) [scala-library-2.10.3.jar:na]
... 6 common frames omitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants