I have a app where my users input a HTML template with SimpleTemplateEngine notation, and execute this template with code above, in a Java Class:
new SimpleTemplateEngine().createTemplate(templateStr).make(map).toString()
and I obtain this error:
groovy.lang.GroovyRuntimeException: Could not instantiate custom Metaclass for class: java.util.ArrayList. Reason: java.lang.NoSuchMethodException: groovy.runtime.metaclass.java.util.ArrayListMetaClass.<init>(groovy.lang.MetaClass)
I observe that error occurrs in a loop in a java.util.ArrayLIst in a JPA Entity loaded by Hibernate:
<%for(int k=0; k< Registro[i].listUsers.size();k++){%>
HTML CODE
<%}%>
Anyone can help me? I no have more ideas about this error... Thanks!
I'm guessing that the part
Registro[i]is for getting the value of a static property which name is held under the variablei(or at least that is what will happen) unless thegetAt(String)method has been overloaded onRegistro.Either way I also guess that returns an object that has a
listUsersproperty that should be at least aCollection.Maybe the problem is with the initialization of said
listUsersproperty.Some
Registrocode could be used for better understanding.