aspose file tools*
The moose likes Java in General and the fly likes manifest issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "manifest issue" Watch "manifest issue" New topic
Author

manifest issue

Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Hi pals,

I'm trying to put some needed lib in the classpath in the manifest jar file like this :
Class-Path: name1.jar name2.jar name3.jar...etc these jars are outside the main jar.

then this error occurs :

any recommendations ?


Thanks,
Sherif
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42635
    
  65
Post the complete manifest file.


Ping & DNS - my free Android networking tools app
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

here it is :

[RP] I removed the following libraries from the Class-Path line to make sure the layout isn't messed up too much:
C:\Documents and Settings\559941\Desktop\ncbv2\lib\poi-scratchpad-3.1-FINAL-20080629.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\msutil.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\poi-3.1-FINAL-20080629.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\msbase.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\junit-3.8.1.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\poi-contrib-3.1-FINAL-20080629.jar
C:\Documents and Settings\559941\Desktop\ncbv2\lib\mssqlserver.jar

All in all, including trailing spaces, the line contained 687 characters.[/RP]
[ August 13, 2008: Message edited by: Rob Prime ]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

The Class-Path line is much too long. Lines should not contain more than 70 characters (at least that's how long my Apache Ant makes them).
For instance, this is a line from one of my (automatically generated) manifest files:

It cuts the line of at exactly 70 characters, and continues on the next line with an indentation of 1 space.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Ohh , i got it ok i will cut them then check
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42635
    
  65
Paths that contain spaces will not work, since space characters are seen as delimiters. Also, don't use absolute paths; make them relative to the jar file that contains the manifest.
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Originally posted by Rob Prime:
The Class-Path line is much too long. Lines should not contain more than 70 characters (at least that's how long my Apache Ant makes them).
For instance, this is a line from one of my (automatically generated) manifest files:

It cuts the line of at exactly 70 characters, and continues on the next line with an indentation of 1 space.



i cut them but still this error occurs :



here is the new manifest :


Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

1) There's no leading space in all the wrapped lines
2) You must break after exactly 70 characters. Otherwise the next line is not going to be treated as a continuation from the previous
3) Read Ulf's comments
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Originally posted by Rob Prime:
1) There's no leading space in all the wrapped lines
2) You must break after exactly 70 characters. Otherwise the next line is not going to be treated as a continuation from the previous
3) Read Ulf's comments

Thanks for your reply i found a link on internet will take away this headache in future here it is Sealing your jar
i will try it and see the results
Arwinder Gill
Greenhorn

Joined: Oct 28, 2011
Posts: 1
Hi Ulf/Rob,

Thanks a lot for the info on the manifest classpath structure. Was driving me mental! But did exactly what you said and it worked like a charm!

Thanks once again

Arwinder
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

You're welcome, and welcome to the Ranch!
Arya Bima Setyantoro
Greenhorn

Joined: Dec 05, 2011
Posts: 2
dear all,

how exactly i cut the lines in my manifest? starts after the class-path or from the very first character?

example :
Manifest-Version: 1.0 Class-Path: lib2/acegi-security-1.0.7.jar lib2/b
ackport-util-concurrent.jar lib2/commons-codec.jar lib2/commons-dbcp.j
ar lib2/commons-logging-1.1.jar lib2/commons-pool-1.4.jar lib2/ehcache
-1.5.0.jar lib2/ibatis-2.3.4.726.jar lib2/log4j-1.3alpha-8.jar lib2/my
sql-connector-java-5.1.6-bin.jar lib2/persistence.jar lib2/spring.jar
lib2/spring-aop.jar lib2/spring-beans.jar lib2/spring-context.jar lib2
/spring-context-support.jar lib2/spring-core.jar lib2/spring-jdbc.jar
lib2/spring-orm.jar lib2/spring-test.jar lib2/spring-tx.jar lib2/topli
nk-essentials.jar Main-Class: com.ale.bravo.pmr.Bootstrap Created-By:
1.6.0_25 (Sun Microsystems Inc.)

well, i'd try cutting 70 chars with both technique, but the output is "invalid or corrupt manifest"
could you give me some examples?

thanks,

Arya Bima Setyantoro
Greenhorn

Joined: Dec 05, 2011
Posts: 2
why isn't it working?



the output is "invalid header"?
Bartholomew Mancuso
Greenhorn

Joined: Jan 07, 2012
Posts: 1
It must be exactly 70 character each line, with a leading space for every line different from that with "Class-path:". And don't forget a new line at the end of everything!

This works for me in a Spring application:


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39869
    
  28
Welcome to the Ranch Bartholomew Mancuso
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: manifest issue