Change manifest file in existing EAR file with ANT task

Hi,
I use ant task (ojdeploy) to create EAR files from ADF application.
Now I want to add the application version number to MANIFEST.MF.
Is it possible to do the manifest file modification IN THE EXISTING EAR FILE (or while creating the EAR file with ojdeploy) with ant task or do I have to do the modification in the source MANIFEST.MF and after this create EAR file with ojdeploy?
BTW: I tried the <ear> task to create the EAR file instead of using ojdeploy but I was not able to find the needed deployment descriptor (appxml="application.xml") in my ADF appication.
regards
Peter

Hi Peter,
I don't know of a way to do it directly in ANT/ojdeploy. However, you could try exploding the EAR, updating the manifest, and recreating the EAR - cumbersome and slow, but it should work.
John

Similar Messages

  • Import Existing EAR file into JSE  8

    Hi
    Can anyone tell me how I can import an existing EAR file (generated outside of SJSE) into sun Java Studio Enterprise 8 using it to creating a project so I can use JSE8 as my development tool? The EAR file has been exported including the source code.
    Thanks
    John.

    There is create new �Enterprise Application with Existing Source� option in
    File -> New Project -> Enterprise wizard.
    This �imports an existing enterprise application into a standard IDE project.
    The enterprise application must conform
    to the J2EE BluePrints Project Conventions for Enterprise Applications
    (see http://java.sun.com/blueprints/code/projectconventions.html).
    This wizard also imports components that are nested in the enterprise application.
    Standard projects use an IDE-generated Ant build script to build and run your project.�

  • Can I specify classpath in MANIFEST.MF of a ear file?

    Hi,
    I know that one can specify classpath in MANIFEST.MF of a jar file, I'd like to know whether I can specify classpath in MANIFEST.MF of a ear file?
    If yes, will the classpath specified affect all j2ee components in this ear file?(e.g. jar files,war files)
    Thanks

    Unfortunately, yes, you'd have to edit the MANIFEST.MF
    of each module within the .ear that has a dependency on
    the bundled library. One workaround is to add the common
    code to the server's classpath. However, that approach
    doesn't work if the common code has dependencies on the
    code packaged within the ejb-jars and .wars themselves.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reading Java files from a EAR file

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    Maybe you can use java.util.zip.ZipInputStream to
    open the Ear and recursively to open the files in
    it; I'm not sure whether this will result in a full
    unpacking of the file in some temporary directory,
    though.
    Please let me know if it worked the way you wanted,
    I'm curious about it.This jerk just created the third thread about the same topic, because he didn't understand your suggestion, which I already provided earlier.
    http://forum.java.sun.com/thread.jspa?threadID=790015

  • Java files from a EAR file and from inner (inside EAR)

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    Firstly Sorry to writing long letter. but i was unable to express my problem.
    see my code==============================
    JarFile jarFile = new JarFile("Demo.ear");
    Enumeration e=jarFile.entries();
    while (e.hasMoreElements())
    JarEntry entry=(JarEntry)e.nextElement();
    if (entry.getName().endsWith(".war"))
    // Then what Next to do...........
    ===========================================
    you have mentioned "theFile" , What is this?...............
    InputStream in = theFile.getInputStream(theEntryOfTheWAR);
    This line is not a compatible type casting in Java..........
    ZipOutputStream theWar = new ZipInputStream(in);

  • Java files from a EAR file

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking.
    suppose "Demo.ear" contaions the following files:
    abc.java
    programs / a.java
    programs / b.java
    src / index.java
    src / com / myFolder / main.java
    src.war
    and suppose "src.war" again contains some java files inside differenet folders.
    The main problem is that i can read all java files from "Demo.ear" but unable to reading from "src.war" b'coz my program is using JarFile class constructor which needs a archive file path, So only top level archive having the path but not the inner archives.
    So, pls help me out to this problems
    Thanks in advance

    please help me
    I am waiting for ur response
    thanking you

  • Adding a file into existing zip file

    I need a add a file into existing zip file. and write into printwriter.
    How to do it?
    Waiting for the reply.
    Thanks and Regards,
    Narayanan. G

    Narayanan.G wrote:
    I need a add a file into existing zip file.API: [ZipOutputStream#putNextEntry()|http://java.sun.com/javase/6/docs/api/java/util/zip/ZipOutputStream.html#putNextEntry%28java.util.zip.ZipEntry%29]
    Tutorial: [http://java.sun.com/developer/technicalArticles/Programming/compression/].
    and write into printwriter.Writing a zip file into printwriter? Huh? Please elaborate.

  • Adding Data file to existing primary file group with 1 data file

    Currently our databases are configured to only have 1 data file and 1 log file.  I am looking at adding a 2nd data file to the primary group, which will be on a separate lun.
    Will we benefit from adding the 2nd data file (same size as 1st data file and same autogrowth rate) , or should we create a new database with 2 data files (equal size and autogrowth rate), and import the data from the database with the single data file.
    Thanks.
    DJ

    Having another data file pointing to different Physical Volume
    will give you better performance gains. Additionally, you should pre-size them (Same as First Data File) with same growth settings (Preferably in Mb
    instead of Percentages) .
    It is perfectly OK to add another data file to PRIMARY file-group as well and SQL Server will automatically balance the data across multiple files over the period time (Due to Data Striping)
    HTH
    Good Luck! Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue

  • Static files within a ear file     - help me if you can I am feeling down

    I am using oc4j.
    I have some static files (templates and configuration files for the applications) in an ear file.
    These files are addressed via web.xml init param and I use relative path.
    This works in my "working directory".
    But when I deploy the ear file the servlet cannot access the file (io exception file test/templates/temp.txt not found).
    Has anybody an idea how I must address the files in the web.xml?
    How can I address the files from /test level?
    Or is somthing wrong with the structur of the directory?
    my "working dirctory"
    appname/
    META-INF/application.xml
    test/
    web-inf/web.xml
    /classes
    /lib
    templates/temp.txt
    init-param
    <param-value>appname/test/templates/temp.txt</param-value>
    init-param
    <param-value>/test/templates/temp.txt</param-value>
    thanks in advance
    peter

    If these files are only accessed from the web module, then put these files in a subdirectory of the "WEB-INF" directory of the war file.

  • ClassNotFoundException trying to load classes in a .war file inside an .ear file

    Hi. I've deployed an EJB2 enterprise app as an ear file on WebLogic 6
              without errors. The ear file contains web app and ejb components in war and
              jar files. The web component is set to be the default web app in the
              config.xml file. Everything deploys without error messages.
              My problem is that I get ClassNotFoundExceptions when I try to invoke a
              servlet (via its servlet-mapping) or do Class.forName() on any class file in
              the war file.
              I see in '.wl_temp_do_not_delete' that the ear file has been decomposed into
              the ejb jar and web war files. The war file is not 'exploded' into a
              directory structure, however (as the console.war is). Is this an error
              (should the class packages in the war file be 'exploded'?)
              I don't see a tag in the web.xml, config.xml, or application.xml that tells
              the server to explode the war file--is there one?
              Note that if I manually copy the exploded class folders into the
              '_tmp_war_myserver_myserver_<<webappname>>' directory (and not, curiously,
              into a WEB-INF/classes subdirectory of that directory), the servlets and
              other classes load correctly. Also, jsps and html files load just fine
              without exploding the war file.
              Note also that the server complains about not being able to find the
              classes, even though it reports that the decomposed war file is in the
              classpath. Is there a problem loading class files from a .war file (because
              the namespace is different, with root classes located in WEB-INF/classes
              rather than the .war file's root?)
              Also, in the application.xml file, what is the meaning of the
              <context-root></context-root> element? What should its value be? What if
              you leave it blank?
              Thanks for any help,
              Reid
              

    Is there a way to add jar libraries to the Oracle JVM CLASSPATH? Is this the same as the system's CLASSPATH env. variable?
    Thank you!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alex McClennan ([email protected]):
    The package prefix in the code extract was correct - i.e. "oracle.aurora.jndi". A value of "oracle.aurora.jndi.*" would be incorrect.
    The problem is that the context factory implementation specified (com.evermind.server.ApplicationClientInitialContextFactory
    ) can't be found, the mostly likely reason being that the library containing the class isn't on the classpath.
    Cheers,
    ax<HR></BLOCKQUOTE>
    null

  • Programmatically specify file location within ear file

    Hi guys,
    I am deploying an ear file under weblogic 6.1 and in part of the code I need to parse an xml file however, I can't figure out how to specify the path to the file. Whatever I try I always get an exception telling me the file cannot be found. The file itself resides within WEB-INF in the applications jar file which itself resides within the ear.
    I don't know how to specify the files location.
    Please help!
    Simon.

    Hi Simon,
    I'm not sure if this will help - but I have had similar problems and am happy to share my experiences with you and hope they help you. (my test were done on JRun 3.0 - but am sure the behavior under weblogic is similar)
    I am not sure what method you are using for accessing your xml file and what the package structure of you apps is but I assume that you are either doing a
    <code>
    String fileName = "myFile.xml";
    File f = new File(fileName);
    or
    URL u = this.getClass().getResource(fileName);
    </code>
    I found problems with both these methods when deploying as a web app. The first method places the file in
    <code> {JRunPath}\servers\default </code>
    directory (which it should as the spec by default creates the file in the users default directory)
    and the second creates a URL that does not correctly map to the location (see my post http://forum.java.sun.com/thread.jsp?forum=136&thread=184500)
    neither of these is suitable for deploying a webapp. The only way to locate the resource seems to be to use either
    <code>
    fileName = ServletContext.getRealPath(fileName);
    or
    URL url = ServletContext.getResource(fileName);
    </code>
    This does leave open this issue on how to pass the servlet context down to the specific class within your application that loads the xml - the uglier option is to pass the servlet context object right down to the class that loads the resource - the other option is to use some kind of a static initializer to make the servletcontext object globally available
    hope this helps

  • Specify a property file inside a ear file

    Hi guys I have this myApplication.ear file.
    All the project inside the ear file are using myProperties.properties file.
    I have been told that this property file has to be inside the ear file.In websphere 7.0 ,the administrator will specify a jvm classpath like /webAS/installedApps/myApplication.ear/myProperties.properties.During runtime my code will find the property file using this class path
    I am using RAD 7.5 to generate the ear file.Can some one tell me how to achieve this.Basically my ear file has to be bundled with the property file.
    thanks
    m

    You might get better results from a RAD forum if you a havent already figured out your issue.

  • How to access images files outside an ear file

    I tried accessing images that are not part of the ear file which i deployed. And
    which created on a fly during the execution of applicaiton. I get URL not found
    error, can any one let me know if is there any way where in i could access the
    files not part of deployed ear. I am uisnig Weblogic 6.1 Awaiting for a reply
    ASAP.
    Thanks
    Anastasia

    Generally, accessing files that are not within your
              war hierarchy is not allowed. Everything the webapp
              needs should be contained within the webapp.
              WebLogic does have an extension known as "virtual
              directories" which does allow you to access content
              outside the war. There is information on it at:
              http://e-docs.bea.com/wls/docs70/ConsoleHelp/war_webappext_virtualdirectorymapping_config.html
              mark
              > "Ajit Mukka" <[email protected]> wrote in message
              > news:[email protected]..
              >
              > Hi
              >
              > I tried accessing files that are part of my Default WebApp directory.
              > These files are not part of the ear file which i deployed. I create
              > few runtime files and make dynamic calls to access those files.
              > I get URL not found error, can any one let me know if is there any
              > way wherein i could access the files not part of deployed ear.
              > awaiting for a reply asap.
              >
              > Thanks
              > Ajit
              >
              

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • How to generate not nillable complexType with ant task autotype

    Hi all,
    The file types.xml created by ant task autotype contains, among others, all element definitions of my java classes.
    For testing purposes I have a simple class that holds (wraps) only a string. In the types.xml it is shown as followed:
    <xsd:complexType name="StringHolder">
    <xsd:sequence>
    <xsd:element name="mystring"
    type="xsd:string"
    nillable="true"
    minOccurs="1"
    maxOccurs="1">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    Somehow nullabel is always true, but I want to be false. Does anyone knows how?

    Hello digitxm,
    Since the hardware you have is the limiting factor, with the NI 6008 you can perform a software timed pwm output if timing in your application is not critical (your cycle time is in the seconds range and you do not mind some milliseconds of delay) you can use a digital output with software timing control for your PWM generation. Also, see how to use AO channel(s) to control the voltage level of a square wave output (period of the square wave can be varied). Otherwise, this can be accomplished by using the following example on generating a digital waveform using non-regeneration in order to update frequency and duty cycle on-the-fly using National Instruments M Series or X series DAQ devices.
    Best regards,
    Ali M
    Applications Engineer
    National Instruments
    www.ni.com/support

Maybe you are looking for