File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

manifest issue

 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the complete manifest file.
 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh , i got it ok i will cut them then check
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome, and welcome to the Ranch!
 
Arya Bima Setyantoro
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why isn't it working?



the output is "invalid header"?
 
Bartholomew Mancuso
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Bartholomew Mancuso
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic