Help, could not read properties after setting the RMISecurityManager.

Hi,
I am new in RMi and I could not read a properties file when run a class in jar file with java -jar option.
I start the the class by as follows.
java -jar darwin_enhanced.jar -Djava.rmi.server.codebase=file:///home/wing/Darwin/Project/release.server/DarwinServer.jar -Djava.security.policy=darwin.server.policy
I extract the following code snipplet from the main class.
/* get security manager */     
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
/* get properties */     
Properties properties = new Properties();
try
System.out.println("before happy");
properties.load(getClass().
getResourceAsStream("/darwinServer.properties"));
System.out.println("after happy");
}catch (Exception e)
e.printStackTrace();
If the System.setSecurityManager(new RMISecurityManager()) is called before the properties.load method, the pgm prints out
'before happy' and dumps
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:80)
at java.util.Properties.load(Properties.java:189)
at com.darwin.server.DarwinServer.startBind(DarwinServer.java:61)
at com.darwin.server.DarwinServer.main(DarwinServer.java:48)
If I reverse the order, call properties.load mehod before setting the RmiSecurityMananger,
/* get properties */     
Properties properties = new Properties();
try
System.out.println("before happy");
properties.load(getClass().
getResourceAsStream("/darwinServer.properties"));
System.out.println("after happy");
}catch (Exception e)
e.printStackTrace();
/* get security manager */     
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
it works fine and print out
'before happy'
'after happy'
Thanks,
Wing

