| [news.eclipse.webtools] Re: Tomcat 6 web app is not started because of "java.io.IOException: invalid header" |
Yes, it fixed the problem. Thank you very much.
Best, Jan
Larry Isaacs wrote:
Again by inspection, Attributes appears to handle line endings of LF and CRLF, either of which should work on both Linux and Windows.
If I can assume '^M' is a CR, then your problem is likely that the MANIFEST.MF committed to CVS from Linux contained CRLFs instead of LFs. When checked out of CVS to Windows using OS dependent line endings, an extra CR is being inserted prior to the LFs, resulting in CRCRLF at the end of each line. After ignoring the trailing CRLF, the last line is failing the colon test since it contains just CR. If this is the problem, just ensure that what is in CVS contains just LFs, then any file checked out to Linux or Windows should work regardless of the use of OS dependent line endings.
Cheers, Larry
Jan Yan wrote:org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:149)Yes, this is exactly the problem. I replaced the MANIFEST.MF with the new project's. And it works at Windows. Then I checked in the new MANIFEST.MF file and tried it at Linux box. It gave me the same error "java.io.IOException: invalid header field". Do we have to have two different MANIFEST.MF files, one for Windows and one for Linux?
Also I diff these two MANIFEST.MF files. The one has problem at Windows, but works at Linux is:
Manifest-Version: 1.0^M Class-Path: ^M ^M
The one works at Windows, but doesn't work at Linux is:
Manifest-Version: 1.0^M^M Class-Path: ^M^M ^M^M
I created the project as Dynamic Web Project and didn't change the default MANIFEST.MF at all. Does it suggest that a bug in Eclipse side that a web project created at Linux is not compatible at Windows?
Anyway, thank you so much for the help.
Larry Isaacs wrote:
Inspecting source code, the "ExtensionValidator.java:149" suggests that Tomcat is attempting to read the MANIFEST.MF file in the META-INF folder of the webapp. The "invalid header field" comes from java.util.jar.Attributes when a line, continuations included, doesn't contain a colon, or the colon isn't followed by the required space. Check the "WebContentMETA-INFMANIFEST.MF" file in your checked out project and see what it contains. Creating a new project would have created a new one. I assume when you copied the source, this new MANIFEST.MF wasn't overwritten.
Cheers, Larry
Jan Yan wrote:Hello,
I have an Eclipse project which is running OK on JDK 1.5, Tomcat 6 from Eclipse 3.4 on a Linux box. The whole project is checked in to a source code repository. Then I checked this project out from a Windows box, Eclipse Europa, also using JDK 1.5, Tomcat 6. When I deployed the project and started the Tomcat server. I got the error:
SEVERE: Error in dependencyCheck java.io.IOException: invalid header field at java.util.jar.Attributes.read(Unknown Source) at java.util.jar.Manifest.read(Unknown Source) at java.util.jar.Manifest.<init>(Unknown Source) at
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4167)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Sep 2, 2008 3:50:14 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Sep 2, 2008 3:50:14 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/XXXXPOC] startup failed due to previous errors
According to the post: http://dev.eclipse.org/newslists/news.eclipse.webtools/msg11055.html, I created a new project at this Windows box, then copied all the source codes and web folder to the new project. The new project is at the same workspace as the previous error project and has the identical content. And it is running just FINE! The question is why the project I checked out directly from the repository didn't work? Also I copied the new project's settings folder to the error project. But the previous error project still didn't work. So what else is different between the error project and new project?
Please help! I would like to know whether it relates to Windows vs. Linux. Is there way to fix it so that it works at all the environments.
Thank you very much.