JDeveloper: unable to locate properties file
Hello Experts,
I'm working with JDeveloper11R1, and I need to load some information from a properties file.
I copied the file config.properties both on the WEB-INF directory and in the com/project/ directory, but when trying to load with a class positioned also in the com/project directory..
Properties prop = new Properties();
try {
prop.load(new FileInputStream("config.properties"));
OR
prop.load(new FileInputStream("/config.properties"));
OR
prop.load(new FileInputStream("/com/project/config.properties"));
OR
prop.load(new FileInputStream("/WEB-INF/config.properties"));I all the above situations I get the file not found error:
java.io.FileNotFoundException: /com/project/config.properties (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at com.project.Loader.<init>(Loader.java:35)
at com.project.Loader.main(Loader.java:133)
Process exited with exit code 0.
I guess that I should configure the Classpath in JDeveloper, but also loading the Directory from "Project Properties - Library/Classpath" it doesn't work.
Could you please help?
Thank you
Hi Leyla,
Try using ResourceBundle instead of Properties:
ResourceBundle rb;
try {
rb = ResourceBundle.getBundle("com/project/config");
...This should work if your config.properties file is in com/project/ directory.
Similar Messages
-
UNable to locate Properties files from Servlets
I have a Web App deployed in the default domain (domain1)that contains a servlet which needs to read in values from a .properties file from the filesystem. However, whenever I try to use it, I always end up with a FileNotFoundException.
I tried keeping the properties file in the d:\Sun\AppServer7\bin as well as d:\Sun\AppServer7\domains\Domain1\server1\bin and still get the same exception.
Can anyone tell me where I need to keep the .properties file? FYI, I have deployed the same on Tomcat 4.x and the same app worked perfectly (with the prop file in d:\tomcat4\bin directory).
Thanks,
ChetanTry the instance config directory. In your case, this is probably D:\Sun\AppServer7\domains\domain1\server1\config.
-
Unable to locate image file in pixmap_path: "foo.bar"
I was trying to install fbpanel, after succesfully installing it i got this eror when trying to run it via the terminal.
This is the whole output of the fbpanel command:
$ fbpanel
/home/simplemind/.gtkrc-2.0:2: Unable to locate image file in pixmap_path: "foo.bar"
/home/simplemind/.gtkrc-2.0:3: Unable to locate image file in pixmap_path: "foo.bar"
/home/simplemind/.gtkrc-2.0:4: Unable to locate image file in pixmap_path: "foo.bar"
/home/simplemind/.gtkrc-2.0:5: Unable to locate image file in pixmap_path: "foo.bar"
/home/simplemind/.gtkrc-2.0:6: Unable to locate image file in pixmap_path: "foo.bar"
volume: can't open /dev/mixer
fbpanel: can't start plugin volume
Can anyone help me with this ?
thanks for the helpYes, google, or our wiki. Don't be a help vampire. The forums are here to help, but you should first try to search. And either a google or wiki search with anything related to logind would get you just what you are looking for. (edit: this is not to say your original question wasn't a good one. It did tell you the file name and line number, you should use those to check the file yourself, but it was a fair question. I'm referring here only to the logind followup)
However, if being in the audio group doesn't help, neither will having a valid logind session. Do you have a /dev/mixer? When a program says it can't find a file, check to see if that file exists.
I have no /dev/mixer. But I did do a google (actually duck duck go) search with site:archlinux.org for this and the first entries were to threads on this forum with the exact same volume plugin issue you're having for fbpanel - and those threads have the solution.
Last edited by Trilby (2013-07-17 15:32:39) -
Upon Preview View: "Unable to locate the file."
When clicking on the Preview View icon with an ebook selected in the View pane, I get the error message "Unable to locate the file. This item has been moved, renamed or deleted". This happened after I created collections, and dragged books from the Library into the collections.
The link below will provide the information needed to resolve the current Sony Reader issue you are experiencing.
http://www.kb.sony.com/selfservice/micr ... 0203266040 -
Unable to locate message file: ldap language .ms
Hi,
i have OAS10.1.2.0.2 installed on RHEL4
i somehow locked orcladmin account so i am not able to logon into SSO.
i tried the following
i went to the oidpasswd tool directory and executed the following
[orace@... bin]$ oidpasswd connect=orcladmin unlock_su_acct=TRUE
but i keep getting the follwoing error:
"unable to locate message file: ldap<language>.ms"
what should i do to fix this error.
Someone please guide me.
Thanks,
Philip.Thanks for the reply.
this is what i did.
i have 2 disks inmy RHEL box.
I have 3 directories
/home/oracle where i have my user "oracle" account
and then i installed OAS on the following directories
infrastructure - /ora2/AS101202infra
midtier - /ora2/AS101202BI
now this is how my /home/oracle/.bash_profile file looks like
------ .bash_profile------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_HOME=/ora2/oracle/AS101202infra; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/local/bin;
export $LD_LIBRARY_PATH
ORACLE_SID=asdb; export ORACLE_SID
PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/ldap/mesg
export PATH
ORG_PATH=$PATH
export ORG_PATH
unset USERNAME
but when i do a sqlpus or any other command, i get error saying set your ORACLE_HOME to oracle software directory.
als when i open a terminal and type in "su - oracle"
I get the following error
-bash: export: '/ora2/AS101202infra/lib:/lib:/usr/local/bin': not a valid identifier
Check whether $ORACLE_HOME/bin/ldapbind exists
Yes ldapbind exists
Does $ORACLE_HOME/ocommon/nls/admin/data/lx1boot.nlb exist, and is it readable?
i dont see any folder called "occomon"
Is the output of
% type ldapbind
$ORACLE_HOME/bin/ldapbind?
i typed in
[[email protected]]ldapbind
and i got result as
"bind successful"
i dont get any message like " $ORACLE_HOME/bin/ldapbind"
Philip. -
Unable to locate downloaded file on computer ecobutton.exe.
Hi.
I recently purchased an ecobutton program (which is an .exe file) Following download which was supposedly successful I am unable to locate the file.
Any help would be welcome
Thank youYup...I also have the same problem with you...Can anyone of you can solve the problem?
-
Unable to locate message file: ldap language .msb
Hi
I am trying to start OID using the command
./oidctl start
But i get the error
unable to locate message file: ldap<language>.msbIf you are running on a Linux box (and it looks like you are from the command), first check your $PATH variable and make sure that the Oracle stuff is at the front, here is my path:
/as/oracle/infra/bin:/as/oracle/infra/opmn/bin:/usr/bin:/usr/kerberos/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin
So just make sure your path is correct first then post your results. -
Itunes is unable to locate original file when attempting to play music. Songs are in the itunes media file and playable direct from there. Preferences/Advanced file location pointer is correct. Some songs play but most don't. I did move files around a bit in an attempt to share music with another account on same computor, however this did not work so have returned file to original location. Please help, I am way outside my feild in this one. Ta.
I have solved the problem. i think when I moved the media file back out of public to my account, I put it back into the wrong place and ended up with a media file inside a media file, inside another media file!! So I moved it again and fixed!! Now I just need to work out why i can't share with another account user of same computor.
-
ITunes unable to locate music files saved on external drive
Hi all,
This is proabably something incredibly simple but my iTunes was installed on to my laptop wih music added till my memory was all used up.
So I bought an external drive, and re-added all my music saving it to the external drive, my iTunes however remained installed directly on my laptop.
This worked fine initially as long as my external drive was selected in the Preferences section of my Itunes, but recently all my albums are available but it says that Itunes is unable to locate the files, even though none of them have been lost or deleted from the external drive.
Ive tried everything I can think of - does anyone know how to rectify this?
Thanks....I switched computers and tried to reload all my backed up itunes files. It loaded the files fine the first time. After I logged off the files disappeared from my Itunes. Apple tech told me to add itunes folder to library. It worked fine until i logged off again. I tried it several times because my files never stayed on itunes. Finnaly I added two new CD's into my library and I went to file Libray and I entered consolidated Library. This brought everything I had before and then some to my itunes library. I logged off, shutdown and even hibernated and my files still remain. I was able to create playlist, my movies, podcast, there all there. Hope this helps.
-
Can't locate .properties file on Visual Admin
Hello,
I have created an RID.properties file inside a DynPro application under src/packages/... and I am able to load it and get it's attributes from the DynPro code.
So far so good...
As far as I know this properties file can be viewd and modifed on the Visual Admin under:
Configuration Adapter -> webdynpro...
I've browsed all the folders at this location and couldn't locate my .properties file. So where is it...?
Royi think you only want to access and maintain the properties on server side...
ok, check out
http://help.sap.com/saphelp_nw04/helpdata/en/b8/aa343e32ff1033e10000000a114084/content.htm
for an example how to access the properties from your wdp app.
i suggest loading all props into a specific context node and corresponding attributes. perhaps there are better ways.
Now sth. uncomfortable:
Be careful when you redeploy your app. All properties are overwritten with the ones you defined locally.
you also cant delete the config on local side, it would be deleted on server, too. (at least i think so) -
In my library, many listed songs, when activated to play, give a message "unable to locate file, do you want us to search for it?". If you say yes, it never finds it, as it the songs are gone. Any thoughts on what's going on?
This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes.
tt2 -
All my purchased songs from Itunes says unable to locate original file
all of my songs purchased from itunes say unable to locate original file
Did you recently move any files around on your computer. iTunes looks for the files in the original location; if they are moved this can create problems. One possibility is to right click on one of the songs with an exclamation point, and the go to "Get info." This will open a pop-up window that has several tabs.Click on "Summary." At the bottom of this screen, there is a section that says "Where:" This is the path of the original file. Check that location and see if the file is located there (probably not, or you wouldn't get the warning).
Next, I would search Windows for the particular song. Assuming that you find it somewhere, I would bet that is where the rest of the missing files now reside. -
ITunes Unable to Locate Music File
I have a few hundred songs in iTunes that have been loaded over the years. Their source is CD's and iTunes. Tonight on an airplane, I was listening and noticed that I had red circles with red squares inside of them next to song titles. When I selected these, they were not available. This happened more and more as i selected different songs, eventually I was left with just a handful of songs. Immediately when I got home, I snyched to my computer and it said that there were items unable to synch because iTunes was unable to locate the original file. (it did restore a few but still over 100+ missing files). The titles are still listed.
However, I am unable to play any song in itunes on my computer. Just on my iPhone. When i ask it to loacte it directs me to a catroot file from 2009???
I have not added or removfed songs in weeks and it has been working fine (iPhone and computer) for months.Any help in finding these files or restoring them would be appreciated.Use the iTunes command File > Add Folder to Library, and navigate to the folder containing the music.
-
Unable to load properties file from filesystem
Hi,
I have a client swing-applicatiion packaged in a jar-file. The application uses some resource files, including a xxxx.properties file to set defaults for the application. All resource files are included in the jar file and everything works as expected. I load the xxxx.properties file as follows:
is_ = getClass().getResourceAsStream("/resources/xxxx.properties");
Because it is not possibl to change any property values inside the jar-file without recreating this jar-file, i want to exclude the xxxx.properties file from the jar-file and put it in the folder containing the jar-file.
So i have:
drive:/folder/app.jar
drive:/folder/xxxx.properties
Now i read the xxxx.properties file from disk in stead of the 'resouce'-folder within my application (jar):
is_ = getClass().getResourceAsStream("drive:/folder/xxxx.propoerties");
but it doesn't work, the file isn't found.
What am i missing here?
Any suggestions?The best way to approach this is to include the properties file in the Jar as you originally did. If the user changes any property, save the entire set of properties to a sub-directory of user.home (perhaps based on the package name of the main class). Check for the copy in user.home before using the 'default' properties built into the Jar.
Other places/ways to store the changed information.
- java.util.prefs.Preferences
- Assuming the app. has a GUI and can be deployed over a network, the JNLP API PersistenceService. Here is a demo. of the PersistenceService (http://pscode.org/jws/api.html#ps).
Edit 1:
I did not at first notice that this post was in Java Applet Development.
<li> Applets can also (theoretically) use cookies to store information. This is prone to failure when users disable cookies.
<li> To store information on the local file system (e.g. in user.home) or to use Preferences (AFAIU) would require trusted code.
<li> If the user has the Next Generation Java Plug-In (Java 1.6.0_10+) it is possible to leverage the JNLP API services in an embedded & sand-boxed applet.
Edited by: Andrew Thompson on Feb 1, 2011 9:32 AM -
Unable to find properties file in jar
I have a jar file that looks like this from contents stand point
c:> jar vtf csdsutility.jar
0 Mon Oct 24 10:04:58 EDT 2005 META-INF/
71 Mon Oct 24 10:04:58 EDT 2005 META-INF/MANIFEST.MF
2633 Fri Oct 21 17:04:44 EDT 2005 csds/utility/JavaLogging.class
1621 Fri Oct 21 17:04:42 EDT 2005 csds/utility/Logging.class
868 Fri Oct 21 17:04:42 EDT 2005 csds/utility/LoggingMethod.class
3204 Fri Oct 21 17:04:44 EDT 2005 csds/utility/TestLogging.class
3004 Fri Oct 21 17:04:44 EDT 2005 csds/utility/Utility.class
1142 Fri Oct 21 17:04:44 EDT 2005 csds/utility/WSLogging.class
83 Tue Jul 26 21:59:26 EDT 2005 csds/utility/javalogging.properties
If I include the jar file above in some other program it should find the
javalogging.properties file correct? It's failing in the common code trying to find the properties file. I created a small driver that tests the common code and it is fine it just does not work off the jar file. Is there something weird about jar files and property files I don't know about? I thought when you included them on the java -classpath line it was like that code was part of your application and the path followed also.
Thanks,
FrankAre you using method getResourceAsStream? If so don't forget to properly add (or not) an "/" to the resource name as stated in Java API docs: if the resource name starts with "/", it is unchanged; otherwise, the package name is prepended to the resource name after converting "." to "/".
Maybe you are looking for
-
In Google Scholar, the "Import to EndNote" link now generates an error ========= Download Error <<Filepath>> could not be opened, because an unknown error occurred. Try saving to disk first and then opening the file. ========= Screenshot here - www.i
-
i tried to log in on my iphone, but it doesnt let me in, not even on my computer, i know my password and my id account, yesterday i deleted my device from "find my iphone" thats the only thing i did
-
Needs help in SQL (problem brought me to headache)
I wonder to display overdue report, how do i make use of SQL method to search the DATE data in my database was overdue?? i try this method b4.. but it wont work!! TodayDate = new Date(); dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT); T
-
Always cash discount term 1 for debt memos
Hi Guru, In the coding for the automatic payment program, if the document is a Customer Invoice, the first condition of the payment term will always be selected. Therefore discount is always taken even after the discount term is expired. See the fo
-
Any help would be greatly appreciated