ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: Does ANT introduce ^M characters in the classpath during the build for an ear
Date Thu, 15 Jul 2004 02:40:28 GMT
Venkata Chengalvala wrote:

> I am trying to add some external jar files to the MANIFEST.MF to build
> an ear file xxx.ear. All the required jar files have been added under
> xxx.ear and also to the MANIFEST.MF under xxx.ear/META-INF directory.
> 1.
> Initially we have added the classpath with more than 72 characters
> which was causing most of the jar files to get unrecognized.

That should not happen unless your app server is very broken. Adding 
lines longer that 72 characters does not cause problems. The manifest 
task will split these up according to the spec and whatever uses the jar 
   will recognize this and put the classpath back together appropriately.

> 2.
> Thanks to your suggestion, we have corrected the problem in the
> MANIFEST. Now there are some of the jar files in the MANIFEST.MF (dbcp
> related jars, log4j.jars) and the actual jar file under xxx.ear.
> 3.
> There were no errors during the ANT build and ear file deployment went
> well. But when the client tries to invoke the methods present in the
> EJB , we are getting log4j related errors and dbcp related errors as
> these jars are not getting recognized though present in the
> MANIFEST.MF and the actual files under xxx.ear.

Well if you really suspect the manifest, create the jar file manually 
with the jar command and see what happens.

> As an alternative I am thinking of adding the jar files that are not
> getting into classpath through MANIFEST.MF, to JVM classpath for the
> WebSphere or as external libraries as they are common utilities for
> all the WebSphere JVM's.

No idea about Websphere classpath handling - sorry.

> Please let me know of your suggestions. 
> I agree with you that the J2EE spec may not restrict  ^M characters ,
> but for one working in UNIX environment it is something which is not
> prefered. Also ANT is trimming the leading white spaces that we added
> before each new line in the classpath in the MANIFEST.MF , and I
> amsure it needs to be improved.

Since the CR characters do not affect the usage of the manifest inside 
jars, there is no problem to have them. Having them allows us to 
produces a consistent jar whether the build is performed on a Unix 
system or a Windows system. i.e. the result is not platform dependent.

Leading white space is significant in jar files as it indicates a 
continuation line. Ant manages continuation lines as appropriate so it 
is possible that it will remove leading whitespace. Again, I believe 
this is the correct thing to do.

As I said, if you suspect the Ant manifest handling is at fault, 
generate the jar manually and test it. I suspect that you will find that 
the jar command performs similar transformations on your manifest, and 
that you will still have classpath issues. At least this way you can 
eliminate the manifest as an issue.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message