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

"problem parsing template 'anonymous' " error while creating typesafehub/play-scala template #80

Closed
arpanghosh opened this issue Sep 20, 2012 · 6 comments

Comments

@arpanghosh
Copy link

arpanghosh commented Sep 20, 2012

I have installed giter8 0.5.0 using conscript.

akghosh-air:~ arpanghosh$ g8 -v

giter8 0.5.0
Usage: g8 [TEMPLATE] [OPTION]...
Apply specified template.

OPTIONS
    -b, --branch
        Resolves a template within a given branch
    --paramname=paramvalue
        Set given parameter value and bypass interaction.


Apply template and interactively fulfill parameters.
    g8 n8han/giter8

Or
    g8 git://github.com/n8han/giter8.git

Apply template from a remote branch
    g8 n8han/giter8 -b some-branch

Apply template from a local repo
    g8 file://path/to/the/repo

Apply given name parameter and use defaults for all others.
    g8 n8han/giter8 --name=template-test

When I create the "typesafehub/play-scala" template using giter8, I get the following trace:

akghosh-air:~ arpanghosh$ g8 typesafehub/play-scala

This template generates a Scala play 2.0.X project (verbatim means 
exclude files from parsing) 

application_secret [CHANGEME12345678]: 
application_name [my_app]: 
play_version [2.0.2]: 
problem parsing template 'anonymous'
line 3:1: unexpected char: 0x0
    at org.antlr.stringtemplate.language.DefaultTemplateLexer.nextToken(DefaultTemplateLexer.java:149)
    at antlr.TokenBuffer.fill(TokenBuffer.java:69)
    at antlr.TokenBuffer.LA(TokenBuffer.java:80)
    at antlr.LLkParser.LA(LLkParser.java:52)
    at org.antlr.stringtemplate.language.TemplateParser.template(TemplateParser.java:116)
    at org.antlr.stringtemplate.StringTemplate.breakTemplateIntoChunks(StringTemplate.java:850)
    at org.antlr.stringtemplate.StringTemplate.setTemplate(StringTemplate.java:441)
    at org.antlr.stringtemplate.StringTemplate.<init>(StringTemplate.java:308)
    at org.antlr.stringtemplate.StringTemplate.<init>(StringTemplate.java:293)
    at org.clapper.scalasti.adapter.ScalastiStringTemplate.<init>(ScalastiStringTemplate.java:57)
    at org.clapper.scalasti.StringTemplate.<init>(StringTemplate.scala:91)
    at giter8.G8$.write(g8.scala:36)
    at giter8.G8Helpers$$anonfun$write$2$$anonfun$apply$8.apply(g8.scala:198)
    at giter8.G8Helpers$$anonfun$write$2$$anonfun$apply$8.apply(g8.scala:198)
    at scala.util.control.Exception$Catch$$anonfun$opt$1.apply(Exception.scala:104)
    at scala.util.control.Exception$Catch$$anonfun$opt$1.apply(Exception.scala:104)
    at scala.util.control.Exception$Catch.apply(Exception.scala:88)
    at scala.util.control.Exception$Catch.opt(Exception.scala:104)
    at giter8.G8Helpers$$anonfun$write$2.apply(g8.scala:197)
    at giter8.G8Helpers$$anonfun$write$2.apply(g8.scala:188)
    at scala.collection.immutable.Stream.foreach(Stream.scala:291)
    at giter8.G8Helpers$.write(g8.scala:188)
    at giter8.G8Helpers$.giter8$G8Helpers$$applyT(g8.scala:109)
    at giter8.G8Helpers$$anonfun$applyTemplate$1.apply(g8.scala:114)
    at giter8.G8Helpers$$anonfun$applyTemplate$1.apply(g8.scala:114)
    at giter8.Apply$$anonfun$inspect$1.apply(apply.scala:16)
    at giter8.Apply$$anonfun$inspect$1.apply(apply.scala:16)
    at scala.Either$RightProjection.flatMap(Either.scala:277)
    at giter8.Apply$class.inspect(apply.scala:16)
    at giter8.Giter8.inspect(giter8.scala:3)
    at giter8.Giter8.ghInspect(giter8.scala:44)
    at giter8.Giter8.run(giter8.scala:22)
    at giter8.Giter8.run(giter8.scala:12)
    at giter8.Giter8.run(giter8.scala:3)
    at xsbt.boot.Launch$.run(Launch.scala:54)
    at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
    at xsbt.boot.Launch$.launch(Launch.scala:68)
    at xsbt.boot.Launch$.apply(Launch.scala:14)
    at xsbt.boot.Boot$.runImpl(Boot.scala:25)
    at xsbt.boot.Boot$.main(Boot.scala:15)
    at xsbt.boot.Boot.main(Boot.scala)

Template applied in ./.

The other templates are created fine:

akghosh-air:~ arpanghosh$ g8 typesafehub/akka-scala-sbt

Akka 2.0 Project Using Scala and sbt 

organization [org.example]: 
name [Akka Project In Scala]: 
akka_version [2.0.1]: 
version [0.1-SNAPSHOT]: 

Template applied in ./akka-project-in-scala
@jto
Copy link
Contributor

jto commented Sep 20, 2012

Hi @arpanghosh,

I think it's probably fixed by this pull request: #77

@max-l
Copy link

max-l commented Feb 9, 2013

I got the same problem, stragely when I run it a second time, it works...

@junosuarez
Copy link

I'm seeing this same error in gitter8 0.5.3 running $ g8 typesafehub/play-scala. I looked at the PR @jto referenced, but it didn't seem relevant.

@mbseid
Copy link

mbseid commented Apr 23, 2013

I figured out the problem. Giter8 seems to be choking on .png files. There is the favicon at public/images/favicon.png. I'm going to take a look and see if I can fix it.

@jto
Copy link
Contributor

jto commented Apr 23, 2013

@jden PR is relevant, for the reason pointed out by @mbseid.
Alternatively, you can exclude png files.

@eed3si9n
Copy link
Member

I'm closing this as a duplicate of #73

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

No branches or pull requests

6 participants