Jar file META-INF content
Hi,
How can I specify what are the files will reside inside the META-INF folder while creating a jar file? What are command line options to be passed for jar utility in this regard.
Thanks in advance,
If you want stuff other than the manifest in there, just include it like any other file path. Create a META-INF directory in the tree you are going to jar.
Similar Messages
-
Hi Guys!
I am having the following problem with my webdynpro java application on CE 7.1:
In one of my dc's i am calling another dc which is an ejb. The called ejb calls a webservice.
(my dc --> ejb --> webservice)
My dc has nothing to do with the webservice. It just calls an ejb which calls a webservice.
Although I am getting a deploymentexception when I try to deploy my dc:
Caused by: java.io.FileNotFoundException: JAR entry META-INF/wsdl/....*.wsdl not found in /usr/sap/..../..wscl.war
I have no idea where I should put the wsdl file ...
Hope anyone can help me.
Cheers,
AndiSir
If I am not wrong you itself had mentioned that : My dc has nothing to do with the webservice. It just calls an ejb which calls a webservice.
Now I wanted to know about your workaround also request you to go at metadata file of your DC and chck that whether it contain the reference of the EJB or Webservice.
One more point : exception is FileNotFoundException so might you have manually put the reference of WSDL url/uri inside EJB xml file ??
Best Regards
Satish Kumar
Edited by: satish jhariya on Mar 24, 2010 2:20 PM -
Java.io.IOException: cannot verify signature block file META-INF/MYKEY
Hello,
i have a serios problem in my company.
I developed javaws aplication running since years and now we have starting problems with actual java, it brings security warnings. This warning says this application will be blocked in further releases.
The app is signed with an old java 6 jarsigner. If I sign the jar files of the app with java 7 u45 or u40, I receive the following exception by webstart :
java.io.IOException: cannot verify signature block file META-INF/MYKEY
at com.sun.deploy.cache.CacheEntry$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
do somebody have an idea what I could try to do to solve this problem?
I create the keystore on the follwoing way: C:\Programme\Java\jdk1.7.0_45\bin>keytool -genkey -keyalg RSA -alias MYKEY -keystore fspKeys -storepass xxxxxxxxI have JRE 1.5.0_14 in the client machine.
Once this exception comes, no matter how many times I tried to relaunch the application same exception (cannot verify signature block is shown. Once i restart the server, its working fine.
Regarding jardiff, Yes. we use it.
Also, this exception is not shown on every machine which are trying to download same update. Only on few..
Any idea regarding this, please share it.
Chakri
Edited by: chakriv on Mar 22, 2010 9:02 PM -
Unable to find/read file META-INF/ra.xml
When using the oc4j_admin_client to deploy an ear to a oas cluster I get this error, but only sometimes. I cannot find anything on the web that explains what might be causing this to occur. I'm guessing it might be with the configuration of OAS but even so I have no idea where to look. If anyone out there can give some advice it would help. Thanks,
[Summary] There are total 1 instances in the operation.
[Summary] Operation failed on applicationServerName/instanceName
[Summary] Operation on cluster FAILED since 1 instanced failed!
FINE: CoreRemoteMBeanServer.release call release on CoreRemoteMBeanServer: oracle.oc4j.admin.management.mejb.MEjb@5c1ae90c
FINE: CoreRemoteMBeanServer.release Call remove on MBeanServer EJB
FINE: CoreRemoteMBeanServer.release Call close on RMI Context: javax.naming.InitialContext@1629ce8c
SEVERE: J2EEDeploymentManager.deploy Deploy error: Operation failed with error:
Unable to find/read file META-INF/ra.xml in D:\oracle\u01\oas\10.1.3\j2ee\instanceName\connectors\AppName\AppName archive (IO Error: D:\oracle\u01\oas\10.1.3\j2ee\instanceName\connectors\AppName\AppName (The system cannot find the pat
h specified))
oracle.oc4j.admin.deploy.api.J2EEDeploymentException: Operation failed with error:Hi forum-hog,
I think this is due to a known product defect. The patch is available and can be downloaded and installed.
Please try the following:
1) Download and apply patch 9073284
2) Perform the deployment again
Hope this helps.
Thanks,
Cris -
JspParseException: TLD file under JAR's META-INF not found
I have succesully deployed an external generated WAR file using the Developer Studio 'Deploy View'. However, I get an exception at runtime:
com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [http://www.some.url/some/location].
This URI is defined in a TLD file which is embeded in the META-INF of a JAR which is located in WEB-INF/lib of the WAR file.
This same exact WAR file deploys fine in Tomcat.
Could this be a bug in the J2EE Preview? Any workarounds here?
EnriqueHello everybody
I,ve the same problem when I try to deploy a jsf application that uses Esri tags.
The war work fine In a Tomcat but when I deploy the application in the WAS 5 I get the error Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [http://www.esri.com/adf/web].
I think there aren't problems with the TLD because the proyect runs fine in other environment. It seems like the WAS wasn't able to connect with the URI.
Do you know any solution ?
Thank in advance.
Fernando -
Reading META-INF contents from an annotation processor
Hello,
I'm trying to read the contents of META-INF with my annotation processor, something akin to:
@Override
public boolean process(
Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
try {
FileObject resource = processingEnv.getFiler().getResource(
StandardLocation.SOURCE_PATH, "META-INF.services", "javax.annotation.processing.Processor");
String filecontents = new Scanner(resource.openInputStream()).useDelimiter("\\A").next();
processingEnv.getMessager().printMessage(Kind.NOTE, filecontents);
} catch (IOException ex) {
processingEnv.getMessager().printMessage(Kind.ERROR, ex.toString());
return true;
(But against something that is relevant for my processor.) But when I do that I get:
error: javax.annotation.processing.FilerException: Illegal name META-INF.services
Bug, or shouldn't annotation processors be reading the contents of META-INF anyhow?
Thanks,
Thor MichaelMETA-INF/services
-
How do I reference a javascript file in a jar file
Hi all,
I'm trying to reference a javascript file, which is contained in a jar file, from my html page.
So far I have had no success :
I saw a reference to the SCRIPT tag attribute ARCHIVE.
Does this work for Internet Explorer 5?
I tried using <SCRIPT ARCHIVE="path_to_jar"
SRC="javascript.js"/>
but this didn't work.
Does anyone have any suggestions?
Thanks for any help you can give,
PaulHere is an example with an applet tag (this applet doesn't require a Java plugin):
HTML file
========
<script src="Dialog.js" archive="Dialog.jar"></script>
<APPLET CODE = "myDialog.class" CODEBASE = "." ARCHIVE = "Dialog.jar" WIDTH = 280 HEIGHT = 80 NAME = "DIA" MAYSCRIPT = true>
</APPLET>
Contents of Dialog.jar file
====================
META-INF/
META-INF/MANIFEST.MF
dialog.class
matrix$1.class
matrix.class
myCanvas.class
myDialog.class
myPanel.class
PicButton.class
resource.class
ToolTip$MAdapter.class
ToolTip.class
Dialog.js
This combination works for me on NN4+ and IE5_.
V.V. -
How to use ClassPath defined in META-INF/MANIFEST.MF in an EAR
Hi,
We have an EAR Shared Library (Name = AA) deployed in Weblogic. EAR contents are like ->
APP-INF/lib/directoryA/<<50 JAR Files>>
META-INF/MANIFEST.MF --->> Has Class Path to above JAR files, Spec Version, Impl Version etc
META-INF/application.xml
META-INF/weblogic.application.xml
This EAR is deployed as Shared Library, and our EJB (name = BB) refers to this EAR. Now the problem we are facing is that the JARs are not reachable by EJB BB. If we restructure the Shared Library project so that all the JARS are under APP-INf/lib/ directory, we are able to access the JARS from EJB BB. (This means that we are referring the shared library correctly, using "library-ref" tag correctly.
Is there a way we can specify EJB BB to look for CLASS PATH as present in the MANIFEST.MF file of the Shared Library ??
Thanks,WebLogic specifies a separate classloader for the APP-INF/lib directory that is why it gets loaded
When you have some.jar file placed in an arbitrary directory, for example, somewhere. You can either
use application.xml, for example,
<application ...>
<module>
<ejb>EJB.jar</ejb>
</module>
<module>
<web>
<web-uri>Web.war</web-uri>
<context-root>MiddlewareMagic</context-root>
</web>
</module>
<library-directory>somewhere</library-directory>
</application> Or by using the manifest Class-Path entry option which requires adding a META-INF/MANIFEST.MF file with the following contents:
Manifest-Version: 1.0
Class-Path: somewhere/some.jarMore information on class loading and application packaging can be found here: http://middlewaremagic.com/weblogic/?p=6725 -
EJB 3.0: deployment/jar file generation issue
We have a web application project (ADF Faces) which depends on a model project (EJB 3.0 session/entity beans) that implements both business and persistence layers. This EJB project points to a utility jar file containing some classes we have built. When we run the web project from inside JDev, everything works perfectly, with no error. However, when generating EAR file (deploying web project to WAR) we experience an issue.
As expected, JDev generated the war file for the web app, the jar file for the EJB and finally the EAR file containing both war and jar files. After that, we managed to deploy the ear file to our OAS 10.1.3 test instance (not standalone OC4J) and an error occured. The error is due to the fact JDev did not create the /lib subdirectory inside ejb project jar file /META-INF directory with our utility jar file inside.
We tried to generate a separated jar file for the ejb project alone with the same results.
Is this an IDE bug which does not pack the application as it should? What could we be doing wrong? If yes, is there a work-around? Like I said, the application runs fine on embedded server. Also, when the EJB application does not depend on external libraries, the deployment to OAS 10.1.3 works perfectly. We have tested it!
Could anyone help us?
Thanks in advance.
Best Regards,
Gustavo
PS: Sorry for my English. :)Hi Shay! I follow what you said and it worked. However, we had to manually edit MANIFEST file for the EJB jar in order to add classpath clause to map our util jar. IMHO, JDev should do it for us. Anyway, we were able to deploy the app successfully.
Best Regards,
Gustavo -
What is META-INF directory for ?
Hi Techies..
can any one please tell me, What is META-INF directory for ?
thanx in adv.
Regards
Nitin.VOne thing found in an 'executable' jar file META-INF directory if the manifest file:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.6.0_03-b05 (Sun Microsystems Inc.)
Main-Class: com.sdl.ArgsTest
Class-Path:
X-COMMENT: Main-Class will be added automatically by buildwhich, among other things, tells the JVM where the main class is. -
Working with tag-library which is packed in WEB-INF\lib\jar-file.jar:
Hi,
When importing a webworks war file, which contains default taglib.tld in the webworks.jar which is packed in /Web-Inf/lib/webworks.2.1.7.jar the war file.
I am getting following error while running the jsp.
Error(6): duplicated tag definitions within the same TLD: text
Error(6): java.lang.NullPointerException
Error(6): Unable to load taghandler class: /webwork
Line which points to Errors is "<%@ taglib prefix="ww" uri="/webwork" %>"
But, There is a taglib.tld in /Web-Inf/lib/webworks.2.1.7.jar!\meta-inf\tablib.tld
which mentions uri as
<taglib>
<tlib-version>2.2.1</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>WebWork Taglib</short-name>
<uri>/webwork</uri>
</taglib>
But, There is no following entry for '/webwork' (uri) in web.xml
Same war is working fine in tomcat webserver.
Can anybody explain me how to work with this kind of a setup, where taglib is packed in some jar which is packed in Web-Inf/lib dir.
Thanks,
SivaI found the problem. The web-app was finding the class in the APP-INf/lib. But the problem was being caused due to a reference to another class that was being loaded by the webapp classloader which was not visible to the class inside the common jar. The solution was to make sure both classes were being loaded by one class loader.
Thanks anyway
Sameet -
Unable to read facec-config.xml in META-INF folder of webui-jsf.jar
Hi
I was getting following error when I placed webui-jsf.jar file in websphere 6.0 server
/WEB-INF/lib/jsf-extensions-dynamic-faces-0.1.jar!/META-INF/faces-config.xml
Digester E org.apache.commons.digester.Digester error Parse Error at line 24 column 14: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
Do I need to add any other parser to read this file ?
Thanks
HimajaYour classpath is polluted with different JSF implementations/versions. Clean it up.
-
WEB-INF\lib\ Jar files
Hello
I have a war module with this:
/index.html
/pages/ (my pages)
/pages/js (my js)
/pages/images (my images)
/WEB-INF/classes/ (my servlet classes)
/WEB-INF/lib/ (my lib jar files)
/WEB-INF/web.xml (descriptor)
ok,
I run deploy tool,
open this war file (module), (ex mod1.war)
convert to ias module, modify the descriptor,
verify (everything ok)
save module
create ear (ex ap1.ear)
put this module within this ear
create and save ear descriptor
save ear
verify (everything ok)
deploy ear.
ok,
Why decompress my lib jar files in:
/APPS/ap1/mod1/WEB-INF/lib
These wil be fine if decompress the entire jars, but only extracts the class
files and no the xxxx.properties neither messages.txt; exactly
no extracts files that aren't .class. ???
Are there any workaround to this that isn't copy the files? Figure not to
have ftp acces in a sun? What we have to do?
Thanks.In iWS 6.0, the context information such as a context path of the web application and other properties are defined in web-apps.xml file.
'class-loader' element in web-apps.xml file can be be used to specify the class path to a web application and customize how the application is serviced.
Refer to example web-apps.xml file in Prog. guide to Servlets for more details.
http://docs.iplanet.com/docs/manuals/enterprise/50/servlets/war.htm#33557 -
How do I add a jar file into the build path of the compiler?
Hey,
I'm trying to import a jar file into the build path of the compilation process, but it does not find the packages or the classes that are in it.
I think I don't add it right...
ArrayList<String> options=new ArrayList<String>();
options.add("-d");
options.add(targetDirectory);
options.add("-classpath");
for(String str:includeDirectory)
options.add(str);
if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call());
....and I've tried this way:
public void setTargetDirectory(String targetDirectory) {
this.targetDirectory = "-d " + targetDirectory;
private void compile(Iterable<? extends JavaFileObject> compilationUnits) throws Exception {
ArrayList<String> options = new ArrayList<String>();
options.add(targetDirectory);
String classPath="-cp ";// tried this also with "-classpath"
for (String str : includeDirectory)
classPath+=str+":";
options.add(classPath);
if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call())
// throw new Exception("Compilation Error");
}Thanks in advance,
Adam.
Edited by: Adam-Z. on Feb 24, 2010 5:41 AM
Edited by: Adam-Z. on Feb 24, 2010 5:42 AMThank you for your reply,
Q: Are there .class files in that directory in that jar file? (the compiler doesn't ( can't )) look for directories, it can just look for specific files , and scan to get a list of all files matching certain criteria. So if there are no class files, it will say the package doesn't exist, even if there is a directory, possibly containing other files.yes there are class files in the jar, the tree structure:
j2MeDataChunkGenerator_Plugin\(lots of class files)
META-INF\manifest.mf
and thats it.
, your code will only work on windows because other platforms use a different path separator. You should use java.io.File.pathSeparator not explicit ';" when building your classpath. (this is unrelated to your problem, but you should correct it)will do, thanks.
Q: Is that error in your post formatted by your own diagnostics? (we could possibly help you better if we didn't have to guess!!)I would not post my own error code, this text is generated by the compiler diagnostic.
{code}
System.err.println(" Error details: " + diagnostic.getMessage(null));
{code}
Q: Is line 3 of ImageCroper_Editor.java (sic) an import statement? (we could possibly help you better if we didn't have to guess!!)it is an import error... didn't the error message stated that it is an import problem? wired, I'm sure before it did. anyway it is an import error.
Also you don't show us what the variable includeDirectory is in terms of type, and contents, that might be helpful. (we could possibly help you better if we didn't have to guess!!)It has only one String object: "D:\%Important Documents\WorkSpaces\PacMan\ApplicationManager\Plug-in\Data Chunk Designer.jar"
the last file on the classpath list.
Q: Have you proven this? that i did post, in this long line of text.
Q: Is the compiler finding other classes (in other packages) in that same jar file?No. all the class files are in the jar, they all have entries that start with "j2MeDataChunkGenerator_Plugin\*.class", and since I get 47 errors I guess it does not load any other class.
thank you for you comments, the problem with having these errors, is that I can't even get a piece of information where this error is coming from, only that it is an import loading error package not found, what does that mean? that the jar was not loaded in compilation(no error about this), that the jar is corrupted(no error about this), that the path is incorrect(it is correct I made sure), that there is no such package in the jar(There is), that the compiler does not load the package(does it even do that?), really I can't even guess why this happens, I've been at this on and of all day today, really annoying.
Thanks,
Adam. -
I am unable to execute jar files and applets. Also, the Java Web Start and the Java Plugin Control Panel will not load. I have unloaded the JRE and installed other versions. To date I have loaded and unloaded the following:
1.4.1
1.4.2_01, _02, _04
1.4.2_04 SDK
But no change in the outcome.
The javaw application starts but does not load the jar file.
The applets and jar files run fine on other computers with any of those JRE/SDK's installed.
Any suggestions would be helpful.Command line
To create a JAR file >jar cvf filename.jar filename.class(s)
To view the contents of a JAR file >jar tvf filename.jar
To extract the contents of a JAR file >jar xf filename.jar
To extract specific files from a JAR file >jar xf filename.jar archived-file(s)
To run an application packaged as a JAR file
>jar xvf filename.jar META-INF/MANIFEST.MF
The above will place META-INF/MANIFEST.MF file in your working directory. Open this file in text editor. Under Version, type in
Main-Class: filename
example;
Manifest-Version: 1.0
Main-Class: SelectPurchase
Created-By: 1.3.0 (Sun Microsystems Inc.)
save file
update META-INF/MANIFEST.MF file in jar file with;
jar umf META-INF/MANIFEST.MF filename.jarto run jar file from command line;
java -jar filename.jarTo run an application packaged as a JAR file
(version 1.1) jre -cp app.jar MainClass
(version 1.2 -- requires Main-Class
manifest header)
To invoke an applet packaged as a JAR file <applet code=AppletClassName.class
archive="JarFileName.jar"
width=width height=height>
</applet>
Does anyone know how to get the application to run by clicking on a Desktop Icon?
Maybe you are looking for
-
Mac mini with minidisplayport to vga adapter: display does not sleep
I have a late 2009 mac mini. When using a mini displayport-vga adapter from Apple, whenever the mini puts the display to sleep the video goes black and my monitor goes into test mode (not sleeping). It's almost like the signal to tell the display to
-
Hello All, i am running a normal report in background which is containing write statement. when i starts a job through SM36 and runs it immediately, will there be spool generation which will contain all the list output data came through WRITE stateme
-
Mass maintainenance of material master for the field MARC-NCOST,SOBSK
Hi While maintaining two fields NCOST and SOBSK for hude materials using MM17 transaction, the transaction executed properly while saving the transaction. There is no warning and error messages for all materials. But it was not updated in material ma
-
Differences between Publishing sites and publishing enabled document library
Hi what is the main differences between Publishing sites and publishing enabled document library and how to enable publishing for document library? adil
-
Does anyone know were I can get iso 4.3 for a second generation ?
Does anyone know were to get iso 4.3 for a second generation iPod ?