Nullpointer when reading a directory

I have a web application (WAR) and a directory called testdir under the WEB-INF\classes directory. I want to loop thru all the properties files inside this directory and for each one, I want to read each one and process it.
Inside my Java program, I have the following code to read the directory but it gave me back nullpointer
File bpelDir = new File("testdir ");
Here's the directory structure. The java program resides in the com\abc directory
WEB-INF\classes\testdir\
WEB-INF\classes\com\abc\
Thanks,

You're probably better off asking the classloader for the properties files as streams anyway. See the javadocs for Classloader.getResourceAsStream for further info.

Similar Messages

  • Firefox won't open following update. Can't open Profile Mgr, even when using entire directory path in cmd line

    I'm running Firefox on a Windows 7 machine. Firefox won't open following the latest update. I've read the help articles and it seems like I need to create a new profile because my settings have likely been corrupted. I'm unable to open Profile Mgr, even when using entire directory path in cmd line. I've tried the following commands in the command line:
    firefox -p
    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p
    Nothing happens with either command.
    I'm also running Norton Internet Security. I read a help article Re Virtual Browsing features possibly causing a problem. The article said to check the virtualization setting in the internet security software and to clear the virtual cache. I went thru all of the settings menus in Norton Internet Security version 21.6.0.32 and I didn't see anything that looked like 'virtualization" settings, so I assumed that this doesn't apply to me.
    If you have any ideas, I'd sure appreaciate your expertise!!

    ''arcandl [[#question-1038482|said]]''
    <blockquote>
    I'm running Firefox on a Windows 7 machine. Firefox won't open following the latest update. I've read the help articles and it seems like I need to create a new profile because my settings have likely been corrupted. I'm unable to open Profile Mgr, even when using entire directory path in cmd line. I've tried the following commands in the command line:
    firefox -p
    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p
    Nothing happens with either command.
    I'm also running Norton Internet Security. I read a help article Re Virtual Browsing features possibly causing a problem. The article said to check the virtualization setting in the internet security software and to clear the virtual cache. I went thru all of the settings menus in Norton Internet Security version 21.6.0.32 and I didn't see anything that looked like 'virtualization" settings, so I assumed that this doesn't apply to me.
    If you have any ideas, I'd sure appreaciate your expertise!!
    </blockquote>
    ''philipp [[#answer-670108|said]]''
    <blockquote>
    hello arcandl, when firefox isn't launching after you double-click on the shortcut this is sometimes also a sign of malware being active on a system.
    you might want to try running a scan with some different other security tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] and [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner] which are specialised in removing adware and browser hijackers.
    [[Troubleshoot Firefox issues caused by malware]]
    </blockquote>
    Phillip - You're a genius!!! I ran malwarebytes and it resolved my problem. Thank you so much!!!

  • Ightroom 5.7 "lightroom encountered an error when reading from its preview cache and needs to quit"

    I got this error message after start in Lightroom 5.7 "lightroom encountered an error when reading from its preview cache and needs to quit". It seems also catalog .lrcat disappears from disk. Also preview catalog .lrdata doesn't exists. So I try to reinstall Lightroom without success, I am still receiving the same error. How I can reset Lightroom to new catalog? I have backup of lrcat file, but I am not able to start Lightroom due to this error.

    It seems solved. I have copied backup .lrcat to Lightroom data directory and I still have received error mentioned above. But when I doubleclick on .lrcat file in Explorer the catalog have been opened without problems.

  • Error when reading HTTP destination: INTEGRATION_DIRECTORY_HMI

    Hi, PI experts.
    When refreshing XI cache I get following error:
    <b>“Error when reading HTTP destination: INTEGRATION_DIRECTORY_HMI.”</b>
    Status of XI Runtime Cache is
    <b>Unable to refresh cache contents
    Error during last attempt to refresh cache</b>
    When starting cache delta refresh I get an error <b>OBJECTS_OBJREF_NOT_ASSIGNED</b>
    HTTP-destination INTEGRATION_DIRECTORY_HMI works correct (gives an error 500)
    In Cache Connectivity Test - Java IS and Adapter Engine are green and ABAP IS is yellow giving message “Attempt to fetch cache data from Integration Directory not yet started or still in process”
    I also read forum threads:
    sxi_cache
    Error while refreshing the XI runtime cache
    and “How To Handle XPI Caches in SAP NetWeaver 04s” but didn’t find there a solution
    Can anybody give me an advice how to solve this problem

    Hi
    You please check the INTEGRATION_DIRECTORY_HMI in SM59.
    Check the following fields:
    Target host:host name of xi
    Service No:xxxxx(ex:53000)
    Path Prefix:/dir/hmi_cache_refresh_service/ext
    make sure the service no is not Java port.
    Logon credentials:
    User:XIISUSER

  • Error when reading the ID of the business system from the SLD

    Hi,
    I am working on a scenario JDBC - XI - BW (ABAP Proxies). I configured all the steps required to connect XI & BW systems. The SLDCHECK transaction is all green. I was able to connect to SLD from BW using SXMB_IFR tcode too. I was able to look at all the XI Repository interfaces from SPROXY tcode in BW. Created a new ABAP proxy (class interface and method) for the message interface in XI from BW (SPROXY Tcode). Created all required config in XI Directory. Got the message from JDBC adapter, mapping done successfully, and the message failed in the CALL Adapter Step.
    The error is "Error when reading the ID of the business system from the SLD for system BWS and client 100."
    What could have gone wrong. Thanks in advance.
    Srini

    Hi,
    :::::::One Should Have the Following Roles AS A XI Developer With Out Admin Rights ::::::
    1) SAP_XI_Developer_ABAP +
    2) SAP_XI_Developer_J2EE  +
    3) SAP_XI_MONITOR_ABAP   +
    4) SAP_XI_MONITOR_J2EE    +
    5) SAP_SLD_ADMINISTRATOR +
    6) SAP_XI_BPE_MONITOR_ABAP +
    7) SAP_XI_DEMOAPP
    8) SAP_XI_DISPLAY_USER_ABAP +
    9) SAP_XI_DISPLAY_USER_J2EE +
    Regards
    Sesh

  • Having trouble reading a directory

    I'm trying to read all the filenames of a specific web directory for an online photogallery. The reading is done using a custom jsp tag, which creates a js variable with a list of all the picture names. My code works fine when reading from my own PC. For example reading all the names from "C:\Program Files" works perfect. The problem is that I get an error when I try to read from a web directory. Even "http://localhost:8080/test" gives me an error (since I thought it might have something to do with trying to access a directory outside of my domain.) Can anyone help me with the proper way to read a web directory? My code is below:
    if(name != null) {
                   StringTokenizer toker;
                   File f1 = new File(name);
                   File[] list = f1.listFiles(); //Get all files in the directory "name"
                   String files = "", fname;
                   for(int i=0;i<list.length;i++){
                        fname=list.toString(); //Turn filename into a string
                        toker = new StringTokenizer(fname,"\\"); //parse out the path before the filename
                        while(toker.hasMoreTokens())
                             fname=toker.nextToken();
                        files = files + "\"" + fname.substring(0, fname.length()-4) + "\","; //parse out the extension ".jpg"
                   files = files.substring(0,files.length()-1);
                   pc.getOut().write("<script type=\"text/javascript\"> \n var dirlist = new Array("+files+"); \n </script>"); //send the string of filenames to the client

    what is the error you get?
    Even "http://localhost:8080/test" gives me an error
    You are not passing that url to the File object are you?

  • Check when copying a directory finished

    Hi all!
    I've got an application that scans a certain directory permanently for new directories copied in it. When a new directory is found it starts a thread to process its contents. There is a pause between each check of one second, so moving the directory intendet to process works fine, since only a reference has to be changed, which goes pretty fast.
    Ok, fine so far. But i do need to physically copy directories too (program will run on servers and be fed by clients), but if the program encounters a new directory (whether its contents are already there or not) it immediately starts to process the content, whis is error prone.
    Now is there a java native, multiplatform solution to check if such a copying proces is finished?
    I have some solutions to bypass that problem in mind, but such a check seems to be the most elegant and comfortable way.
    Thx in advance

    you can copy the directory in to one directory in the same drive and then move the copy to the "inbox" of your application.
    By the way how this copying is done
    if that is done using a progam (which you can modify the source) you can make it send it some signel to your processing program with the name of the folder that is being copied. so toyr processing checking program can ignotre the folder untile another mesag is received to remove th folder from its exclude list.

  • When changing database directory in lk6.5, no alarms are logged anymore.

    When changing database directory in lk6.5, no alarms are logged anymore. Traces are running ok, only any query in MAX concerning alarms, will result in an empty response

    Hi Ryan,
    I tried many ways. First as you described. Second; delete all databases (with MAX) and start lookout, hoping lk would make al necessary settings.
    I tried short path name, long path name. All the same results; database will be made (or manually with Max or automatically by lk), all traces works, only NOT the Alarm logging. (database isn't corrupted, while a query done in MAX don't result in an error, just empty result).
    I the meantime I found something;
    C:\Documents and Settings\my name\my documents\Databse --> traces works, alarms not
    C:\Program Files\National Instruments\Lookout 6.5\Database --> all works
    So it seams that specificly "my documents" does'nt work for alarms, just for traces (????)
    I also found the following message when trying to export the alarms; "The given Citadel database is not currently configured to log alarms to a relational database." Does this ring a bell?

  • Have a  problem with Lightroom 5.4.  Since the program crashed yesterday it won't launch, it comes up with the message "Lightroom encountered an error when reading its preview cache and needs to quit".  "  Lightroom will attempt to fix this problem net ti

    Have a  problem with Lightroom 5.4.  Since the program crashed yesterday it won't launch, it comes up with the message "Lightroom encountered an error when reading its preview cache and needs to quit".  "  Lightroom will attempt to fix this problem next time it launches".  Except that it doesn't, I keep getting the same message and the program closes.  Does anyone know what I  can do to repair it?  Can't back up, can't do anything.

    There are dozens of threads in this forum that describe the fix

  • I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password pro

    I have created a PDF and password protected it for view. However, when reading the PDF in Adobe Reader app on the iPad the commenting and annotation options are not available. Is there a way to allow commenting and annotation in the app while password protecting the document?

    Is there a setting that needs to be set to allow the annotation features?  I set password protection to open and then password for editing and set it to Any except page extraction, but it still did not give the annotation option

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • Can not launch lightroom says error when reading its preview cache

    I can not launch Lightroom is puts up a error message that says it encountered an error when reading its preview cache and goes in to a loop that keeps closing the program
    I have restarted my comp 4 times same this each time
    I can't find any trouble shooting and when I try and download lightroom again it just puts me back at the creative cloud desktop which I can't click in anything

    You need to delete the preview cache. LR will automatically create new previews.
    Read here and here are the locations. Don't touch the *.lrcat file.

  • Lightroom encountered and error when reading from it preview cache and needs to quit

    A power outage caused my Lightroom 5.2 to shut down without closing.  When I powered back up and opened lightroom it gives me an error "Lightroom encountered and error when reading from it preview cache and needs to quit" and then it says it will try to fix it the next time it opens. I have opened it 20 times and it is not fixing it. I removed the program completely and upgraded to 5.5 AND it is still giving me the same error.  Is my catalog corrupt or something? I had it set to automatically load the most currently used catalog, so it is not allowing me to open or start a new catalog either. HELP!!!

    Search the forum, this has been answered many times.

  • Lightroom encountered an error when reading it's preview cache

    I been getting this error for over 2-3 months and thought it would go away with the new version releases, i tried all the standard fixes,deleting the catalog,compacting etc. even moving it to new folder, reinstalled the software twice.  The whole nine yards. IMHO, there's a problem with the software, it may be uique with differetent type of machine setup or a corrupt file in the in the catalog and the compacting doesn't fix it.
    The error always happens while in the develope and crashed, has to leave the software (sometimes it just hangs the software and you have to kill the task manually).  You have at least 10-15 seconds before going back in, otherwise it will still crash, a thread is still occuring from the orginal crash and still completing it's task. That's the error, annoying as heck.
    My only hoping is a new version of LR comes out soon (4.0) and it goes away, otherwise, I'm going to find something else-- driving me crazy, I spend about 10-15% of my time each week getting out and back in to make go away, then can go for a day(s) sometimes and no problems.  I tried recreating the problem on specific photos where I think it might be corrupt, that doesn't give any clue, there is no pattern to this at all, it happens randomly on new photos and old photos, yet i can go back to those photos again and no problems.
    Any NEW ideas would be appreciated (no compact, no new catalogs, new installs, turn off various options cache preview etc. move to new folder and more.....done that etc.).

    The error is exactly what's it in  the title of the post, Lightroom encountered an error when reading from its preview cache and needs to quit.  That's it.
    I don't know what else to tell you, i wish I had more.  This is all over the internet, I followed pretty much all the solutions, delete the catalog or delete the preview folders (tried both).  Tinker with the cachee preferences.   Most people kill the preview folders and the catlog gets recreated and there problem is resovled, doesn't work for me.
    No cloning, totally two different catalogs (not networked etc.)  a good question though.
    When I am refering to catalog and cache, I strictly talking about LR only, nothing outside of that or in the operating system, just LR files only, here they are:
    I  have a   LR catalog folder called--->   C:\Users\Mark\Documents\LightRoom Catalog\LR_Catalog
    you have another folder called: LR_Catalog Previews.lrdata   (with many subfolders underneath at)
    and I have LR catalog filein C:\Users\Mark\Documents\LightRoom Catalog\LR_Catalog
    LR_Catalog.LRCAT
    That's it, a file and a folder with many sub-folders.  I'll get a screen print with error next, but it's basically what I said earlier in the beginning, you can be in develope or even the library, and error occurs in a message box, you hit ok and the application exits. On average it can happen 6-7 times with an hour and sometimes not at all, working with same the photos.  Sometimes it can happen within mintues, sometimes not at all for over 2 hours.  There is no specific pattern to it. 

  • I'm unable to open up Lightroom 5, I get this message in a pop up box: "Lightroom encountered an error when reading from it's preview cache and needs to quit" Underneath  that is "Lightroom will attempt to fix this problem the next time when it launches."

    I'm unable to open up Lightroom 5, I get this message in a pop up box: "Lightroom encountered an error when reading from it's preview cache and needs to quit" Underneath  that is "Lightroom will attempt to fix this problem the next time when it launches."  It hasn't, what should I do? Thanks Shawn (Irish Se7en) .

    Can you try to rename (not delete!) the folder named "YOUR_CATALOG_NAME Previews.lrdata" and restart Lightroom?

Maybe you are looking for