• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WAR files & MANIFEST.MF

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Head First Servlets & JSP 1st Edition: Page 580: There is one thing you can doploy webapp with war that you cant do when you deploy without
one is declare library dependencies in the META-INF/MANIFEST.MF.
The question here is if i deploy a webapp without war file , I can always manually create META-INF/MANIFEST.MF and specify the libraray
dependencies : Will Container ignore lib dependencies if i do so or will it throw a error?
Does container accepts lib dependencies in META-INF/MANIFEST.MF file which is created in a war file when a web app is actually jarred?
[ October 15, 2008: Message edited by: Christophe Verre ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can always manually create META-INF/MANIFEST.MF

Where do you intend to put the META-INF directory ? And tell us why you think the container will read it the place you've put it in.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Offcourse under the root of the application just like what WAR file creation would have done.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, sorry, I asked a stupid question. What the book means is that the dependencies will only be checked at deployment time.
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its alright, genius also can make mistakes

So i just want to conclude is:
If I manually create a META-INF file and declare lib dependencies under Manifest.MF , container will ignore it. Am i correct?


Its only that when a application is deployed via a war file and when the container is starting up, It will first unpack and later check the dependencies in the Manifest.MF and throw errors if it could not find.
Am I correct ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I correct ?

Mmmh.. Actually, I can't tell for sure The process is described in the servlets specification, SRV.9.7.1 Dependencies On Extensions. It seems to imply that dependencies set in a manifest file inside a WAR file will be inspected at deploy time, but it also says that dependencies will be resolved at deploy time. If we consider that rebooting the server will redeploy the applications, will the dependencies be resolved once again ?? Mmmmh... not sure.

Note that this is probably not part of the exam, and that when we talk about a MANIFEST.MF file, we talk about archives (JAR, WAR....), not a file we manually put under an application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic