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

Similar Messages

  • 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);

  • Extracting file from a TAR file with java.util.zip.* classes

    Is there a way to extract files from a .TAR file using the java.util.zip.* classes?
    I tried in some ways but I get the following error:
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.<init>(ZipFile.java127)
    at java.util.zip.ZipFile.<init>(ZipFile.java92)
    Thank you
    Giuseppe

    download the tar.jar from the above link and use the sample program below
    import com.ice.tar.*;
    import java.util.zip.GZIPInputStream;
    import java.io.*;
    public class untarFiles
         public static void main(String args[]){
              try{
              untar("c:/split/20040826172459.tar.gz",new File("c:/split/"));
              }catch(Exception e){
                   e.printStackTrace();
                   System.out.println(e.getMessage());
         private static void untar(String tarFileName, File dest)throws IOException{
              //assuming the file you pass in is not a dir
              dest.mkdir();     
              //create tar input stream from a .tar.gz file
              TarInputStream tin = new TarInputStream( new GZIPInputStream( new FileInputStream(new File(tarFileName))));
              //get the first entry in the archive
              TarEntry tarEntry = tin.getNextEntry();
              while (tarEntry != null){//create a file with the same name as the tarEntry  
                   File destPath = new File(
                   dest.toString() + File.separatorChar + tarEntry.getName());
                   if(tarEntry.isDirectory()){   
                        destPath.mkdir();
                   }else {          
                        FileOutputStream fout = new FileOutputStream(destPath);
                        tin.copyEntryContents(fout);
                        fout.close();
                   tarEntry = tin.getNextEntry();
              tin.close();
    }

  • SCA from an EAR file

    Hello!
    I have a simple question about the sapmake utility. I have used to create an SCA from various archives and am familiar with its workings.
    What I want to know is that is it possible to create an SCA from an EAR file. I have created an SCA from an EPA and an EAR file but I want to create an SCA from an EAR.
    Theoritically this should be possible because an EAR is considered to be an SDA. Since an SCA is used to pack multiple or a single SDA(s), it should be possible to create a valid SCA out of an EAR.
    But when I tried it, the SCA build process went perfectly and I did get an SCA. The JSPM however, does not recognize this SCA at all! It says the inbox is completely empty. However, when I pack in the EAR with an EPA coverted to SDA and create an SCA, this SCA is immediately recognised.
    So why cant I create a valid SCA from only an EAR file?
    Thanks for looking into it!
    Sameer

    Hello Praveen!
    The EAR file is considered to be an SDA by NetWeaver. This is the reason that you can add an EAR file when deploying from the SDM tool even though the button in the deployment says "Add SDA/SCA for deployment".
    Bye!
    Sameer.
    P.S - Here is the link to one weblog which explains it - <u>Software Deployment/Component Archive Basics>.
    Added the link.
    Message was edited by:
            Sameer Jagirdar

  • How do I get the java code from a class file ?

    I want to know how to findout the java code from a .class file . Is there any utility or any way to get the java code from a .class file. If so , please let me know the step by step procedure .
    Thanks
    Shiva

    Check out Mocha (http://www.brouhaha.com/~eric/computers/mocha.html)
    It's free!

  • Retrieve the jdev project from the ear file

    I have an ear file, but I've lost the original jdev project.
    How can I retrieve the project from the ear file?
    I would know if there's a function in jdev or with another tool to convert an ear file to the original project in jdeveloper.
    Thanks.

    Try the File->Import menu option.

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • Reading a Compressed File from a ZIP File, which is an entry of ZIP File

    Hello, Experts,
    Would it be possible somebody to help me with code example for the following problem?
    I want to read a compressed file from a ZIP file, which is an entry of ZIP File, without extacting/writing files on file system. Is this possible?
    Lets say we have a ZipFile1. There is ZipFile2 inside ZipFile1. And inside ZipFile2 is FileA. The scenario is reading FileA without extracting on file system.
    Thank you in advance for your help.
    Cheers
    RADY

    The classes you want to be using are java.util.zip.ZipInputStream and and ZipEntry from the same package. Construct the ZipInputStream with the input you have for the outer zip. Loop with ZipInputStream.getNextEntry until you find the inner zip you're looking for - that method returns a ZipEntry, and you get the name of the zip entry with ZipEntry.getName. Read the ZipInputStream from that point into some buffer, and read that buffer into a new ZipInputStream - rinse and repeat until you have the contents of the file in the zip in the zip...

  • 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

  • Executing .jar files from another .jar file.

    How would I run one .jar file from another .jar file. and is there anyway to call specific class arguments? Because I have one .jar file that reads a specified file and returns its contents.
    So how would I execute it and specify its arguments and how would I make it return something to the executing jar file?

    Because I have one .jar file that reads
    a specified file and returns its contents. Presumably you have a class that does that, and you have that class stored in a jar. And you want to know how to... um... do something with that class. I say "um..." because normally you don't execute a class, either, you either call its static methods or you create an instance of the class and call its instance methods.
    If you have been writing a whole lot of little classes each of which just has a static main method, then stop doing that. Write real Java classes instead. The tutorial is here:
    http://java.sun.com/docs/books/tutorial/java/index.html

  • Is there a way to run a script to create an RPD file from MDS XML files

    We would be interested in using the MDS XML format for the RPD file in saving it in our Subversion source code control system, and I have seen how to do this in the User documentation.
    Our question is whether or not there is a way to use a command line tool to recreate the rpd file without having to use the Admin tool, so that we can automate the deployment of the RPD file from source code control to QA and Production environments.
    If we check in the RPD file directly, then there is a way to automate the process, but we would prefer to use the MDS XML format since this allows us to save changes in text format, not binary, but we still need to be able to automate the process.
    In the Oracle Fusion Middleware XML Schema Reference for Oracle Business Intelligence Enterprise Edition document, I have found that there is a way to automate the creation of the MDS XML files from an RPD file using this command:
    biserverxmlgen -M -R repository_pathname [-P password] -D output_directory [-8] [-N] [-Q|-S]
    So my question is basically is there a way to reverse this process, to use some command line tool (or Weblogic Scripting or some other mechanism) to create the RPD file from the MDS XML files? Are there options on the biserverxmlexec command that will do what I am asking?

    Hey dmfairley,
    Thanks for the question. You can absolutely export the project as .mp3, as outlined in this resource:
    GarageBand Help: Export songs to disk
    http://help.apple.com/garageband/mac/10.0/#gbnd7cbf5ed9
    Export songs to disk
    You can export a project to your computer as a stereo audio file.
    Exported files can be reused in GarageBand to save processing resources by replacing or bypassing multiple regions, instruments, and effects. They can also be used with other music applications and devices, posted on the Internet (on a webpage, or in the iTunes Store, for example), added to an iTunes playlist, or uploaded to a mobile device such as iPhone or iPad.
    1. Choose Share > Export Song to Disk.
    2. To rename the exported file, select the name in the Save As field, then enter a new name.
    3. Choose a location to save the exported file from the Where pop-up menu.
    4. Select the format for the exported file (AAC, MP3, or AIFF).
    5. Choose the quality setting for the exported file from the Quality pop-up menu.
    6. Click Export.
    Thanks,
    Matt M.

  • Loading an xml file from an xml file

    I'm trying to load an xml file from an xml file, but I'm
    having problems. My first xml file is really simple - it only
    contains one attribute with the name of another xml file in it
    (eventually I will have multiple xml files in here and run a loop
    on them...this is why I want to load an xml file from an xml file).
    Currently, with the code below, I can get the main xml file
    to load ("main.xml"), but I cannot get the secondary xml files to
    load FROM the main.xml.
    I want to then take childNode values from the secondary xml
    file and use them within my .swf in text boxes and whatnot.
    Any guidance? I think I'm going wrong on the line where I'm
    saying "i.newxml.load(i.attributes.location);"
    - How can I get this to work?

    johnypeter:
    I tried changing the code inside the loop to use just
    "newxml" instead of "i.newxml", and I declared with "var newxml =
    new XML();" - was this what you were thinking?
    kglad:
    The reason I tried to use the loadXML() function in the loop
    was so that for each node in my "main.xml" it would load the new
    xml file listed - this is a no-no? Do you have any ideas as to what
    I could do?
    For the for-loop, what should I change in it? I'm not great
    with loops so I tried to modify some code from another loop I found
    in another forum thread - not the right way to do it here?
    Also, what should I trace? The value of the _root.address, or
    i.attributes.location? I have created dynamic text boxes on my
    stage to see if the correct value from the xml file loads (ie. the
    name of the xml file within the xml file) and it does, but now I
    don't know how to put that information into ANOTHER loadXML()
    function and get the node information from it - does that make
    sense???
    Below are the examples of the xml files I am using. In the
    first one, main.xml, I will have a list of multiple xml files, each
    with the same nodes and elements as in the details.xml file
    (different values, of course).
    This is just to give you an example of what I'm trying to
    accomplish - pulling ALL the addresses and phone numbers from
    multiple xml files. I cannot manually collect this information, as
    it is dynamic, and will be updated in each individual details.xml.
    I was hoping to collect the information by simply adding to and
    updating ONE xml file - main.xml.
    Do you think this can be done? Am I going about it the wrong
    way? I'm quite limited in AS knowledge, which is why I'm piecing
    together code from other posts!

  • How to create a .DLL file from a .C file ?

    Hi everybody
    I'm looking for a method how to create a .DLL file from a .C file .That Dll file will be used to perform a board to measure voice quality accoding to the international standard named PESQ (perceptual evaluation of speech qualty) P.862.
    Can anyone help to start dealing with Dlls and give some advices to avoid errors ?
    thx
    Attachments:
    source.zip ‏37 KB

    Hi sinaps,
    You mention that you want to create a DLL from a .C file. Just to clarify, are you using C (.c file) or C++ (.cpp) to write your code?
    Also, if you are using C++, are you using Visual Studio? (The reason I ask is because this forum is geared towards Measurement Studio, which is an add on to Microsoft Visual Studio).
    That being said,
    If you are using C: National Instruments provides an ANSI C Application Development Environment called LabWindows/CVI which makes building dlls a snap. It has templates for DLLs and you can build them either as stdcall or cdecl dlls.
    Developer Zone Tutorial: Building a DLL with LabWindows/CVI 8.5 for use with LabVIEW 8.5
    If you are using Visual C++: Look at the link that Al provided earlier.
    MSDN: Walkthrough: Creating and Using a Dynamic Link Library
    If you aren't using CVI or Visual Studio, then really the best bet is to do a google search for "Create C DLL" or post or a forum for the appropriate environment that you are using.
    Thanks!
    Message Edited by Jervin_J on 03-14-2009 02:02 PM
    Jervin Justin
    NI TestStand Product Manager

  • How to execute a  .sql file from a batch file

    Hi all
    I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
    now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
    i created a batch file prod.bak with the following lines
    @echo off
    set oracle_sid=testdb
    set oracle_home=d:\oracle\ora92
    sqlplus /nolog
    connect sys as sysdba/oracletest@testdb
    this batch file when eexecuted connects me to sql prompt.
    Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
    (i tried with these lines in the above batch file...
    call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
    start bkp.sql---same as call
    connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
    At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
    Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
    I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
    Thanks
    Tripti

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

Maybe you are looking for

  • How to print

    I have an old handspring Edge that I have all my info on. I need to print a 3rd party milage, Think DB ,Is there a software that will allow printing in hooked up to the desktop? Post relates to: Visor Edge This question was solved. View Solution.

  • Default namespace in the SOAP sender adapter

    Hi All! Sorry for the following really easy question but what is the default interface name and default namespace in the SOAP sender Adapater? The name of the interface to where the adapter should forward the received SAOP message? it means that for

  • Macbook sometimes has problems connecting

    The brief summary is that my Macbook (white, core duo) has problems connecting to my G network when it has been on sleep mode. A restart usually fixes the issue until the computer goes to sleep again. The G network is comprised of a Linksys WRT54GS t

  • COMPONENT and equipment scenario

    Hi Guru's, In this scenario I am just talking about I have one COMPONENT and that attached with All three equipment (this scenario). Now my question is when in equipment number 10020154, we want to reassemble and repair for 4 or 5 days and then in th

  • Two nodes ASM has same instance name

    Hi, I created a two nodes ASM grid , when the grid installation(11.2.0.1) finished it created the +ASM1 as the instance name for both my nodes. I did setup the ORACLE_SID to +ASM1 and +ASM2 for the node1 and node2 respectively before the installation