Issue Details (XML | Word | Printable)

Key: GRAILS-3088
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Daniel.Sun
Votes: 14
Watchers: 16
Operations

If you were logged in you would be able to see more operations.
Grails

Premature end of file

Created: 10/Jun/08 08:53 AM   Updated: 21/Aug/08 05:30 AM   Resolved: 21/Aug/08 05:28 AM
Return to search
Component/s: None
Affects Version/s: 1.0.3
Fix Version/s: 1.0.4

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive Grails103-bug-report-10062008.zip (17 kB)

Environment: jdk6u10


 Description  « Hide

run the application created and browse the main page.

Fatal Error occurred
[Fatal Error] :-1:-1: Premature end of file.

see the attached app.

Thanks,
Daniel.Sun

D:\_DEV\grails_apps\Grails103>grails run-app

Welcome to Grails 1.0.3 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: D:\D\MY_DEV\grails-1.0.3

Base Directory: D:\_DEV\grails_apps\Grails103
Note: No plugin scripts found
Running script D:\D\MY_DEV\grails-1.0.3\scripts\RunApp.groovy
Environment set to development
  [groovyc] Compiling 1 source file to C:\Documents and Settings\Daniel\.grails\1.0.3\projects\Grail
s103\classes
     [copy] Copying 1 file to C:\Documents and Settings\Daniel\.grails\1.0.3\projects\Grails103
Running Grails application..
2008-06-10 21:49:55.631::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
2008-06-10 21:49:55.787::INFO:  jetty-6.1.4
2008-06-10 21:49:56.06::INFO:  No Transaction manager found - if your webapp requires one, please co
nfigure one.
2008-06-10 21:49:56.428:/Grails103:INFO:  Set web app root system property: 'Grails103-development-0
.1' = [D:\_DEV\grails_apps\Grails103\web-app\]
2008-06-10 21:49:56.428:/Grails103:INFO:  Initializing log4j from [file:C:\Documents and Settings\Da
niel/.grails/1.0.3/projects/Grails103/resources/log4j.properties]
2008-06-10 21:49:56.459:/Grails103:INFO:  Initializing Spring root WebApplicationContext
[0] spring.GrailsWebApplicationContext Refreshing org.codehaus.groovy.grails.commons.spring.GrailsWe
bApplicationContext@1364ee5: display name [org.codehaus.groovy.grails.commons.spring.GrailsWebApplic
ationContext@1364ee5]; startup date [Tue Jun 10 21:49:59 CST 2008]; parent: org.springframework.web.
context.support.XmlWebApplicationContext@177ab84
[0] spring.GrailsWebApplicationContext Bean factory for application context [org.codehaus.groovy.gra
ils.commons.spring.GrailsWebApplicationContext@1364ee5]: org.springframework.beans.factory.support.D
efaultListableBeanFactory@b0c5a
2008-06-10 21:50:03.050:/Grails103:INFO:  Initializing Spring FrameworkServlet 'grails'
2008-06-10 21:50:03.126::INFO:  Started SelectChannelConnector@0.0.0.0:8080
Server running. Browse to http://localhost:8080/Grails103
2008-06-10 21:50:10.296:/Grails103:INFO:  GSP servlet initialized
[Fatal Error] :-1:-1: Premature end of file.


Graeme Rocher added a comment - 10/Jun/08 08:55 AM

Yes its related to usage of firefox 3, we will fix it soon, the error doesn't occur in other browsers


Daniel.Sun added a comment - 10/Jun/08 09:01 AM

You're right, Graeme.

I tested the toy app with other browsers, no such an error occurred

Cheers,
Daniel.Sun


Mase Warner added a comment - 18/Jun/08 12:58 PM

After FF3 Day this is now a big problem for me


Graeme Rocher added a comment - 18/Jun/08 01:11 PM

Mase - a workaround is to remove "xml" from the list of mime types:

grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
xml: ['text/xml', 'application/xml'], <--- REMOVE THIS LINE
...


Mase Warner added a comment - 19/Jun/08 10:02 AM

Thanks Graeme, seems to fix the problem for now.


Mase Warner added a comment - 19/Jun/08 11:32 AM

One more issue is that when you comment out the xml line workaround - you then break IE6 so it no longer works.


Graeme Rocher added a comment - 19/Jun/08 02:42 PM

No longer works in what way? It should have no effect


Tomas Lin added a comment - 23/Jun/08 10:22 PM

Please note that the withFormat tag will always render an xml file, rather than the HTML file, even when the XML line is removed. We have to set the format=html or add the .html extension to see our GSP pages

Firefox sends a header as

text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8

My hunch is that the parsing of this request header is being processed as

text/html - 0
application/xhtml+xml - 0
application/xml - 0.9

which automatically gives xml precedence over any other defined types.


Steve Tekell added a comment - 23/Jul/08 04:25 PM

not just Firefox 3

I get this with Firefox/2.0.0.14 (Linux)
Not on every page, but when displaying XML.

I am using
withFormat { xml { render(contentType:"text/xml"){ ... } } }


Hank Gay added a comment - 06/Aug/08 04:38 AM

This error also appears with Opera 9.5 on every page I've tested.


Graeme Rocher added a comment - 21/Aug/08 05:28 AM

Fixed


Graeme Rocher made changes - 21/Aug/08 05:28 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Graeme Rocher added a comment - 21/Aug/08 05:30 AM

Just a few implementation notes. We were defaulting to a q value of 0, which is incorrect according to the spec. So we now default to 1.0 which gives the correct precedence order in Firefox 3, but incorrect in Firefox 2. However, more specific XML types like application/xhtml+xml now take precendence over less specific ones if they have the same q value so this fixes the issue in Firefox 2.

If others have problems in different browsers please open separate issues.