Compilation error error: encoding line too long: "when creating assembly

I have a Grails project that works correctly in dev mode, but when I try to create a war file, it gives me the following message and stops building

| Compiling 1 source files | Compiling 1 source files. | Compiling 1 source files.. | Compiling 1 source files... | Compiling 1 source files.... | Compiling 1 source files..... | Compiling 16 GSP files for package [ProjectName] | Compiling 16 GSP files for package [ProjectName]. | Error Compilation error: encoded string too long: 108421 bytes 

Grails does not give me any other information, from the point of view of which the GSP or line problem, has anyone seen this happening?

Here are the grails stats, I would say this is a pretty small project

 +----------------------+-------+-------+ | Name | Files | LOC | +----------------------+-------+-------+ | Controllers | 6 | 624 | | Domain Classes | 6 | 109 | | Java Helpers | 1 | 96 | | Unit Tests | 12 | 565 | | Scripts | 1 | 4 | +----------------------+-------+-------+ | Totals | 26 | 1398 | +----------------------+-------+-------+ 
+4
source share
3 answers

I never knew what the problem was, all I did was move the entire necessary file to a completely new project, and this error disappeared!

0
source

This seems to be a grails bug with versions prior to 2.3.7 , but it is fixed in 2.3.7 and higher. You have two upgrade options or follow these steps.

  • Find all gsp pages with a file size greater than 64K.
  • Add a comment <% / * to break the gsp * /%> static block in the middle of your static pages (add it to the end of the html tags, for example, after </P> , etc.).

This will make grails think that it is processing two pieces and allows it to be processed.

+2
source

I have seen this before. What @tim_yates commented on! Refactoring some gsp [include, for example], and everything was fine again. Also, with a little research on this, I found some interesting things about DataOutputStream.java. It seems like String 64kb limit for objects.

Perhaps this can also help you.

Hurrah!

0
source

All Articles