• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

DefaultValidationEventHandler: [FATAL_ERROR]: Premature end of file. Location: line 1 in catalina.o

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This error:
DefaultValidationEventHandler: [FATAL_ERROR]: Premature end of file.  Location: line 1
keeps reoccuring in Tomcat's catalina.out with no additional info in the log.
changed log level to ALL in ${catalina.base}/conf/logging.properties, still no additional info in the log around this.
Checked all the xml files under  ${catalina.base}/conf/, they all look good.
I tar-ed the entire direcoty under ${catalina.base} and run it on another machine, the error doesn't occur. This leads me to believe that the error is not due to parsing an actaul xml file, but is related to something specific to that machine, example: tomcat process making a call to a function which returns a xml format response, and the parsing of that response produced that error.

Does anyone have any insight on this?

Thanks a lot!
 
Saloon Keeper
Posts: 24558
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing suggests itself to me. Tomcat shouldn't be creating and reading XML on the fly itself, since it can skip the middle process and create a DOM internally as it does when it digests things like server.xml and Config files. And I'd really expect that Tomcat would have a message indicating the file name it failed to parse.

Have you looked at the other Tomcat log files, and specifically at the localhost log?

Also, a bit more detail from catalina.out would be useful. It might tell us what the operation was being invoked for.

Also, look at all of the ".xml" files in /conf/Catalina/locahlost and make sure that they all start with a <Context> element.
 
Cheng Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim, thanks for the reply.
/conf/Catalina/locahlost is empty.
I'm attaching catalina.out and localhost.log.
As I said, the strange thing about this is: we made a tar file of the entire ${CATALINA_HOME}/ directory, then untar it, and run it on another machine, the issue does not occur, which is why I suspect this is not caused by any bad file under ${CATALINA_HOME}.

Also, we will change the permission of the file below to get rid of the FileNotFoundException, but don't think that has anything to do with the FATAL_ERROR issue
29-Sep-2021 07:00:44.324 SEVERE [main] org.apache.catalina.session.StandardManager.stopInternal Exception unloading sessions to persistent storage
       java.io.FileNotFoundException: /opt/tomcat/work/Catalina/localhost/provisioningagent-web/SESSIONS.ser (Permission denied)
               at java.io.FileOutputStream.open0(Native Method)

Thanks again.
 
Cheng Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, forgot the attachment in my last reply
 
Tim Holloway
Saloon Keeper
Posts: 24558
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A primary difference between CATALINA_HOME and CATALINA_BASE is that one can be read-only and the other must be read-write for the userID that Tomcat runs under. Specifically the /work, /temp, and /logs directories must be read/write, but since Tomcat's default is to explode WAR files, I think we must include /webapps as well.

While it's common to think of the objects stored in Tomcat's session scope to be memory-only objects, in point of fact, the JEE spec requires all session-scope objects to be Serializable. This is partly to support clustering, but it also ensures that users don't lose their sessions if you restart Tomcat while they are online. Tomcat will serialize their sessions to the ".ser" files, then restore from them when it comes back up. Which is why if you encounter weird Tomcat problems, it's a good idea to stop Tomcat, and delete the entire contents of the work, temp and log directories.

And while not having access to the ".ser" file read/write mechanism shouldn't give an XML error (they're pure binary, I believe), if you can't read or write them, then what else maybe could you not read or write?
 
Cheng Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That .se is the only file from the log entries, others are accessbile. We are fixing that over the weekend (it's a production site so can only be restarted during maintenance window).
 
Cheng Lee
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The root cause of the issue was identified. It was actually caused by a mistaken heartbeat empty https request which the handler expects a xml body. Thanks for the help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic