Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Tomcat 6 web app is not started because of "java.io.IOException: invalid header"
Tomcat 6 web app is not started because of "java.io.IOException: invalid header" [message #219962] Tue, 02 September 2008 23:24 Go to next message
Jan Yan is currently offline Jan YanFriend
Messages: 7
Registered: July 2009
Junior Member
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
org.apache.catalina.util.ExtensionValidator.validateApplicat ion(ExtensionValidator.java:149)
at
org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4167)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.jav a:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443)
at
org.apache.catalina.core.StandardService.start(StandardServi ce.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:2 88)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3)
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/msg11 055.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.
Re: Tomcat 6 web app is not started because of "java.io.IOException: invalid header" [message #219994 is a reply to message #219962] Wed, 03 September 2008 14:52 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
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 "WebContent\META-INF\MANIFEST.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
> org.apache.catalina.util.ExtensionValidator.validateApplicat ion(ExtensionValidator.java:149)
>
> at
> org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4167)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
> at org.apache.catalina.core.StandardHost.start(StandardHost.jav a:719)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443)
> at
> org.apache.catalina.core.StandardService.start(StandardServi ce.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:2 88)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3)
> 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/msg11 055.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.
>
>
>
Re: Tomcat 6 web app is not started because of "java.io.IOException: invalid header" [message #220099 is a reply to message #219994] Wed, 03 September 2008 16:59 Go to previous messageGo to next message
Jan Yan is currently offline Jan YanFriend
Messages: 7
Registered: July 2009
Junior Member
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
>>
org.apache.catalina.util.ExtensionValidator.validateApplicat ion(ExtensionValidator.java:149)
>>
>> at
>> org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4167)
>> at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>> at org.apache.catalina.core.StandardHost.start(StandardHost.jav a:719)
>> at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>> at
>> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443)
>> at
>> org.apache.catalina.core.StandardService.start(StandardServi ce.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:2 88)
>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3)
>> 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/msg11 055.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.
>>
>>
>>
Re: Tomcat 6 web app is not started because of "java.io.IOException: invalid header" [message #220115 is a reply to message #220099] Wed, 03 September 2008 18:30 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
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:
> 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
> org.apache.catalina.util.ExtensionValidator.validateApplicat ion(ExtensionValidator.java:149)
>
>>>
>>> at
>>> org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4167)
>>>
>>> at
>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>>> at
>>> org.apache.catalina.core.StandardHost.start(StandardHost.jav a:719)
>>> at
>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>>> at
>>> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443)
>>> at
>>> org.apache.catalina.core.StandardService.start(StandardServi ce.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:2 88)
>>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3)
>>> 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/msg11 055.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.
>>>
>>>
>>>
>
>
Re: Tomcat 6 web app is not started because of "java.io.IOException: invalid header" [message #220133 is a reply to message #220115] Wed, 03 September 2008 22:47 Go to previous message
Jan Yan is currently offline Jan YanFriend
Messages: 7
Registered: July 2009
Junior Member
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:
>> 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
>>
org.apache.catalina.util.ExtensionValidator.validateApplicat ion(ExtensionValidator.java:149)
>>
>>>>
>>>> at
>>>> org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4167)
>>>>
>>>> at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>>>> at
>>>> org.apache.catalina.core.StandardHost.start(StandardHost.jav a:719)
>>>> at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045)
>>>> at
>>>> org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443)
>>>> at
>>>> org.apache.catalina.core.StandardService.start(StandardServi ce.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:2 88)
>>>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3)
>>>> 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/msg11 055.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.
>>>>
>>>>
>>>>
>>
>>
Previous Topic:Hot Code Replace
Next Topic:How do I change "WebContent" folder in web project?
Goto Forum:
  


Current Time: Thu Nov 27 22:12:07 GMT 2014

Powered by FUDForum. Page generated in 0.01881 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software