Hi,
Thanks for your ideas.
My primary object is to let the server reads propertiy files. I found that I have to set the RMISecurityManager, otherwise, the rebind will throws
java.rmi.UnmarshalException.
I have changed the testing program according to you inputs.
void startTest(){
System.out.println("CodeSource="+this.getClass().getProtectionDomain().getCodeSource());
System.out.println("Permission="+this.getClass().getProtectionDomain().getPermissions());
if(System.getSecurityManager()==null)
System.setSecurityManager(new RMISecurityManager());
Properties properties = new Properties();
try
System.out.println("CodeSource="+this.getClass().getProtectionDomain().getCodeSource());
System.out.println("Permission="+this.getClass().getProtectionDomain().getPermissions());
properties.load(RMIClassLoader.getClassLoader("file:/").getResourceAsStream("sample.properties"));     
System.out.println("size of properties = " + properties.size() );
properties.load(getClass().getResourceAsStream("/sample.properties"));
}catch(Exception e)
e.printStackTrace();
I run in jar with the following command with no exception,
java -Djava.security.policy=java.all.policy -jar simBug.jar
Output
CodeSource=(file:/home/wing/try/java/bug.sim/RMISecurityManager/simBug.jar <no certificates>)
Permission=java.security.Permissions@8d107f (
(java.lang.RuntimePermission exitVM)
(java.io.FilePermission /home/wing/try/java/bug.sim/RMISecurityManager/simBug.jar read)
CodeSource=(file:/home/wing/try/java/bug.sim/RMISecurityManager/simBug.jar <no certificates>)
Permission=java.security.Permissions@8d107f (
(java.lang.RuntimePermission exitVM)
(java.io.FilePermission /home/wing/try/java/bug.sim/RMISecurityManager/simBug.jar read)
size of properties = 1
Thanks,
Wing

Similar Messages

  • Help~~~Could not find Agent_OnLoad function in the agent library

    $ java -agentpath: /home/work/libtest.so SimpleTest
    Error occurred during initialization of VM
    Could not find Agent_OnLoad function in the agent library:
    I'm very sure libtest.so and Agent_OnLoad function are exist.
    thanks
    nowonder

    Yes, this is 32bit version. 64bit looks like this:
    java version "1.5.0_10"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_10-b02, mixed mode)Bye,
    Tomas Hurka

  • Error Message: Could not read this files because the plugin could not recognise the file

    It wont let me open a file I saved yesterday? What does this error message mean & how do I fix it?

    WHich version, which system?
    What's in the file?
    Where is the file saved?
    Have you already tried:
    - a restart
    - re-creating the prefs file?

  • Installed CS5, now can't export from CS4! Help! "Could not read from the source..."

    I installed CS5 but completely ignored the fact plugins were required to be 64-bit. It'll be months before the plugins I require for my projects to be updated!
    So I continued editing in CS4 and when I attempted to export with the media encoder it halts instantly with an exclamation mark, the log says :
    "Could not read from the source. Please check if it has moved or been  deleted."
    And yes I'm not stupid, I did my research.
    I tried uninstalling CS4 and reinstalling. I tried the shortcut fix. I tried moving my cache files. My extensions are correct.
    Right now the only fix seems to be completely removing CS5 and CS4, After Effects just because they share files (?) and all my settings and plugins along with it! I'd rather NOT do that if I can!

    Good detective work, and glad that it worked. Now, your cure will be here for us to link to and for others to find. Your title will help direct others to this thread. Job well done.
    Thanks,
    Hunt

  • The Outlook links do not connect to Firefox even after setting the customize option in Default Programs. Please help.

    The''' Outlook links do not connect to Firefox '''even after setting the customize option in Default Programs. Please help.

    Message to Toad-Hall
    Thank you, for that. To be sure, I tried your suggestion, and selected "System Proxy" as the choice, for Thunderbird and Firefox. Rebooted, and looked at the outcome.. NO Joy.. :-(
    I believe that I shall send the output of the Error Log in my next post. Perhaps someone can point me in the right direction after looking at the Error.log.
    Thank you...Toad Hall. If you think of something else to try, I am ALL ears.. I shall keep trying..

  • Hi, my iphone could not be activated after upgrade it from IOS4 to IOS6, it shows that is due to activation server is unavailable and no sim card in the iphone. Anyone can help me please?

    Hi, my iphone could not be activated after upgrade it from IOS4 to IOS6, it shows that is due to activation server is unavailable and no sim card in the iphone. Anyone can help me please?

    It is 99% hacked/jailbroken iPhone to use a different carrier than intended. You have to put the sim from the original carrier or ask them to unlock the iPhone. We as well as Apple cannot help you with this.

  • Whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    Did you reinstall CS3 after CC?
    For that matter, doing an in-place upgrade on the OS is always a gamble with Adobe programs. Reinstalling all the versions you need, in order, would probably solve your problem.
    And you shouldn't need to save as IDML after opening the .inx in CC.

  • Error: Could not read reports properties.  java.lang.NullPointerException

    Hi All,
    I am facing Could not read reports properties. java.lang.NullPointerException while trying to run the report using below string
    String:_
    /rcrmap2/weblogic/bea/ORA_PFRD/bin/rwrun module=/rcrmkr1/exe_dir/CA_PG1_T.rdf CUSTGRPID=''001139'' CANO=104 CACOPY=''F'' OPTION=''W'' CCODE=''KR'' USERID=apl_D_RCRMNIU3/Q5e3C4l1FPjrG6epG6f3C4dqFMgsDP@krcrmd DESTYPE=FILE DESNAME=/rcrmkr1/crms_RG/rep_dir/gcapg1_to_test_20110112_121902.rep BATCH=YES MODE=CHARACTER DESFORMAT=/rcrmap2/weblogic/bea/ORA_PFRD/reports/printers/wide.prt pagesize=132x80
    Environment Variables :*
    export ORACLE_LOCALPREFERENCE=/rcrmap2/weblogic/bea/rcrms/config/FRComponent/frcommon/tools/admin/
    export WIDE_DEF=/rcrmap2/weblogic/bea/ORA_PFRD/reports/printers/hplwide.prt
    export WIDE_VIW=/rcrmap2/weblogic/bea/ORA_PFRD/reports/printers/wide.prt
    export REPORTS_FONT_DIRECTORY=/rcrmap2/weblogic/bea/rcrms/reports/fonts
    export REPORTS_TAGLIB_URI=/WEB-INF/lib/reports_tld.jar
    export REPORTS_NO_DUMMY_PRINTER=TRUE
    export REPORTS_TMP=/tmp
    export RW=/rcrmap2/weblogic/bea/ORA_PFRD/reports
    export LD_LIBRARY_PATH=/rcrmap2/weblogic/bea/ORA_PFRD/jdk/jre/lib/ppc64:/rcrmap2/weblogic/bea/ORA_PFRD/jdk/jre/lib/ppc64/classic:/rcrmap2/weblogic/bea/ORA_PFRD/lib:/usr/dt/lib:
    export LIBPATH=/rcrmap2/weblogic/bea/ORA_PFRD/lib:/usr/dt/lib:/rcrmap2/weblogic/bea/ORA_PFRD/jdk/jre/lib/ppc64:/rcrmap2/weblogic/bea/ORA_PFRD/jdk/jre/lib/ppc64/classic:/usr/lpp/cobol/lib:/oracle/oracle/11.1.0.7/lib:/oracle/oracle/11.1.0.7/lib32:/rcrmkr1/exe_dir/pvcs_12july/pco:.
    export LDR_CNTRL=USERREGS@MAXDATA=0x80000000
    export TK_ICON=/rcrmap2/weblogic/bea/ORA_PFRD/reports/plugins/resource
    export REPORTS_DEFAULT_DISPLAY=NO
    export REPORTS_CLASSPATH=/rcrmkr1/exe_dir:/rcrmap2/weblogic/bea/ORA_PFRD/reports/jlib/rwbuilder.jar:/rcrmap2/weblogic/bea/ORA_PFRD/reports/jlib/rwrun.jar:/rcrmap2/weblogic/bea/ORA_PFRD/jlib/zrclient.jar:/rcrmap2/weblogic/bea/ORA_PFRD/modules/oracle.jsp_11.1.1/ojsp.jar:/rcrmap2/weblogic/bea/ORA_PFRD/javacache/lib/cache.jar:/rcrmap2/weblogic/bea/ORA_PFRD/modules/oracle.javacache_11.1.1/cache.jar
    Please help to provide your inputs
    Regards,
    Harish

    Hi,
    The problem was resolved by setting proper acl's to the corresponding directories (cache directory) in the application server
    Regards,
    Harish

  • Media Encoder crash in CS6. Could not read from the source. Check if it has moved or been deleted.

    I'm having a problem getting Media Encoder to get past the dynamic link portion of encoding a time line sequence.
    I can send it over to Media Encoder, but it crashes consistently after the yellow bar saying something about dynamic link.
    I have CS6 installed in my computer here at work, it previously had CS5.5 installed on it.
    I read some answers about CS4 having this problem and tried to create a shortcut and put it in the dynamic link folder, but that didnt work.
    I would hate to have to reinstall the software here at work as the IT department is a pain- but I can't encode video on one of the computers we use here.
    Any ideas on what may be happening and how I can solve the problem?
    Thanks!
    Its a Dell Workstation with Windows 7 Ultimate installed dualE5620 processors at 2.4GHz. .
    only 6 GB RAM, and a RAID 5 hard drive setup with 3- one gb drives giving the C drive space of 1.8Gigs
    Its got an NVIDIA Quadro NVS 420 video card.
    I'm upgrading this computer to better work with editing video, so this is a good time to get this all cleaned up.
    Im adding RAM (24GBs)- replacing the video card to a GTX 780 3GB running 3 monitors.
    I'd also like to either split up the RAID (ugh)..or just add 2 internal SAS HDDs. to split up the video and the cache and the OS/programs as is usually done with editing video.
    Thanks for your help in advance...
    Mike

    ...more information...problem still not solved....
    After searching more in the forums, I tried a couple more things:
    I tried to restart AME and clearing the preferences. This didnt help.
    I also deleted the ...appData/Roaming/Adobe/AdobeMediaEncoder/6.0 folder and all subfolders   No help here either.
    I also tried to import the sequence via AME rather than export via PP. This worked. The sequence loaded immediately and processed perfectly.
    When I export via PP, I hit the queue button, it hangs for about 3 mins, then the yellow bar appears saying "Connecting to Dynamic Link server"
    it then hangs for approx 3 mins again and then I get the Failed alert.
    the error log reports:
    Encoding failed
    Could not read from source. Please check if it has moved or been deleted.
    any help available here????

  • CS5 RAW Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw. Please visit the Camera Raw help documentation for additional information.

    I rented a Nikon D600 & D610 and CS5 cannot open the RAW files, i do not have any issued with my D700 RAW files. I am getting this error message -
    Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw.
    Please visit the Camera Raw help documentation for additional information.
    Can anyone please help?

    yellowmledbetter wrote:
    Sorry, I am on a MAC. I downloaded the link you provided and it's giving the same error message as above. Running CS5.
    The error message you gave is from Camera Raw. I thought you said that DNG Converter didn't work?
    The link I gave you is an article on getting your raw files to open in Camera Raw. Did you read it? I lazily gave you the link because this is one of the most common problems in this forum, and I get tired of saying the same thing over and over again. I could break it down for your specific case, but I was hoping you could read through the article and work it out for yourself.
    But, here goes:
    Your cameras are newer than your raw converter, so it won't understand them.
    CS5 comes with Camera Raw 6, which can only be upgraded as far as 6.7.1. You can find out which version of Camera Raw you are running in three ways: in the settings title bar (Cmd-K), in the plug-in title bar (press F to start/stop full-screen mode to reveal the title bar), or Photoshop's Help menu (About Plug-ins).
    Downloading raw files from newer Nikon cameras with old versions of Nikon Transfer will actually make them unreadable in Adobe software. They can be fixed with a free utility. Again, it's all in the linked article. You should be using up-to-date Nikon Transfer, or Adobe Photodownloader to avoid this problem.
    All being well, you have good raw files on your computer. You can convert them to dng using Adobe DNG Converter. IF you are on OSX Leopard or Snow Leopard, you CAN'T use the latest version, because Adobe stopped support. But, if you ARE on a later OSX, you can download DNG Converter 8.6.
    DNG Converter is designed to convert FOLDERS of raw files at a time. You select a folder of raw files, and tell it to create DNG copies. BUT, you have to set up the converter before you start using it...
    If you load up DNG Converter, you'll notice a button labelled "Change Preferences". Clicking this, you'll see the first option is "Compatibility". Here, you must select the appropriate setting for the version of Camera Raw you HAVE (see above). If you can't work this out, just pick "Camera Raw 5.4 and later". THEN pick a folder of raw files and convert them to DNGs.
    All the above is already in the article, but I gave you a personalised response. If you still can't get it to work, please give us more than one sentence. Tell us exactly what you tried, and describe exactly what happened. Which version of OSX you're running, what device and software you downloaded your raw files with, how you used DNG Converter, and so on.
    I really should be in bed.

  • ITunes could not copy "insert song" to the iphone "insert name of iphone" because the file could not be read

    It's about time i posted something about my problem because i've searched everywhere and I did not get the answer i wanted.
    When i try to put a song (Drag and Drop) from my Library to my Iphone, the message "iTunes could not copy "insert song" to the iphone "insert name of iphone" because the file could not be read" shows up. I have no idea how to fix this, I haven't seen apple answer to a single one of these threads either.
    I've only seen users try to answer this question.
    Anyways, when i put the songs on my Iphone, it is also grayed out. There is also a dotted circle (symbol) beside the checkmark of the song.
    I've tried creating a AAC version of all the songs already. No luck
    Please help
    meetobin

    Two possibilities come to mind.
    Check your source hard drive for errors, right-click on the drive holding the library, click Properties, tools, check for errors, scan for and attempt recovery of bad sectors...
    Or...
    Repair Security Permissions
    Right-click on your main iTunes folder and click Properties, then go to the Security tab and click Advanced. If necessary grant your account and SYSTEM full control of this folder, subfolders and files, then tick the option to replace permissions on child objects which will repair permissions throughout the library. This is the XP dialog but Windows 7 shouldn't be too different.
    If it won't let you change the permissions use the Owner tab to take ownership from an account with administrator privileges.
    tt2

  • Could not read the profile path for user S-1-5-21-1272265863-3531003469-187

    hi
    I was doing the installation of the crm702 on MAXDB+WINDOWS.IN THE FIRST PHASE OF EXECUTION(CREATE USERS FOR SAP SYSTEM) I GOT THE ERROR MENTIONED BELOW.CAN SOMEONE HELPE ME    :
    An error occurred while processing option Enhancement Package 2 for SAP CRM 7.0 > SAP Application Server ABAP > MaxDB > Central System > Central System( Last error reported by the step: Could not read the profile path for user S-1-5-21-1272265863-3531003469-18741865-1021 from the registry: The system cannot find the file specified. .). You can now:
    Choose Retry to repeat the current step.
    Choose Log Files to get more information about the error.
    Stop the option and continue with it later.
    Log files are written to C:/crmfeb.

    Hi,
    Delete all keys in registry (regedit) with: S-1-5-21-1272265863-3531003469-18741865-1021. You can do it by find it - F3.
    After that restart sapinst.
    Regards.

  • Encoding Failed- Could Not Read from the Source

    I have a quickly approaching deadline for the short film I am working on, and it would be greatly appreciated if anyone knew anything of my predicament.  Everytime I try to export anything from Premiere Pro (CS4 of course), when I start the queue it says "Could Not Read from the Source.  Please check if it has been moved or deleted."  The files, of course, have not been moved or deleted, and the raw footage for the film is in the same place as everything else.  All my scratch disks are set to the same folder, etc.  I don't understand, and it won't even let me export to my camera.  It says it does, but when I check my camera, it's nothing but blank tape.  Any (quick) help would be very much appreciated!
    Thank you.

  • CS4 Pr-Encoder: "Encoding failed/Could not read from the source..."

    When i start queueing it apears to be loading fine but then after a few minutes it gives me the yellow hazard triangle on the status column. I have tryied changing settings and still the same.
    "Could not read from the source. Please check if it has moved or been deleted."
    ...is what the details notepad displays
    This is my first Pr CS4 editing, Please help.
    Thanx!

    latest versions of CS4 and snow leopard 10.6.1.
    May have no part in your problem, but many are having real issues with almost anything Adobe with Snow Leopard. There has been a lot of chatter saying that Apple is aware of this, and is working on an OS update to be released soon.
    While I have not seen this particular issue with Snow Leopard, there have been so many more, that I'd certainly put the OS into the list of "usual suspects." In the Encore forum, some had great success by rolling back the OS to whatever was prior to Snow Leopard, just plain old "Leopard?"
    Wish I had a definite cure for your ills, but the best that I can offer is that it does not seem that you are alone.
    Good luck, and I hope that the Mac OS update does fix things for you.
    Hunt

  • Could not read reports properties

    I am compiling reports with 11.1.1.3.0 on Solaris and keep getting the message: "Could not read reports properties". The RDFs do get to converted to REP files, so it appears to be just a warning message.
    The error appears to be a file privilege issue since if I use the oracle account the message goes away, but if I use my personal account I get the message.
    So what is the name of the file it is looking for? I had assumed prefs.ora; but I have already granted my personal account access to all of them.
    Thanks

    I will tell you that I had several errors when I migrated to 11g last month, the solution for all of my problems was upgrade to:
    Forms & Reports 11.1.1.4 and weblogic 10.3.4.
    its not difficult, it takes me 70 minutes to do it. after you do upgrade I bet you wont have this problem.
    cheers.

Maybe you are looking for

  • NTSC 24P to HD

    I just finish a new documentary that I shot in NTSC 24P (Panasonic DVX-100A) and need to trasfered to HD 1080i/60i. How is this done, are they better machines than others or is a simple computer procedure? I am right now in Buenos Aires, Argentina bu

  • Availability check in SD

    Hi ALL, I have a typical scenario. My main plant is supplying a material to other plants through STO. The main plant also has its own requirements. The requirements in other plants as wel as that of main plant are entered as planned independant requi

  • Messaging Multiplexor

    We are running SunOne Messaging and Directory (Both version 5.2) We have a multiplexor/front-end server on a DMZ to enable access from the internet. The problem is the first time that you logon nothing happens. From the logs the last thing that you s

  • HT3529 where are you smiley faces and symbols for texting on the iphone 5c?

    Where are the smiley faces and symbols for texting?

  • Cisco AnyConnect Secure Mobility Client 3.0 Start Before Logon PLAP

    This documentation says enabling this "FORCES" this logon method. http://www.cisco.com/en/US/docs/security/vpn_client/anyconnect/anyconnect30/administration/guide/ac03vpn.html#wp1134595 If it is forced, that means the user can only access VPN from a