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

How to deal with very large templates? #105

Open
DrewDennison opened this issue Sep 25, 2017 · 3 comments
Open

How to deal with very large templates? #105

DrewDennison opened this issue Sep 25, 2017 · 3 comments

Comments

@DrewDennison
Copy link

Hello,

I'm using the mustache templates and I'm getting a Maximum String literal length exceeded message.

java.lang.IllegalArgumentException: Maximum String literal length exceeded
	at scala.tools.asm.ByteVector.putUTF8(ByteVector.java:213)
	at scala.tools.asm.ClassWriter.newUTF8(ClassWriter.java:1092)
	at scala.tools.asm.ClassWriter.newString(ClassWriter.java:1560)
	at scala.tools.asm.ClassWriter.newConstItem(ClassWriter.java:1042)
	at scala.tools.asm.MethodWriter.visitLdcInsn(MethodWriter.java:1134)
	at scala.tools.asm.tree.LdcInsnNode.accept(LdcInsnNode.java:71)
	at scala.tools.asm.tree.InsnList.accept(InsnList.java:162)
	at scala.tools.asm.tree.MethodNode.accept(MethodNode.java:817)
	at scala.tools.asm.tree.MethodNode.accept(MethodNode.java:727)
	at scala.tools.asm.tree.ClassNode.accept(ClassNode.java:412)
	at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker2.getByteArray$1(GenBCode.scala:291)
	at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker2.addToQ3(GenBCode.scala:298)
	at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker2.run(GenBCode.scala:274)
	at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.buildAndSendToDisk(GenBCode.scala:384)
	at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:350)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1431)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1416)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1412)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1515)
	at org.fusesource.scalate.support.ScalaCompiler.compile(ScalaCompiler.scala:92)
	at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:809)
	at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:745)
	at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:446)
	at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:440)
	at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:495)
	at org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:593)

Is is possible to use a large template with another method or is it possible to add more documentation about how to deal with a large template file? My use case is generating emails and I'm embedding a css into a style section.

Thanks!

@pedrovgs
Copy link

pedrovgs commented Feb 1, 2018

I'm facing the same issue with an SSP template. The template is a commercial agreement and it's too long to be used as an HTML template :( Any workaround or fix we could provide?

@pedrovgs
Copy link

pedrovgs commented Feb 1, 2018

@DrewDennison as a workaround I've split my template into two template files. I guess you can do the same with your CSS file. This is not ideal at all, but it's the only way I've found to get it working 😃

@h-vetinari
Copy link

Same problem here...

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

3 participants