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
          >
          

Similar Messages

  • How to use Connection Pool in ADF ear file creaion from jDev 10.1.3

    Hi,
    We are developing big application in ADF with 10 different modules. We are creating ear file with data source setting.
    How to use connection pool while creating ear file from jDev. Connection pool is alreday created in Application Server 10g.
    What all the setting we need do to make use of connection pool while creating ear file jDev.
    Thanks

    User,
    If you are using ADF Business Components, you can right-click each application module, select "configurations" and edit the configuration you are using. On the initial page of the configuration dialog, you can specify to use either a JDBC URL or a Datasource - you just need to choose Datasource and then provide the name by which to access it.
    John

  • How to build project in NWDS from ear file?

    I do know that it maynot be possible to build a project from a .ear file but I am sure there must be a way out. I am sure someone else would have faced the same problem that I am facing.
    This is what happened. We had a consultant working on our ESS/MSS appplications in the studio. He made changes to a few ESS/MSS applications. However, while deploying, he did not use NWDI even though we do have NWDI available. He simply imported the .ear files in all the development, quality and production portals. Because of this, the changed source code is not available on NWDI and when I import the configuration from NWDI, I only get the old source code.
    I do have al the .ear files he deployed. So, my question is, is there anyway for me to build the project from the .ear file? I do know how to decompile the CLASS files on the ear file and look at the code but I was hoping for a way to build the entire project with the changed source code in NWDS. Or Is there anyway to synchronize the NWDI source code with the deployed source code. Please respond ONLY if you have actually managed to resolve this problem.

    Hi Santosh,
    This is hardly possible even if you have Java decompiler -- WD has a lot compile(design)-time only artifcats that are not exist in generated EAR.
    Regards,
    Vipin.

  • 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

  • How to access images in a jar file

    Hello,
    I am currently developping a swing application that uses icons (gif files) and I have zipped all my classes and images in a single .jar file.
    When I try to access those files it doesn't work ... it seems that I am not using the right way ...
    Could anyone explain me how to achieve this ?
    thanks in advance

    I get the Images from jar file to set ImageIcon for my components like this:
    ImagesLocator.getImage("imageName.gif");
    anu
    //ImagesLocator.java
    import java.net.URL;
    import java.awt.*;
    import javax.swing.*;
    * Load images from correct place (directory or JAR file) into GUI.
    public class ImagesLocator
         * Load image from correct place (directory or JAR file).
         * @param imageName name of image to be loaded (with no path)
         * @return loaded image
         public static ImageIcon getImage(String imageName)
              ClassLoader cl = ImagesLocator.class.getClassLoader();
              ImageIcon i = new ImageIcon(cl.getResource(imageName));
              return i;

  • How to access files outside a .jar file netbeans project

    Hi, i need to access a file outside a built project inside netbeans. Ideally i would like this file next to the .jar file as myapp.properties. If possible i would like it so that when i am compiling and running the project in netbeans the file can be with the class files or something along those likes. Either way it would be nice to have different code for built projects and just running them outside a jar.
    Heres what i got so far
    properties = new Properties();
                InputStream in = this.getClass().getResourceAsStream("applications.properties");
                properties.load(in);
                in.close();this only works if the file is next to the classes. (think thats called the classpath ? )
    Thanks for any replies!!

    Your wrong code:
    properties = new Properties();
    InputStream in
    = this.getClass().getResourceAsStream("applications.properties");
    properties.load(in);
    in.close();A right code:
    // basic assumption 1: applications.properties
    //  is a pure ISO 8859-1 text file
    // basic assumption 2: the file applications.properties
    //  is stored in the same directory where your
    //  jar file is stored
    properties = new Properties();
    try{
      FileInputStream in      // assume current dir
       = new FileInputStream("applications.properties");
      properties.load(in);
      in.close();
    catch (Exception e){
      e.printStackTrace();
    }

  • How to handle images stored /outside/ Aperture

    I am coming from a PC environment where my images were stored all over my hard drive in various folders and subfolders. I am part-way through organizing all of this in Aperture but I OFTEN find myself exporting images to folders on my desktop in order to upload them to FTP or edit them in Photoshop conveniently and as I move to working in something like an Adobe Suite that allows me to edit and link images I do see myself keeping images outside of Aperture.
    Can anyone help me out with how to manage this a little more practically (say by only keeping images on the desktop but not in the Documents Folder) and/or should I be trying to discipline myself down to keeping everything in Aperture? I find it relatively confusing to do it this way but am very interested in getting some advice on this.
    Thanks,
    Jon

    Jon,
    I used to have everything sorted with the top folder being 'Project 1', 'Project 2', 'Project 3', etc. with either all files in that folder, or sub-folders for each file type. This was pretty good, but eventually got out of hand once I had a couple hundred projects with all types of files in each folder and needed to find a specific file (say an Illustrator file I needed to work on).
    Now, I use the following structure for Adobe CS5 projects:
    Top level folder = 'Design Files'
    Second level folders = 'Photoshop Files', 'Illustrator Files', 'InDesign Files', 'Acrobat Files'
    Third level folders (inside each of the second level folders as needed) = 'Project 1', 'Project 2', 'Project 3', etc.
    This gives me all my PSD files inside one master 'Photoshop Files' folder divided by Project folders. If - for example - Project 1 has PSD files, AI files, IND files and PDF files, then there is a Project 1 folder under each of the second level folders for each program. This allows me easy access to either all files for a program by going to that folder, or I can run a dynamic search (smart folder) for a project and see all relevant folders for that project in the search results.
    The main reason I have it this way now is that I usually remember the file type (as mentioned above for an Illustrator file). I typically remember that I did an illustration, but can't remember the file name of the illustration or the project it went in for sure. My current structure shortens my search time considerably.
    Note - I can also use Bridge CS5 very easily for the Adobe CS5 files since it shows thumbnails of the actual file and I can visually search very fast that way.
    At home - with Aperture - I only hold the original images (pictures) that I started to work with. I don't keep any PSD, TIFF, PDF, PNG, etc. in the library. This is simply because Bridge is much better at showing those files with transparency if it exists, and Aperture stays a straight-forward image (picture) database for me.
    If I send an image to a plug-in or to Photoshop from inside Aperture, I do it for a specific purpose and then I complete the process and export it to one of the dedicated folders in Finder (typically to my Photoshop Files folder). If I really need to keep the layer work in a PSD file, then I will use the 'Save As' command from inside Photoshop to save out to a folder and then just trash the file Aperture sent to Photoshop. Although I have not had any real issues with Aperture holding PSD files in the past, I simply trust Adobe to handle their own files without relying on Apple's program to do it for me.
    As far as miscellaneous files (screenshots, scans, web icons), I really don't do many of those. I have a few scans which are not part of any project and just keep those in a two level folder (Art / Scans). For web icons, I would probably suggest going with the program you used for a folder (Photoshop Files?). Not sure what program or file type you are using for those (GIF, PNG - I don't work with web design so not real familiar with current practices for icon design for the web).
    For JPEG files, I use a second level 'JPEG files' folder for any JPEG's that are used in my design projects in a 'Project 1', 'Project 2', etc. folder (same as the other file types mentioned above). Although, I typically use PSD files as source files and then save out JPEG's on a case-by-case basis (similar to using Aperture as the source and exporting as needed).
    Since most of my design files are for InDesign projects, I complete the project by embedding all links in the document after having printed to PDF (and proof-reading prior to embedding). This protects against lost links if I need to work with the master file again for some reason. I can always place a new image or file in the document as needed and since I have a PDF of the file to send to collegues, the extra file size in the InDesign file after embedding is not a big deal.
    So, in summary; I use a top level folder (based on category; e.g., Design Files) and then organize by file type parent folders with dedicated project folders under those as needed. Works for the way I think.
    I hope that was somewhat clear.
    Message was edited by: CorkyO2 to change "top level file" to "top level folder" in summary.

  • How to access images in my localmachine without deploying them

    Hi
    I am trying to access images in my localmachine from an ADF Application (11.1.2.4). If the source of the images is an url address it works fine. However, if they are in my local machine I don't know how to make it work. I don't want to deploy them with the application. I want them to be referenced like:
    file:///C:/images/bla/bla.jpg
    I might be failing is something really silly. Apologies in advance.
    Regards

    You can only address images inside your web root directly. The application can't just reference your file system.
    You can archive this using a servlet which you call via an url with parameters (e.g. the filename) and send the image from there (where you have access to the file system).
    Timo

  • Access Resource Adaptar outside the EAR

    Hi,
    I have created a resource adapter and bundled it in a EAR file. This EAR also has a Facade EJB which looks up the resource adapter and provides the required functionalities. This part of my application works perfectly fine. I am able to look up the Facade EJB from outside the EAR and call the required methods.
    Right now we have a new requirement to call the resource adapter from an application which is deployed outside this EAR. I tried adding the following tags to the weblogic-ra.xml
    <enable-access-outside-app>true</enable-access-outside-app>
    <enable-global-access-to-classes>true</enable-global-access-to-classes>
    But when i try to look up the res adapter, it says Null object bound to the JNDI name. Can someone help me on this?
    Regards
    Parthi

    The following is the exception:
    javax.naming.NameNotFoundException: No Object found: StaffwareProcessSuite|null
         at weblogic.connector.deploy.JNDIHandler.lookupObject(JNDIHandler.java:888)
         at weblogic.connector.deploy.JNDIHandler.getObjectInstance(JNDIHandler.java:850)
         at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:375)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at TestRAR.main(TestRAR.java:29)

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • How to include images/icons for a jar file

    Hi,
    I need to create a jar file which will contain my application. My source code (.java) files are in "app" folder. I compiled that using javac -d . *.java and one package("appl") was created. I have all icons and images related to my application are in the folder named "icons" in the directory where source files are located i.e; app folder - "app/icons". I am accessing the images in the icons directory as "icons/book.gif".
    I created a jar file from source file directory with the option
    jar cvf app.jar app
    and i added this jar file to my classpath also.
    I have created a batch file to execute this application and set that batch file to "path" environment variable.
    It is running from any directory but no icons are appearing in that application if i try to run the application out side the "app" folder.
    Can any body give suggessions to solve this problem?

    Thanks for the added info, now let's get started.
    To use files in jars, you need to refer to them via a URL, so you'll need to modify your code a little bit first.
    URL imgURL = ClassLoader.getSystemResource("icons/BOOK.gif");
    setIconImage(Toolkit.getDefaultToolkit().getImage(imgURL));Next, you'll need a manifest. Using any text editor such as notepad, create a file called manifest.txt and put two lines in it. The first line will specify the class (w/o .class on the end) that contains your public static void main method, the second line is just an empty line (just press return).
    Main-Class: main
    (a blank line)
    Save this file with your class files (e.g. in Exam folder).
    Next build your jar. We want the jar to contain the package folder and your icon folder as well. So use this:
    jar cmf Exam/manifest.txt myJar.jar Exam/*.class icons
    And you should now have an executable jar. You can run it from dos with:
    java -jar myJar.jar
    or you can double-click it from windows.
    -Ron

  • How to access the content in the configuration files

    Hi, Folks,
    To make it easy, the questions can be like this:
    how to access the content in web.xml in a web application?
    Through ServletConfig and context?
    how to access the content in ejb-jar.xml in an ejb?
    initial context?
    Thanks

    There is no documented way to delete data stored in archived log files: you can only remove the archived log files if needed.

  • How to read image present in a csv file ---- required urgently

    Hi,
    I have a task. where i will be given a csv file which consists of text and images. Reading text is ok but how can i read images present in the csv.
    Does anybody have any suggestions.
    Regards,
    Nag.

    what format are the images in?
    do you know the size of the image?
    How will you know if a character that shows up as ',' is really part of the image or not?
    If you know the size, it can be done, just treat the whole file as a 'binary' file and go at it from that perspective.
    if you have control over the format, it would be better to only store the name of the image in the csv file and just have the full path name in the portion that is in the csv file. then the actual file can hold the binary format specific data.
    if you don't, then you need to know the size of the image before you start loading the image into a memory buffer. you will also need some sort of 'delimiter' or keyword that says an image is coming next
    ie:
    %%image_block_follows%%,5016,asdfasd399c9e939d9c9
    where 5016 would be the number of bytes following the next comma. imbedded commas would not be treated as separators until you get to byte relative + 5017, and the bytes described above would probably look a bit more unreadable.

Maybe you are looking for