Image location

Hello,
Getting a null pointer exception. I am using Ant to compile my packages - the directory looks like this
root
|
|-----images
|-----src
| |-----comp
| |------screen
|----clasess
| |-----comp
| |------screen
The images are being included in the jar that ant creates and my code has worked until i decided to put things in to packages.
My code is
     URL logo = this.getClass().getResource("images/im.gif");so i know that the images are being included but that the directory its looking in is wrong. How can i specify that root is the normal working directory and then to go to the images folder!
Any ideas? Is it something to do with this.getClass or what!
Regards,
John

And just to throw more confusion onto the whole subject, the code that I have used repeatedly actually uses Class and not ClassLoader:
     public InputStream getResource(String uri)
          throws IOException, ResourceNotFoundException {
          URL urlResource = this.getClass().getResource(uri);
          if (urlResource == null)
               throw new ResourceNotFoundException(uri);
          URLConnection urlConnection = urlResource.openConnection();
          return urlConnection.getInputStream();
     }Play with your classpath settings. The resource loader will undoubtedly have to use that in some way to find a given uri.
- Saish

Similar Messages

  • Extract Image in thrid-party System using Image Location

    Hi All,
    I am working in an Interface project. I need your help in one of the requirement.
    The data will flow from third-party system as an XML file and we are using Webservice to extract the data.
    The requirement is the third-party system will send the image location in the XML file and we need to extract the Image stored in the third-party system using that Image Location.
    Is this feasible and if so how?
    With Regards,
    Gurulakshmi

    Hi,
    No. We will store the image in Livelink(Third-party Storage Location) and attach that image against SAP Notifications which is created using T.code: IW21
    With Regards,
    Gurulakshmi

  • Acces images located on a static web applications

    HI everybody,
    I need to put images and html pages on IBM http server, I've created for that a web static application that I've deployed on the http server. I have also a dynamic web appliocation running on websphere 6 where I've puted all my jsp and servlets. I've instaled the IBM http plugin and both servers seems to be communicating correctly.
    my first question is: what is the best practices to access the images located on the webserver from my jsp files, I dont like the idea to use the full url:http://webserverIPAdress:port/staticContext/imagesFolder, is there a way to map the images folder path in my websphere application, or to tell the jsp page to go to the http server to lokup the image?????
    The second questions , do I need to do somethig to manage the redirection of the users requests: I'm planing to make my webserver as the front facade, I mean if a user asks for html page he will get it from the http webserver, but if he is requestiong a servlet how the request would be redirected to the websphere application????
    regarding the plugin if alredy installed it and i have performed the snoopServlets test comming with the IBM http server documention , it seems to be working fine, it means that both servers communicate well. so what the convenience of generation plugin functionality which is on the sever page on the websphere admin console????, do I need to that also???
    any kind of help would be appriciated , as you see I'm new with IBM servers.

    HI everybody,
    I need to put images and html pages on IBM http server, I've created for that a web static application that I've deployed on the http server. I have also a dynamic web appliocation running on websphere 6 where I've puted all my jsp and servlets. I've instaled the IBM http plugin and both servers seems to be communicating correctly.
    my first question is: what is the best practices to access the images located on the webserver from my jsp files, I dont like the idea to use the full url:http://webserverIPAdress:port/staticContext/imagesFolder, is there a way to map the images folder path in my websphere application, or to tell the jsp page to go to the http server to lokup the image?????
    The second questions , do I need to do somethig to manage the redirection of the users requests: I'm planing to make my webserver as the front facade, I mean if a user asks for html page he will get it from the http webserver, but if he is requestiong a servlet how the request would be redirected to the websphere application????
    regarding the plugin if alredy installed it and i have performed the snoopServlets test comming with the IBM http server documention , it seems to be working fine, it means that both servers communicate well. so what the convenience of generation plugin functionality which is on the sever page on the websphere admin console????, do I need to that also???
    any kind of help would be appriciated , as you see I'm new with IBM servers.

  • Dynamic Image Location in JRC

    <p>Hi !</p><p> </p><p>We are interested in using so called dynamic image location future in JRC. So far we are unsucessful, so the question is, is it supported in JRC ? We are able to get dynamic image location future working in report designer, but when our report is exported there is no image only path to it. </p><p> </p><p>We use Crystal Reports 11 R2, Java Reporting Component in JSP version.</p><br /><p>Mac</p>

    I have a couple of reports working with dynamic images. CR4E doesn't support this (yet?!?), but you can still do it with the JRC. The big kicker is the syntax of your URL. If you're using a static image on a server somewhere, it should work with no problem. However, if you're using a generated image, it's a little trickier. I discovered this when I was creating a report with barcode labels. The barcodes were not getting generated. I turned on debugging and found that the JRC was screwing up my url. The url was as follows http://myserver/barcode?message=12345 67890&format=datamatrix.
    In the logs, the JRC said it couldn't find an image at the url
    http://myserver/barcodemessage=12345+67890&format=datamatrix. It was stripping out the ? in the url, which is kind of an important character to say the least. I messed around with it and eventually found that if I just put ?? instead of ?, the image would display correctly with the JRC. Hope this helps! If not, post what version of the JRC you're using and the URL you're using for the image location.

  • Showing image located in km folder

    Hi, i'm trying to show an image located in a km folder, i do this binding source property of an image element to an string element in the context, and then i assign the path of the iresource to the context element.
        The problem is that when try to show the image it ask for a user and id, because it open it as a external link, its is posible to put in the source a relative path (i don't know if it fix the problem) or i must open the image and asign it by code? do you know any solution ?
    thanks

    i think that when access to the km need an user like that:
        IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
                     //establish resource context
                     IResourceContext resourceContext = new ResourceContext(ep5User);
                     //get a resource factory
                     IResourceFactory resourceFactory = ResourceFactory.getInstance();
    but when puts in the surce property of the image ui it try to open without login, if i copy a link to an image an try to open in a new window is the same.

  • Image location in IDML file?

    I am creating an IDML file by using the properties from a MIF file. I have an Image object in MIF file. Its location is represented by using Left, Top, Height and Width. But in IDML file location representations are different. How can I include Image location in IDML file?

    Have you read the specification? Try example 15!
    Have you exported an sample Indesign document?
    Coordinates are pasteboard (not spread) coodinates in units of points,
    per section 10.3.3. You need not apply any transformation and can use
    the identity, ItemTransform="1 0 0 1 0 0." But you could do othre
    things if you wanted to.
    Your PathPoint anchors will correspond to the 4 corners. So you'll use
    Left for the X values of the upper-left and lower-left corners, top
    for the Y values of hte upper-left and upper-right corners, and
    sum Left+Width for the X values of the right corners and sum Top+Height
    for hte Y values of the bottom corners.
    This is pretty well-documented stuff. Please take the time to read the
    documentation before asking for help.

  • Work around for deleting images located on network

    This may be obvious to some, but I thought I'd post it to help others...
    You may know that Aperture refuses to delete images located on network shares. As far as I can tell this is due to the lack of a Trash on network volumes (being a safety feature in that your images are only REALLY gone once you empty the trash...)
    Work around:
    1. On a LOCAL disk, create a folder called "Delete_Me" (or similar
    2. Select the image(s) you want to delete and choose File > Relocate Masters and choose your "Delete_Me" folder as the destination and click the "Relocate Masters" button.
    3. Now with your selection still active, you can hit cmd + back-space, and the images will go to the trash.
    Apple: A preference box something like: "Delete network files immediately" or even a hook that would check when you do the delete if the file is on a network share and then automatically do the copy and delete would fix this...
    Mac OS X (10.4.8)

    Many thanks, this has been an issue with my Solaris 10 file server.

  • Dynamic Image Location?

    Hi Experts
    How can I use Dynamic Image location in my Crystal Reports?
    Thnaks in advance
    AG

    Techy Guy,
    In the properties of your image, you can set the location as a formula. Here, you can set the path by IF-ELSE statements:
    IF {letter.city} IN ["Arnemuiden","Kleverskerke","Middelburg","Middleburg","Nieuw- en Sint Joosland","Sint Laurens"]
    OR LowerCase({letter.city}) LIKE "*joosland"
    THEN ".\Middelburg.png"
    ELSE
        IF {letter.city} IN ["Oost-Souburg","Ritthem","Vlissingen"]
        THEN ".\Vlissingen.png"
        ELSE ".\Middelburg.png"
    In this formula, the logo will be depending on a the city the recipient is in. If the city is not in one of these two options, Middelburg.png will be used as default (to have at least a logo in the letter).
    You could even use a field to define the image name:
    ".\Flags\" + {Customers_.Country} + ".png"
    will point to the directory 'Flags' in the same directory as your report is. Here, it will locate the .png file having the same name as the country field in the customers database (i.e. France.png).

  • Splash screen image location

    Where is the Photoshop CS6 splash screen PNG image located on Mac OS X?

    If you just want the image, why don't you search for 'adobe photoshop splash image cs6' in Google images?
    If you're looking at altering it (which I'm unsure is against EULA and Copyrights), you'll need a resource editor such as 'ResKnife' with which you have to open up
    /Applications/Adobe Photoshop CS3/Adobe Photoshop CS3.app/Contents/Resources/Adobe Photoshop CS6.rsrc
    Look for 'SplashBackground', select it and export it as .png on your system.
    DISCLAIMER: Misuse of .rsrc file will cause your PS to crash/ not open. I'm really not sure if editing the SplashScreen is legal. I take no responsibility for any loss/ damage to your system that may result in doing this! Do it at your own risk (technical & legal)!

  • How to Retrieve all Azure Images located to "East Asia"

    I'm using Azure Powershell to retrieve all Windows Azure VM Images, can I filter it to show only available images located in "East Asia"?

    Hi,
    Please have a look at below article.
    #http://michaelcollier.wordpress.com/2013/07/30/the-case-of-the-latest-windows-azure-vm-image/
    Here is a snippet.
     modify the script to include logic to select images that are only available in the desired data center location.
    $images = Get-AzureVMImage `
    | where { $_.ImageFamily -eq "Windows Server 2012 Datacenter" } `
        | where { $_.Location.Split(";") -contains "West US"} `
        | Sort-Object -Descending -Property PublishedDate
    Using the above snippet, only the most recent version of the “Windows Server 2012 Datacenter” image that is supported in the “West US” datacenter will be returned.
    Hope this helps.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
     Click  HERE to participate the survey.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I cant find the copy image location pull down menu ???

    I am trying to learn how to insert a photo in a blog. The instructions say if using firefox select copy image location. I can not find it on the pull down menu's ????

    You can also see the locations of all images on the current open page in Tools > Page Info > Media

  • Are there any performance concerns when referencing an image located in a c

    Are there any performance concerns when referencing an image located in a central location (example application server)?

    Hi
    Should not be an issue at all - we are only going to be limited by the network bandwidth
    Regards
    Tim
    http://blogs.oracle.com/xmlpublisher

  • Prime Infrastructure 2.1 Image Location

    I am trying to setup PI to auto deploy routers.  I think I have things configured correctly?  I am running into a snag with the image deployment, the router boots and gets the CNS config.  In the plug and play status i get an error "Image activation failed", with the details showing "Image destination filesystem does not exist"? I am assuming this has something to do with the plug and play profile and the Image Location setting?

    I changed the location to blank and now I get this error:
    The Inventory status is FAIL. Response with Error Code(AUTHENTICATION FAILURE) and additional info(AUTHENTICATION_FAILURE (Errcode=CNS_AUTHENTICATION_FAILED Info=not allowed to use that server url)).

  • Move Lightroom catalog containing images located on a NAS

    Hello,
    I want to move my Lightroom catalog from my old PC to my new iMac.
    The catalog contains only images located on a NAS.
    I can connect to the NAS from both computer, but when I'm trying to ´import the catalog I get the message "Lightroom could not import this catalog because of an unknown error"
    I use the same versions of Lightrrom on both computers.
    Does anyone know how to solve this?
    Best regards

    Finally I figured out how to solve this!
    I opened the catalog containing NAS images and pointed the missing files to the NAS-location.
    Then I opened the main catalog and imported the NAS-catalog. It worked!
    Thank you TubbeAh!

  • 4.2.2 upgrade from 4.1 and images location issue

    I've just upgraded from 4.1 to 4.2.2, and am having an issue with the referenced location of the images directory (/i/) resources. I am running apex listener on weblogic server, and have copied the new images into the i.war that I use. I have an unusual reverse proxy situation where my base URL includes a path, i.e., https://www.my.website.com/mysite/ is the URL that the proxy returns to the user, so my APEX addresses look like https://www.my.website.com/mysite/apex/f?101:1:::::, and my image directory references get put together like https://www.my.website.com/mysite/i/image.jpg.
    However, with the upgrade, one of the things that popped up was all of the datepickers in my application were changed to classic datepickers, which worked and displayed fine. When I change them to the new datepicker, the small calendar image doesn't show next to the field (red x), and when I look at the properties of the image, it's URL is https://www.mywebsite.com/i/asfdcldr.gif (no "/mysite/" path offset). ALL of the other images directory references seem fine, but not this. Has 4.2.2 changed how it composed the #HOST# when it's generating these new controls (same result when I make a datepicker from scratch)? Why do all of my other images directory references work? The only other problem that I'm seeing is that my charts no longer work, either. I used to have to hardcode my URL into the XML of the charts for them to work, but I don't see the URL referenced in the code anymore. Not sure if that's related, but that has always been an issue with my reverse proxy situation (I don't control the proxy server).
    Thanks in advance for any light anyone can shed on this,
    -warren

    Hi Warren,
    +> The only other problem that I'm seeing is that my charts no longer work, either. I used to have to hardcode my URL into the XML of the charts for them to work, but I don't see the URL referenced in the code anymore. Not sure if that's related, but that has always been an issue with my reverse proxy situation (I don't control the proxy server).+
    With APEX 4.2, we've changed how charts are initialized to be JavaScript only, and as part of the changes, we no longer expose the region source for charts. See *4.8 Updated AnyChart Flash Charts* in the APEX 4.2 Release Notes, here: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35121/toc.htm#CACEJBCD. So it's no longer feasible to hardcode a reference to your URL in the region source for a chart. If you have a reverse proxy, the CGI environment variables REQUEST_PROTOCOL, HTTP_HOST, SERVER_PORT, and SCRIPT_NAME, have to be correctly set to the public facing web server and not to the internal forwarding connection. If you execute the following query in SQL Workshop on your APEX instance, do you see the settings for the public facing web server?
    select owa_util.get_cgi_env('REQUEST_PROTOCOL'), owa_util.get_cgi_env('HTTP_HOST'), owa_util.get_cgi_env('SERVER_PORT'), owa_util.get_cgi_env('SCRIPT_NAME') from dual;Regards,
    Hilary

  • Where are the user images located in finder?

    hi
    i am looking for the location on disk of the images that can be associated with your user image (System Preferences/Users & Groups).
    the images are the apple supplied user images like the baseball, snowflake, etc.
    where are these images found on disk?
    thanks

    /Library/User Pictures
    Regards.

Maybe you are looking for

  • How do I BACK UP my emails ?

    What I mean by back up in this instance is, I am wiping my OS and starting clean... and this time is the first time I have some emails that I have in my mailbox(s) sent, personal, business, etc... that I want/need. So how do I find the file(s) that a

  • PO & Internal order report

    Dear all, I have a requirement related to account asiigned(F) PO.I want internal order wise po status or vice-versa.If there is any standard T-code besides ME2N is there,pls help me. Regards, DD

  • Connect PC Monitor and Mac Display to MBP?

    I have a late 2011 MBP with 2.4 i7 processor, 16GB RAM and a AMD Radeon HD 6770M 1024 MB Graphics card that currently has a 2008 Mac 24" LED Cinema Display connected to it. I also have a 23" Dell monitor sitting around and I was wondering if there is

  • FileNotFound Exception

    Hello I am trying to parse an xml file chosen by the user. The file chosen is under: wkdis3/home/bwe but everytime i got this exception: ption caught: class java.io.FileNotFoundException Datei AABC.XML ist nicht g�ltig.java.io.FileNotFoundException:

  • Mighty Mouse --- Updating to Tiger?

    Hi, I just recently bought the Wireless Mighty Mouse. I have been trying to figure out how to customize the buttons to do what I want. But the "System Preferences" do not even give me that option. I was told that it is because I am still on 10.3.9 an