AccessControlException using JAAS under 1.4. But it works under 1.3

We're building a client/server Java application using Java 1.3.1_02. Client authentication is done by JAAS. When running client and server under 1.3 everything works fine. Now we want to run our application using 1.4.2_02 (still doing the build with 1.3.1_02). Accoding to Java's backwards compatibility this should be no problem. But there is a problem.
The client logs in via JAAS on the server and gets a javax.security.auth.Subject instance, which is then passed again to the server to get the associated permissions (this is done by an Authenticator class):
        Subject subject = login(startupFrame);
        Authenticator authenticator
                = ProxyFactory.getInstance().getAuthenticator();
        Identity.setPermissions(authenticator.getPermissions());The login itself works, the problem is the call of getPermissions. There's an AuthenticatorImpl class on the server whose getPermissions method is to be called. This class is wrapped by an RMIObjectWrapperImpl class which has an invokeMethod method. This method is called via rmi (client->server) by the client and looks like this:
    public final Serializable invokeMethod(final String name,
                                           final String[] typeNames,
                                           final Serializable[] params,
                                           final Authentication authentication) throws ... {
            final Subject subject = new Subject();
            final Set principals = subject.getPrincipals();
            principals.clear();
            principals.addAll(Arrays.asList(new AuthenticatorImpl()
                    .authenticate(authentication)));
            Policy.getPolicy().refresh();
            return (Serializable) Subject.doAsPrivileged(subject, new PrivilegedExceptionAction() {
                public Object run() throws Exception {
                    try {
                        Object result = theMethod.invoke(delegate, params);
                        return result;
                    } catch (Exception e) {
            }, null);The line ... theMethod.invoke(...) calls the following AuthenticatorImpl.getPermissions() via rmi (server->server).
    public PermissionCollection getPermissions() throws ... {
        AccessControlContext acc = AccessController.getContext();
        Subject s = Subject.getSubject(acc);
        Policy p = Policy.getPolicy();
        return p.getPermissions(s, null);
    }When reaching the method's second line (Subject.getSubject) we obtain a java.security.AccessControlException.
Do you have any ideas what's wrong?
We're using a policy file for client and server, but even if we grant all permissions the problem still exists.
If there's an error why doesn't it occur running under 1.3?
Maybe the reason is that in 1.4 JAAS is a part of the JRE and some methods have become deprecated? (Under 1.3 we are using an external jar file containing an older JAAS version, under 1.4 the built-in JAAS classes are used).
Thanks in advance

It now works using 1.4.
What I did is using Subject.doAs instead of Subject.doAsPrivileged.
I'm a beginner in JAAS: Is it in consideration of security aspects ok to use doAs instead of doAsPrivileged here?
And besides this: Isn't it a bug that the behaviour is different in 1.3 and 1.4?
Thanks

Similar Messages

  • App store under my name but update is under different account user name, how do i get out of this

    My app store account is under my name, but when I tried to update my apps, it is asking for my son's usernames password. 

    Content bought using one Apple ID cannot be merged or transferred to another Apple ID.
    Apps are forever tied to the Apple ID used to obtain them.
    Another way is to delete them and download using your own Apple ID.

  • HT3529 am trying to activate vm viewer - keeps asking me for pin - have used every number I have but none work - how do i get past this screen or help finding my pin?

    Am trying to activate vm viewer - it keeps asking me for my PIN - have used every number I ever used for a PIN but none work - how do I get past this screen or get help finding my PIN?

    Are you talking voicemail and the password, if you are contact your phone carrier and they can reset your password.

  • JavaRMI example is good betwen windows but dont work under linux

    Hello all, this is my first post here, Im from mexico, then, my english is not good, but i will try to explain my problem and I hope you undertand. Well, first all, Im using ubuntu 8.04 and version of JDK: java-6-sun-1.6.0.10.
    I have this code on the server:
    public class RmiServidor extends UnicastRemoteObject implements     InterfazReceptorMensajes {     
         private Registry registro;
              public RmiServidor() throws RemoteException {
              try {
    // System.setProperty("java.security.policy", "/home/gerardo/Escritorio/msdos/java.policy");
    // System.setProperty("java.rmi.server.codebase", "file://home/gerardo/Escritorio/msdos/");
    // if (System.getSecurityManager()==null)
    // System.setSecurityManager(new RMISecurityManager());
         registro = LocateRegistry.createRegistry(3232);
                   registro.rebind("rmiServidor192.168.1.2", this);
                   System.out.println("Server ok");
              } catch (RemoteException e) {
                   throw e;
         public String recibirMensaje(String cadena) throws RemoteException {
         System.out.println("El cliente dice "+cadena);
         return "Hola "+cadena;
         public static void main(String[] args) {
              try {
                   new RmiServidor();
              } catch (Exception e) {
                   e.printStackTrace();
                   System.exit(1);
    this code on the client:
    public class RmiCliente{
    InterfazReceptorMensajes rmiServidor;
    Registry registro;
    public RmiCliente() throws IOException {
         conectarseAlServidor();
    public void conectarseAlServidor() {
    try {
    // System.setProperty("java.security.policy", "/home/gerardo/Escritorio/msdos/java.policy");
    // System.setProperty("java.rmi.server.codebase", "file://home/gerardo/Escritorio/msdos/");
    // if (System.getSecurityManager()==null)
    // System.setSecurityManager(new RMISecurityManager());
    registro = LocateRegistry.getRegistry("192.168.1.2",3232);
    rmiServidor = (InterfazReceptorMensajes) (registro.lookup("rmiServidor192.168.1.2"));
    } catch (RemoteException e) {
    System.out.println("Remote Exception");
    } catch (NotBoundException e) {
    e.printStackTrace();
    this code on the interface:
    public interface InterfazReceptorMensajes extends Remote
         String recibirMensaje(String cadena) throws RemoteException;
    and another class with a bite of code:
    try{
    RmiCliente rmi = new RmiCliente();
    System.out.println(rmi.rmiServidor.recibirMensaje(" como estas "));
    }catch(IOException es){
    System.out.println("there is a exception");
    Then, when i run the server on the first windows machine, and the client on the linux machine, all works ok!
    on the server:
    -El cliente dice como estas
    on the client:
    -Hola como estas
    but, when I run the server on the linux machine, and the client on the windows machine,
    on the server:
    on the client
    -there is a exception
    I hope you can help me.
    I have the same problem when I work with 2 linux machines, dont works the client and neither the server
    but with 2 windows, the 2 machines work ok!

    Thanks a lot!!!
    well, the exception is the further:
    java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested excepti
    on is:
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unkn
    own Source)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
    at $Proxy0.recibirMensaje(Unknown Source)
    at RmiCliente.main(RmiCliente.java:32)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    ... 8 more
    I read that making something like: System.setProperty("java.rmi.server.hostname", "192.168.1.2"), but i dont know how to apply it.
    I tried to do this:
    System.setProperty("java.security.policy", "java.policy");
    System.setProperty("java.rmi.server.codebase", "");
    System.setProperty("java.rmi.server.hostname", "192.168.1.2");
    if (System.getSecurityManager()==null)
    System.setSecurityManager(new RMISecurityManager());
    where java.police have :
    grant {
    permission java.security.AllPermission;
    I run my application with:
    javac *.java
    java RmiServidor
    and i tried to do
    javac *.java
    rmic RmiServidor
    java RmiServidor
    but dont work, the exception is same.
    Why windows works ok with the same code?, is something related with the SO?
    Thanks in advance, and an apologize for my bad english.

  • Java applets that worked fine under 10.6 don't work under 10.7. What can I do to correct this?

    Java applets that worked just fine are no longer working after upgrading to MacOS X 10.7 (Lion).  Here is one example: 
    So far, I've found two Java Applets that have become inoperative under 10.7.  Here's one example: http://www.vimas.com/videoLarge.php
    I did download and install the Java  VM for Lion and I did "activate" the applet when prompted to do so.  However, the example  cited above fails to load.
    A second example is  JFileUpload which enables a drag & drop UI with which to upload files.  Worked great under 10.6 but under 10.7 dropping a file on the UI only causes the web browser to display the file, not upload it.

    @etresoft: "You have old cache files left over from you Snow Leopard Java installation. Just run the Jave Preferences application and delete your cache files."
    I did that right off but this is not the issue and that tactic didn't work.  Apple has acknowledged the issue and the workaround (extract the applet from the web page) seems to suggest that Safari is at fault.  Safari 5.2 was just released today but, unfortunately, doesn't correct this issue.
    In the case of the applet that I use most often (JFileUpload), it also has a File menu so I use that instead.  Nonetheless, I sure do miss drag & drop.  As more and more of our Mac users upgrade to Lion and bump into this issue, we expect our  support effort to be challenged with an increasing number of irate users.  It doesn't help to be able to say "It's Apple's Fault" but that's all we can say.

  • Why does flash no longer work in viewing SnagFilms or Hulu under Safari Browser but still works for Netflix.  And, where can I receive directions on how to install the PPAPI Plug In for Flash Player for Maverick 10.9.4.

    Until recently, I was able to watch both SnagFilms and Hulu within the Safari Browser successfully.  In both movie sites, I no longer get video and am asked to download Adobe Flash Player (which I already have 14.0.0.125) but my system indicates that Plug-In PPADI has not been installed?  Where to go to find this correct download?  When consulting with SnagFilms and Hulu, it was recommended that I download and watch in the Chrome Browser, which is successful.  However, I don't like the idea that I must run a second browser to do stuff on my Mac.  I don't have any issues with watching films under Safari within Netflix.  I am so confused.  What about the security issues with respect to running google products--do I need to be concerned if this is the only method for accessing my movie sites.

    salwolfe wrote:
    Until recently, I was able to watch both SnagFilms and Hulu within the Safari Browser successfully.  In both movie sites, I no longer get video and am asked to download Adobe Flash Player (which I already have 14.0.0.125) but my system indicates that Plug-In PPADI has not been installed?...
    The problem is that your Flash Player is not current. Check this to see what the current version is (vs what you have) and here to get the latest version. There is supposed to be a major security issue in the version you've got so Apple is blocking its use. In any case, don't get Flash Player from anywhere except Adobe.

  • GCU showing up under "Rewards Overview" but not working on items in cart

    I'm trying to buy Zelda: Wind Waker for Wii U. It costs $40.99 and should show up as $32ish in my cart, but no luck so far. I went into my account and under Rewards Overview, it says I have GCU Benefits through Dec. 23, 2016 (I activated my GCU on 12/23/14 and haven't tried to use it till today). Any idea why I can't get the GCU discount to work online?

    Hello brandonmc87,
    Well that's really strange.  I just went through the checkout process for The Legend of Zelda: The Wind Waker on Wii U and it gave me the Gamers Club Unlocked benefits.  
    As stated previously by bobberuchi, you may need to log out of your account and log back in.  Also, you may want to clear your browsing history or try a different Internet browser.
    If you're still unable to receive the discount, please post here and we'll look into your My Best Buy log in.  

  • Ipod is recognised under my computer but wont work in itunes,

    My ipod worked fine on my old computer i dont think i had the most recent itunes but everything was working fine i had windows XP. Now i have a new laptop with windows 7 and my ipod wont work in itunes, i have uninstalled and reinstalled itunes 9 and even tried itunes 8 but nothing seemed to help the situation, i know its not the cable as it shows under my computer, i have taken all my music off the ipod because it asked to reformat it i have tried that twice, i get the message your ipod needs to be reformatted for windows i click ok and it opens itunes but nothing happens, iv downloaded the 64 bit itunes as it doesnt like the 32 bit one. Iv ran a diagnostic test on my ipod but cant get past the firewire detect and usb detect maybe this is because i dont have itunes installed at the moment, any suggestions please?

    I had the same problem with my iPod classic. I got a new laptop that has windows 7 and downloaded itunes 9. As soon as itunes 9 was downloaded my ipod would not be recognised anymore. I tried everything like reformatting etc and nothing was helping. What I did was downloaded itunes 7 and my ipod was then recognised. Your problem may be that your software on your ipod is not up to date enough to run on itunes 9 (that was the problem with mine) and may also not be up to date enough to run on itunes 8. Try itunes 7 (or if that doesn't work even itunes 6) then once your ipod is recognised go to the summary page on your ipod and update your software to the current version. Once i did this my ipod was recognised on itunes 9 when i plugged it in and worked perfectly. Hope this helps!

  • Cant use some funtions in firefox but still work with internet explorer, too long to explain in one ssentence

    recently I have found that certain buttons on sites like facebook and others will not function when I am using firefox but if I use internet explorer those same buttons work fine. one example is the log out button in facebook. you can click on the command button all day but nothing happens. First thought this was a facebook issue but noticed certain command buttons did not work in other sites as well. Went to i.e. and everything works fine what has happened

    '''Try the Firefox SafeMode''' to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    [https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode#w_safe-mode-window_2 Troubleshoot Firefox issues using Firefox SafeMode]
    When in Safe Mode... <br />
    * The status of plug-ins is not affected.
    * Custom preferences are not affected.
    * All extensions are disabled.
    * The default theme is used, without a persona.
    * userChrome.css and userContent.css are ignored.
    * The default toolbar layout is used.
    * The JIT Javascript compiler is disabled.
    * Hardware acceleration is disabled.
    * You can open the Firefox 15.0+ SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    '''''If it is good in the Firefox SafeMode''''', your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes
    ''When you figure out what is causing that, please let us know. It might help other user's who have that problem.''

  • Needed 10.5 min. to use iPad and iPhone 4 but not working

    i brought the snow leopard 10.6 update in order to use my iPhone and iPad, however they are not being read........STILL.You hear the tone to say its been plugged in but nothing comes up on itunes..

    Have you checked the Console logs to see if the system or iTunes might be reporting an issue with your equipment?
    You can find Console in Applications>Utilities>Console.

  • I can't open .exe file on vista under bootcamp but it works on parallels.

    Hi all,
    I have an .iso file with a game. When I open the .iso file on Leopard it opens as a disk image and then there is a setup.exe which when double clicked opens with parallels (with installed Vista) and starts installation of the game.
    I have moved the .iso file to the Vista partition and open it with the WinZip but when I click on the setup.exe file nothing happens
    Can you please tell me why is that it works under parallels and doesn't work under bootcamp?
    thanks in advance

    Thanks a lot I used Virtual CloneDrive and it works

  • ClassNotFound using JAAS

    I'm tring to use JAAS with my servlets, but when I call
              LoginContext.login(), the Subject class can't find
              SubjectDomainCombiner. But I can load this class from my servlet...
              

    your answer is here:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=65&t=000637
    sincerly yours,
    charles(jGuard team).

  • All my songs by certian artists don't appear under their names, but all their songs appear under 'all songs'

    So when I search for a specific artist on my phone, say, Whitney Houston, I only see like 3 or 4 songs, but when I go to see all the songs on my iphone, all her other music is there.
    I've checked my music on iTunes on my mac and I see that her name is spelled correctly for all songs and none are checked off with "skip when shuffling" or anything like that.
    I've noticed the same issue for other artists too. My songs appear under all songs, but not always under their artist name.
    What can I do so all my songs appear under their artist name?

    There are usually two things that contribute to songs not appearing under Artist on the iPod, both due to information either in or missing from the Get Info>Info tab against the song in iTunes. 1) the song has no album name associated with it or 2) the song is marked as part of a compilation.
    If tracks are missing an Album name in the Info tab, this information needs to be filled in. The no album one is a bit quirky as the songs will appear under certain circumstances (for instance I read somewhere that if you have at least two tracks with different album names the rest will appear), however the simplest remedy is just add None or Miscellaneous to all the blanks in place of a title. See this link for more detail: I don't see some of my songs when browsing by artist on my iPod
    Also if the tracks are ticked in the Get Info>Info tab as part of a compilation, they will not appear under Artist on the iPod. Highlight a song in iTunes that you know is not appearing correctly on your iPod. Right click on it and choose Get Info and click the Info tab (alternatively choose Get Info from the File menu), if "Part of a Compilation" is marked untick it and afterwards update your iPod, you should find it now appears as normal. Setting "Compilations" on your iPod main menu prevents you getting lots of single artist entries when you load an album by various artists.

  • Upgrading CS2 to CS5.5 under Snow leopard, will that upgraded CS5.5 version work under Lion?

    Hello,
    I would like to migrate to Lion from Snow Leopard but before I do so, I would like to know whether Adobe CS5.5 upgraded from CS2 while still under Snow Leopard would then work under Lion.
    Many thanks!

    Thanks a lot Stefan for your answer!
    I am using CS2 premium (i.e. Illustrator, Photoshop, Go Live, inDesign and Acrobate 7 Professional) and wish to upgrade to CS5.5 Design Standard + Dreamweaver.
    But my question is probably more like: if we upgrade a CS2 product to a CS5.5 product, will some PowerPC code still remain in the upgraded version, thus creating compatibility problems with Lion?
    Many thanks,
    Cheers,
    Jonathan

  • Numpad stopped working under gnome

    Somehow my numpad stopped working under gnome. It does work under GDM etc so somehow a setting must have been changed.
    Problem is, I can't find that setting  :x
    Someone any idea before I start deleting my gnome config files ?

    You can just copy your files to other location
    btw gnome (i think every gtk enviroments) uses keyboard settings from xorg.conf - maybe somethig is wrong with that file? Look at this, but i think first you may copy your gnome configuration to other place so you'll be sure if that is in your config or it is system error.

Maybe you are looking for

  • Problem with NLS_LANGUAGE

    I am working on workflow process. I have a problem . I created a workflow process using the Oracle Worflow Builder. When I try to save it at server I cann't do that because I get the following Error Message : 220: Unable to set NLS_LANGUAGE. 210: Ora

  • VAT number duplicate

    Hi experts... I would like to validate duplicates vendors with same VAT number. In BUPA_TAXNUMTYPE transaction is activated Duplicated Check (ON). Additionally, we have implemented the note 1172339, but is not working this validation. Does anyone to

  • Photoshop CS6 crashes when selecting tools

    Hi, I'm having the same problem as a few other members (Photoshop CS6 occasionally crashes when selecting tools)  and have updated the driver on my HD5770 card to the latest version (8.961.0.0) as this is the recommended fix. Unfortunately this hasn'

  • Laptop cannot go online with new HomeHub 4

    Please excuse me for being a complete beginner - could any answers be in non-techno form please as I'm not aufait with most of the terms used!! I installed our new HomeHub 4 yesterday and all computers/iphones/tablets managed to log in and go online

  • Bin to Folder

    We have made a structure in Adobe premiere. It contains several Bins, and each bin contains subclips. Is it possible to export all the bins to folders, including the subclips. Because we have a lot of bins it will safe us a lot of time! We use premie