Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts config works on windows, not on Unix

 
M Conlin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my windows machines things run fine.

Recently out of the blue, when I move the .war to my unix environment and expand it the following happens.

After the InitServlet completes successfully I get these errors:
SEVERE: Parse Fatal Error at line -1 column -1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file

AND

SEVERE: Error deploying configuration descriptor eoms.xml
org.xml.sax.SAXParseException: Premature end of file


Any ideas?


Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is undoubtedly due to the difference in newLine characters between Windows and UNIX. Here is a link that explains it. The best solution is to find a windows text editor that will save a file for UNIX use. There are several free ones. Then Save your struts-config.xml file for UNIX before including it in your war file.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting...my project develops in Windows but it deployed on Solaris. I just checked our struts-config.xml file and it is "DOS" formatted (with cr+lf). That version seems to work just fine on Solaris (Oracle Application Server).

- Brent
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know, Brent, it's an odd problem. The Application Server I use (WebSphere) tolerates the different linefeed characters just fine on either Windows or UNIX, but not all Application Servers do. It's usually a pretty good bet, though, that if an XML file parses fine on windows and doesn't parse on UNIX, the Linefeed character is to blame.
 
M Conlin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally found the issue:

while testing build/install scripts the tomcat server had been started under root.

When I logged in as my tomcat user and attempted to restart the server it could not properly shutdown/restart. The error messages did NOT indicate that a resource was in use by someone else, it simply acted like it could not read xml and deploy the project correctly.

su over to root and shutdown the server fixed the issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic