You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Venkata Chengalvala <ch...@gmail.com> on 2004/07/14 04:46:18 UTC

Does ANT introduce ^M characters in the classpath during the build for an ear

I am using ANT1.5.1 to build an EAR file in solaris 8.
 But somehow during the building of the ear file ANT is adding control
characters ^M to the classpath in the MANIFEST.MF under
xxx.ear/META-INF directory. The classpath is getting broken as a
single line long classpath is getting broken into multiple lines
during the build.

Please advise if it is a known bug , if so what is the solution to resolve.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Does ANT introduce ^M characters in the classpath during the build for an ear

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
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.


Cheers
Conor




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Re: Does ANT introduce ^M characters in the classpath during the build for an ear

Posted by Venkata Chengalvala <ch...@gmail.com>.
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.
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.

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.

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.

--Regards
Venkata Chengalvala




On Thu, 15 Jul 2004 10:58:08 +1000, Conor MacNeill
<co...@cortexebusiness.com.au> wrote:
> Venkata Chengalvala wrote:
> > Conor,
> > Thanks for the message. It's a lot helpful. Even after following the
> > undermentioned sugggestion I observed that ANT adds a ^M character
> > even in UNIX environment. I could see this only after vi the
> > MANIFEST.MF file
> >
> 
> Yes, Ant does add ^M characters. It is allowed for by the spec so should
> not be a problem. What is the actual problem you are having? I don't
> think the manifest is the source.
> 
> 
> 
> Conor
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Does ANT introduce ^M characters in the classpath during the build for an ear

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Venkata Chengalvala wrote:
> Conor,
> Thanks for the message. It's a lot helpful. Even after following the
> undermentioned sugggestion I observed that ANT adds a ^M character
> even in UNIX environment. I could see this only after vi the
> MANIFEST.MF file
> 

Yes, Ant does add ^M characters. It is allowed for by the spec so should 
not be a problem. What is the actual problem you are having? I don't 
think the manifest is the source.

Conor


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Re: Does ANT introduce ^M characters in the classpath during the build for an ear

Posted by Venkata Chengalvala <ch...@gmail.com>.
Conor,
Thanks for the message. It's a lot helpful. Even after following the
undermentioned sugggestion I observed that ANT adds a ^M character
even in UNIX environment. I could see this only after vi the
MANIFEST.MF file

On Wed, 14 Jul 2004 14:47:08 +1000, Conor MacNeill
<co...@cortexebusiness.com.au> wrote:
> 
> 
> 
> 
> Venkata Chengalvala wrote:
> 
> > I am using ANT1.5.1 to build an EAR file in solaris 8.
> >  But somehow during the building of the ear file ANT is adding control
> > characters ^M to the classpath in the MANIFEST.MF under
> > xxx.ear/META-INF directory. The classpath is getting broken as a
> > single line long classpath is getting broken into multiple lines
> > during the build.
> >
> > Please advise if it is a known bug , if so what is the solution to resolve.
> >
> 
> This is as per the Jar specification:
> 
> http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Notes%20on%20Manifest%20and%20Signature%20Files
> 
> "No line may be longer than 72 bytes (not characters), in its
> UTF8-encoded form. If a value would make the initial line longer than
> this, it should be continued on extra lines (each starting with a single
> SPACE)."
> 
> Is this causing you a problem? If so, it may be a problem with whatever
> is using the jar.
> 
> Conor
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Does ANT introduce ^M characters in the classpath during the build for an ear

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.

Venkata Chengalvala wrote:

> I am using ANT1.5.1 to build an EAR file in solaris 8.
>  But somehow during the building of the ear file ANT is adding control
> characters ^M to the classpath in the MANIFEST.MF under
> xxx.ear/META-INF directory. The classpath is getting broken as a
> single line long classpath is getting broken into multiple lines
> during the build.
> 
> Please advise if it is a known bug , if so what is the solution to resolve.
> 

This is as per the Jar specification:

http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Notes%20on%20Manifest%20and%20Signature%20Files

"No line may be longer than 72 bytes (not characters), in its 
UTF8-encoded form. If a value would make the initial line longer than 
this, it should be continued on extra lines (each starting with a single 
SPACE)."

Is this causing you a problem? If so, it may be a problem with whatever 
is using the jar.

Conor



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org