meta inf是什么文件夹-INF/MANIFEST.MF does not exist 我该怎么办

HiI am having a problem with deploying a war app in Tomcat 4.
I have avery simple test application whichonly has a single jsp page[antony@fugu ereal]$ ls war/4 WEB-INF/
4 login.jspI have also created the relevant web.xml file.[antony@fugu ereal]$ ls war/WEB-INF/4 web.xmlI create the war archive by[antony@fugu ereal]$ jar cvf ereal.jar war/added manifestadding: war/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/web.xml(in = 151) (out= 102)(deflated 32%)adding: war/login.jsp(in = 878) (out= 349)(deflated 60%)[antony@fugu ereal]$and then copied it to my /var/tomcat4/webapps directory.
However, whenI start tomcat up I get the error,[snip]localhost_log..txt: 18:20:15StandardHost[localhost]: Installing web application at context path/ereal from URL jar:file:/var/tomcat4/webapps/ereal.war!/localhost_log..txt: 18:20:15 HostConfig[localhost]Error deploying web application archive ereal.warlocalhost_log..txt:java.io.FileNotFoundException:/var/tomcat4/webapps/ereal/META-INF/MANIFEST.MF (No such file or directory)at java.io.FileOutputStream.open(Native Method)at java.io.FileOutputStream.(FileOutputStream.java:134)at org.apache.catalina.core.StandardHost.expand(StandardHost.java)at org.apache.catalina.core.StandardHost.expand(StandardHost.java)at org.apache.catalina.core.StandardHost.install(StandardHost.java)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java)at org.apache.catalina.startup.HostConfig.start(HostConfig.java)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java)[snip]I have taken the ereal.jar file apart and it indeed has theMETA-INF/MANIFEST.MF in it[antony@fugu tmp]$ jar xvf ereal.jarcreated: META-INF/extracted: META-INF/MANIFEST.MFcreated: war/created: war/WEB-INF/extracted: war/WEB-INF/web.xmlextracted: war/login.jsp[antony@fugu tmp]$What is going on?
How can I deploy my webapp?CheersTony--To unsubscribe:For additional commands:Troubles with the list:
Search Discussions
try renaming your file to ereal.war (and not .jar)that should doDavid----- Original Message -----From: &antony@claire.co.jp&To: &tomcat-user@jakarta.apache.org&Sent: Wednesday, November 07,
AMSubject: Problem Deploying war file. ./META-INF/MANIFEST.MF not foundHiI am having a problem with deploying a war app in Tomcat 4.
I have avery simple test application whichonly has a single jsp page[antony@fugu ereal]$ ls war/4 WEB-INF/
4 login.jspI have also created the relevant web.xml file.[antony@fugu ereal]$ ls war/WEB-INF/4 web.xmlI create the war archive by[antony@fugu ereal]$ jar cvf ereal.jar war/added manifestadding: war/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/web.xml(in = 151) (out= 102)(deflated 32%)adding: war/login.jsp(in = 878) (out= 349)(deflated 60%)[antony@fugu ereal]$and then copied it to my /var/tomcat4/webapps directory.
However, whenI start tomcat up I get the error,[snip]localhost_log..txt: 18:20:15StandardHost[localhost]: Installing web application at context path/ereal from URL jar:file:/var/tomcat4/webapps/ereal.war!/localhost_log..txt: 18:20:15 HostConfig[localhost]Error deploying web application archive ereal.warlocalhost_log..txt:java.io.FileNotFoundException:/var/tomcat4/webapps/ereal/META-INF/MANIFEST.MF (No such file ordirectory)at java.io.FileOutputStream.open(Native Method)at java.io.FileOutputStream.&init&(FileOutputStream.java:179)at java.io.FileOutputStream.&init&(FileOutputStream.java:134)atorg.apache.catalina.core.StandardHost.expand(StandardHost.java)atorg.apache.catalina.core.StandardHost.expand(StandardHost.java)atorg.apache.catalina.core.StandardHost.install(StandardHost.java)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java)at org.apache.catalina.startup.HostConfig.start(HostConfig.java)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java)[snip]I have taken the ereal.jar file apart and it indeed has theMETA-INF/MANIFEST.MF in it[antony@fugu tmp]$ jar xvf ereal.jarcreated: META-INF/extracted: META-INF/MANIFEST.MFcreated: war/created: war/WEB-INF/extracted: war/WEB-INF/web.xmlextracted: war/login.jsp[antony@fugu tmp]$What is going on?
How can I deploy my webapp?CheersTony--To unsubscribe:
For additional commands:
Troubles with the list:--To unsubscribe:For additional commands:Troubles with the list:
Thanks for the reply.
I renamed it and I still get the same error.
Anyideas anyone?CheersTonyDavid Rault wrote:try renaming your file to ereal.war (and not .jar)that should doDavid----- Original Message -----From: &antony@claire.co.jp&To: &tomcat-user@jakarta.apache.org&Sent: Wednesday, November 07,
AMSubject: Problem Deploying war file. ./META-INF/MANIFEST.MF not foundHiI am having a problem with deploying a war app in Tomcat 4.
I have avery simple test application whichonly has a single jsp page[antony@fugu ereal]$ ls war/4 WEB-INF/
4 login.jspI have also created the relevant web.xml file.[antony@fugu ereal]$ ls war/WEB-INF/4 web.xmlI create the war archive by[antony@fugu ereal]$ jar cvf ereal.jar war/added manifestadding: war/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/(in = 0) (out= 0)(stored 0%)adding: war/WEB-INF/web.xml(in = 151) (out= 102)(deflated 32%)adding: war/login.jsp(in = 878) (out= 349)(deflated 60%)[antony@fugu ereal]$and then copied it to my /var/tomcat4/webapps directory.
However, whenI start tomcat up I get the error,[snip]localhost_log..txt: 18:20:15StandardHost[localhost]: Installing web application at context path/ereal from URL jar:file:/var/tomcat4/webapps/ereal.war!/localhost_log..txt: 18:20:15 HostConfig[localhost]Error deploying web application archive ereal.warlocalhost_log..txt:java.io.FileNotFoundException:/var/tomcat4/webapps/ereal/META-INF/MANIFEST.MF (No such file ordirectory)at java.io.FileOutputStream.open(Native Method)at java.io.FileOutputStream.&init&(FileOutputStream.java:179)at java.io.FileOutputStream.&init&(FileOutputStream.java:134)atorg.apache.catalina.core.StandardHost.expand(StandardHost.java)atorg.apache.catalina.core.StandardHost.expand(StandardHost.java)atorg.apache.catalina.core.StandardHost.install(StandardHost.java)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java)at org.apache.catalina.startup.HostConfig.start(HostConfig.java)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java)[snip]I have taken the ereal.jar file apart and it indeed has theMETA-INF/MANIFEST.MF in it[antony@fugu tmp]$ jar xvf ereal.jarcreated: META-INF/extracted: META-INF/MANIFEST.MFcreated: war/created: war/WEB-INF/extracted: war/WEB-INF/web.xmlextracted: war/login.jsp[antony@fugu tmp]$What is going on?
How can I deploy my webapp?CheersTony--To unsubscribe:
& For additional commands:
& Troubles with the list:
&--To unsubscribe:
For additional commands:
Troubles with the list:--To unsubscribe:For additional commands:Troubles with the list:
Related Discussions
viewthread |
categories
user style
2 users in discussion
site design / logo & 2016 GrokbaseAdding META-INF/MANIFEST.MF to JAR Files
Adding META-INF/MANIFEST.MF to JAR Files
This section provides a tutorial example on how to add manifest files to JAR files.
There are two ways to add "manifest" to a JAR file.
1. Adding "manifest" through "jar" command line. Store all your manifest attributes in a file. And specify this file
in the "jar" command line with the "m" option:
jar c[v0]mf manifest jarfile inputfiles
For example, I created my own manifest file called manifest.txt with one attribute in it:
Main-Class: Hello
Remember to press the &Enter& key at the end of the attribute. This will insert a new line character (\n)
to terminate the attribute.
Here is how I added my manifest to a JAR file with the "m" option:
C:\herong&jar cvmf manifest.txt hello.jar Hello.class
added manifest
adding: Hello.class(in = 416) (out= 285)(deflated 31%)
C:\herong&jar xvf hello.jar
created: META-INF/
extracted: META-INF/MANIFEST.MF
extracted: Hello.class
C:\herong&type META-INF\MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.8.0 (Oracle Corporation)
Main-Class: Hello
As you can see that "jar" command copied the attribute from my manifest file to the end of the auto-generated
MANIFEST.MF file.
2. Adding "manifest" through META-INF/MANIFEST.MF file. Create META-INF/MANIFEST.MF as a text file. Enter all your
manifest attributes in this file. And include META-INF/MANIFEST.MF as an input file to JAR file.
For example, I created my own META-INF/MANIFEST.MF with a text editor as:
Manifest-Version: 3.3
Created-By: Herong Yang
Main-Class: Hello
Here is how I added my manifest to a JAR file with the "M" option:
C:\herong&jar cvMf tutu.jar Hello.class META-INF
adding: Hello.class(in = 416) (out= 285)(deflated 31%)
adding: META-INF/(in = 0) (out= 0)(stored 0%)
adding: META-INF/MANIFEST.MF(in = 19) (out= 21)(deflated -10%)
C:\herong&jar tf tutu.jar
Hello.class
META-INF/MANIFEST.MF
Note that:
The "M" option stops "jar" to auto-generate the META-INF/MANIFEST.MF file.
When MANIFEST.MF is included as an input file, it was compressed. This is different than the auto-generated
version, which was not compressed at all.
Last update: 2015.
Table of Contentsa United Nations agency to promote trade by increasing the exchange stability of the major currencies
以上来源于:
Next, I update the maven-jar-plugin to include the MANIFEST.MF file, as shown in Listing 4
接下来,我更新 maven-jar-plugin 代码来包含 MANIFEST.MF 文件。
The design concept of application of IC I/O module of radio frequency identification (RFID) card to the gas meter based on MF-RC500 is put forward in this paper.
提出了以MF-RC500芯片为基础的射频卡读写模块在燃气表中应用的设计思想;
I decided to investigate a mechanism in the java -jar loader that will load classes which are specified inside a special file in the archive named META-INF/MANIFEST.MF.
我决定研究 java -jar 装入器中的另外一种机制:装入的类是在档案文件中一个叫做 META-INF/MANIFEST.MF 的特殊文件中指定的。
$firstVoiceSent
- 来自原声例句
请问您想要如何调整此模块?
感谢您的反馈,我们会尽快进行适当修改!
请问您想要如何调整此模块?
感谢您的反馈,我们会尽快进行适当修改!osgi - maven-bundle plugin and pax-exam: MANIFEST.MF does not exist - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Following Situation: I am developing an OSGi Application using maven and maven-bundle-plugin. I want to run Unit Tests and discovered Pax-Exam and i find it quit suitable.
Here is my parent pom.xml
&project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&
&modelVersion&4.0.0&/modelVersion&
&groupId&de.hswt.oms&/groupId&
&artifactId&workspace-parent&/artifactId&
&version&0.0.1-SNAPSHOT&/version&
&packaging&pom&/packaging&
&properties&
&project.build.sourceEncoding&UTF-8&/project.build.sourceEncoding&
&/properties&
&repositories&
&repository&
&id&com.springsource.repository.bundles.release&/id&
&name&SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases&/name&
&url&/maven/bundles/release&/url&
&/repository&
&repository&
&id&com.springsource.repository.bundles.external&/id&
&name&SpringSource Enterprise Bundle Repository - External Bundle Releases&/name&
&url&/maven/bundles/external&/url&
&/repository&
&/repositories&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-jar-plugin&/artifactId&
&version&2.4&/version&
&configuration&
&manifestFile&${project.build.outputDirectory}/META-INF/MANIFEST.MF&/manifestFile&
&manifestEntries&
&Built-By&Tobias Placht&/Built-By&
&Bundle-ActivationPolicy&lazy&/Bundle-ActivationPolicy&
&/manifestEntries&
&/archive&
&/configuration&
&groupId&org.apache.felix&/groupId&
&artifactId&maven-bundle-plugin&/artifactId&
&version&2.3.7&/version&
&configuration&
&instructions&
&Export-Package&{local-packages};version="${project.version}"&/Export-Package&
&Import-Package&*&/Import-Package&
&Private-Package&{local-packages}&/Private-Package&
&Service-Component&*&/Service-Component&
&/instructions&
&/configuration&
&executions&
&execution&
&id&bundle-manifest&/id&
&phase&process-classes&/phase&
&goal&manifest&/goal&
&/execution&
&/executions&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-compiler-plugin&/artifactId&
&version&2.5.1&/version&
&configuration&
&source&1.7&/source&
&target&1.7&/target&
&/configuration&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-surefire-plugin&/artifactId&
&version&2.12.4&/version&
&dependencies&
&dependency&
&groupId&org.apache.maven.surefire&/groupId&
&artifactId&surefire-junit47&/artifactId&
&version&2.12.4&/version&
&/dependency&
&/dependencies&
&groupId&org.ops4j&/groupId&
&artifactId&maven-pax-plugin&/artifactId&
&version&1.5&/version&
&configuration&
&provision&
&param&--profiles=ds&/param&
&param&--platform=equinox&/param&
&param&mvn:de.hswt.oms/workspace-datastructure-core/0.0.1-SNAPSHOT@2&/param&
&param&mvn:de.hswt.oms/workspace-command-core/0.0.1-SNAPSHOT@2&/param&
&param&mvn:de.hswt.oms/workspace-facade/0.0.1-SNAPSHOT@6&/param&
&/provision&
&/configuration&
&/plugins&
&dependencies&
&dependency&
&groupId&org.apache.felix&/groupId&
&artifactId&org.osgi.core&/artifactId&
&version&1.4.0&/version&
&/dependency&
&dependency&
&groupId&org.slf4j&/groupId&
&artifactId&slf4j-api&/artifactId&
&version&1.6.6&/version&
&/dependency&
&dependency&
&groupId&ch.qos.logback&/groupId&
&artifactId&logback-core&/artifactId&
&version&1.0.7&/version&
&/dependency&
&dependency&
&groupId&ch.qos.logback&/groupId&
&artifactId&logback-classic&/artifactId&
&version&1.0.7&/version&
&/dependency&
&dependency&
&groupId&org.junit&/groupId&
&artifactId&com.springsource.org.junit&/artifactId&
&version&4.11.0&/version&
&scope&test&/scope&
&/dependency&
&/dependencies&
&module&workspace-datastructure-core&/module&
&module&workspace-command-core&/module&
&module&workspace-log-config&/module&
&module&workspace-wsr-create&/module&
&module&workspace-datastructure-local&/module&
&module&workspace-localfile-create&/module&
&module&workspace-localfolder-create&/module&
&module&workspace-facade&/module&
&module&workspace-osgiframework-tests&/module&
&/modules&
I have created the module workspace-osgiframework-tests which contains a Simple Test case:
import static org.ops4j.pax.exam.CoreOptions.*;
import org.junit.T
import org.junit.runner.RunW
import org.ops4j.pax.exam.O
import org.ops4j.pax.exam.junit.C
import org.ops4j.pax.exam.junit.ExamReactorS
import org.ops4j.pax.exam.junit.JUnit4TestR
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorF
import org.osgi.framework.B
import org.osgi.framework.BundleC
import javax.inject.I
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class SampleTest {
BundleContext bu =
@Configuration
public Option[] config() {
return options(junitBundles());
public void getHelloService() {
for (Bundle b : bu.getBundles()) {
System.out.println("Bundle " + b.getBundleId() + " : "
+ b.getSymbolicName());
and the corresponding pom.xml
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&
&modelVersion&4.0.0&/modelVersion&
&artifactId&workspace-osgiframework-tests&/artifactId&
&properties&
&exam.version&2.5.0&/exam.version&
&url.version&1.4.0&/url.version&
&/properties&
&groupId&de.hswt.oms&/groupId&
&artifactId&workspace-parent&/artifactId&
&version&0.0.1-SNAPSHOT&/version&
&relativePath&..&/relativePath&
&!-- skip plugin execution explicitly --&
&groupId&org.apache.felix&/groupId&
&artifactId&maven-bundle-plugin&/artifactId&
&extensions&true&/extensions&
&configuration&
&skip&true&/skip&
&/configuration&
&executions&
&execution&
&id&bundle-manifest&/id&
&phase&none&/phase&
&/execution&
&/executions&
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-compiler-plugin&/artifactId&
&version&2.5.1&/version&
&configuration&
&source&1.6&/source&
&target&1.6&/target&
&/configuration&
&/plugins&
&dependencies&
&dependency&
&groupId&org.ops4j.pax.exam&/groupId&
&artifactId&pax-exam-container-forked&/artifactId&
&version&${exam.version}&/version&
&scope&test&/scope&
&/dependency&
&dependency&
&groupId&org.ops4j.pax.exam&/groupId&
&artifactId&pax-exam-junit4&/artifactId&
&version&${exam.version}&/version&
&scope&test&/scope&
&/dependency&
&dependency&
&groupId&org.ops4j.pax.exam&/groupId&
&artifactId&pax-exam-link-mvn&/artifactId&
&version&${exam.version}&/version&
&scope&test&/scope&
&/dependency&
&dependency&
&groupId&org.ops4j.pax.url&/groupId&
&artifactId&pax-url-aether&/artifactId&
&version&${url.version}&/version&
&scope&test&/scope&
&/dependency&
&dependency&
&groupId&org.apache.felix&/groupId&
&artifactId&org.apache.felix.framework&/artifactId&
&version&4.0.2&/version&
&scope&test&/scope&
&/dependency&
&/dependencies&
I i run mvn test, everything works fine, but if i run mvn install i get the following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.546s
[INFO] Finished at: Fri Dec 14 15:37:50 CET 2012
[INFO] Final Memory: 27M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar
(default-jar) on project workspace-osgiframework-tests: Error assembling JAR: Manifest file: /home/knacht/development/repositorys/git/oms/workspace-parent/workspace-osgiframework-tests/target/classes/META-INF/MANIFEST.MF does not exist. -& [Help 1]
Any idea how to get rid of it?
Also this is my first maven project so if you have any advices please tell me.
When you're new to Maven and Pax Exam, I'd recommend to stick to defaults as much as possible.
Using maven-jar-plugin and maven-bundle-plugin in parallel is likely to cause the conflict you're seeing. Change the Maven packaging of your bundle projects to "bundle" and let maven-bundle-plugin generate the manifest. There is usually no need at all to use maven-jar-plugin directly.
maven-pax-plugin is no longer supported in Pax Exam 2.x. You should use bundle() options in your @Configuration method instead.
For up-to-date examples, take a look at Pax Exam's own integration tests at .
48.3k11117207
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled3754人阅读
在运行有fat jar打包的JAR文件时控制台出现各种警告:
008-12-2 8:55:20 java.util.jar.Attributes read
警告: Duplicate name in Manifest:
SHA1-Digest.
Ensure that the manifest does not have duplicate
entries, and
that blank lines separate individual sections
in both your
manifest and in the META-INF/MANIFEST.MF
entry in the jar file.
8:55:20 java.util.jar.Attributes read
警告: Duplicate name in Manifest:
SHA1-Digest.
Ensure that the manifest does not have duplicate
entries, and
that blank lines separate individual sections
in both your
manifest and in the META-INF/MANIFEST.MF
entry in the jar file.
问题原因:
在MANIFEST.MF文件中,有多个SHA1-Digest,导致控制台报错
在用fat jar打包时,取消“merge individual-sections of all MANIFEST.MF files”选项,然后其他操作照旧,这样就可以了
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:202735次
积分:2896
积分:2896
排名:第8746名
原创:84篇
评论:84条
(1)(1)(1)(2)(1)(1)(1)(1)(1)(2)(1)(1)(1)(2)(2)(1)(3)(1)(1)(1)(1)(1)(1)(1)(3)(2)(7)(3)(2)(5)(4)(3)(4)(5)(2)(2)(2)(1)(2)(2)(1)(2)(3)

我要回帖

更多关于 maven meta inf 添加 的文章

 

随机推荐