Persistant FilePermission access denial

Hello, I am new to applet development and recently made one, which runs great locally, but I stumbled across the permissions issue when embedding it into an HTML page.
I am following this tutorial: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html#FilePermission
I have my applet class and the html in the same folder(as well as java.policy.applet) , say C:\User\
I need to read/write to a file located in another folder, say C:\Data\file.dat
my permission file currently has
grant
  permission java.io.FilePermission
     "C:\\Data\\file.dat", "read, write";
};The applet opens in the html, but nothing is populated and the java console reads:
"access denied (java.io.FilePermission C:\Data\file.dat read)"
Can someone please enlighten me on what might be the problem?
Thanks.

you need to put your applet in a jar (see jar.exe or just jar if you are not on windows)
Once the applet is in a jar, you need to sign the jar. See jarsigner.exe
If you google for all these things you can find out more

Similar Messages

  • Baffled by FilePermission access denied

    I am trying to read through a directory and check whether I can read the files located in that directory. When I don't use a security manager the canRead() function always returns true. So I'm trying to implement a security manager and can't figure out what I'm doing wrong.
    I created the following policy file. Originally I entered a code base, but with this version I removed it to try and narrow down the problem.
    grant {
      permission java.io.FilePermission "<<ALL FILES>>", "read";
    };The following command is used:
    java -cp "C:\Documents and Settings\Carl\My Documents\Java\Baseline\DirectoryList" -Djava.security.manager
    -D.security.policy=directoryList.policy directoryList I also provide two parameters. The first is the output file and the second is the directory where I want the program to start. I broke these out to help the readability of the java command.
    "C:\\Documents and Settings\\Carl\\My
    Documents\\Java\\Baseline\\DirectoryList\\output"
    "C:\\Documents and Settings\\Carl\\My
    Documents\\Java\\Baseline\\DirectoryList"I have tried countless varieties and always receive the following error:
    Security Exceptionjava.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\Carl\My Documents\Java\Baseline\DirectoryList read)The portion of my code that is throwing the error is:
            File start  = new File ( args[j] );
            File list[] = start.listFiles();I have access to the directory and files I'm trying to read since they are located with the class files. So really I should have two ways of getting authorization to read these files; however, nothing seems to work. I've looked through the forums and did the tutorials to see if I missed anything and can't find the problem. I would really appreciate any assistance you could provide.

    My testing has shown that the File.canRead() method returns true even if I don't have read access to the file. I've setup two files on my Windows system and removed access by using a different login id. The windows permissions allow me to list the file, but do not allow me to read the file. I've tried this with j2sdk1.4.2_01 and jdk1.5.0_05. Does 1.6 perform the security checking?
    "f" is my file object   
    boolean haveAccess = false;
        try{
             if ( f.canRead() ) {
                haveAccess = true;
             else {
                System.out.println ( "canRead() method can't read  " + f );
                haveAccess = false;
        catch ( SecurityException se ) {
             System.out.println(f + "\t" + f.lastModified() + "\t" + f.length() + se );
             haveAccess = false;
        }This code always returns true.
    For my program, I don't want to open the files. I just want to scan the directory and determine whether anyone can read the files or only list the directory contents. I would also like to make this test even if the file is in use. So the attempt to read the file would give me the wrong answer if someone else had it in use. I want to find out if I'm ever allowed to read the document. Not just at the very minute I scan the file.
    Basically, I want to scan a directory and determine the file permissions of each file. Can I list it, read it, or write to it.
    Thanks

  • JAAS: Access denial error

    Hi all:
    I am trying to use JAAS for the authentication purpose.
    In the login() method implemented in LoginModule class, I am trying to access objects from external custom jars.
    viz. soapclient12.jar.This jar inturn uses Axis1.4 jar.
    I have granted access to all the jars.
    I am getting following error while accessing object from soapclient12.jar.
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at org.apache.commons.discovery.log.DiscoveryLogFactory._newLog(DiscoveryLogFactory.java:141)
         at org.apache.commons.discovery.log.DiscoveryLogFactory.<clinit>(DiscoveryLogFactory.java:104)
         at org.apache.commons.discovery.resource.DiscoverResources.<clinit>(DiscoverResources.java:82)
         at org.apache.commons.discovery.tools.ResourceUtils.getResource(ResourceUtils.java:122)
         at org.apache.commons.discovery.tools.ResourceUtils.loadProperties(ResourceUtils.java:175)
         at org.apache.commons.discovery.tools.PropertiesHolder.getProperties(PropertiesHolder.java:102)
         at org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:360)
         at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
         at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
         at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
         at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
         at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
         at org.apache.axis.description.TypeDesc.<clinit>(TypeDesc.java:61)
         at com.aspace.ftress.interfaces.ftress.DTO.ALSI.<clinit>(ALSI.java:106)
         at com.acti.jaas.ftress.authentication.CheckCredentials.testAccess(CheckCredentials.java:29)
         at com.acti.jaas.ftress.authentication.CheckCredentials.main(CheckCredentials.java:15)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.commons.discovery.log.level read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.apache.commons.discovery.log.SimpleLog.<clinit>(SimpleLog.java:155)
         ... 18 more
    by looking at the error it seems like we have to grant access to some specific jars/file.
    We have tried giving all the permissions but the problem still persists.
    Can anyone please tell the solution
    Here is my policy file.
    /* grant the sample LoginModule permissions */
    grant codebase "file:///C:/Projects/AI/TestJavaSamples/JAASLoginModule/bin" {
    permission javax.security.auth.AuthPermission "createLoginContext.FtressLoginModule";
    permission javax.security.auth.AuthPermission "modifyPrincipals";
    permission javax.security.auth.AuthPermission "modifyPublicCredentials";
    permission javax.security.auth.AuthPermission "modifyPrivateCredentials";
    permission javax.security.auth.AuthPermission "doAs";
    permission javax.security.auth.AuthPermission "doAsPrivileged";
    permission java.security.SecurityPermission "setPolicy";
    permission java.security.SecurityPermission "getPolicy";
    /* grant the sample all the soapclient12.jar*/
    grant codebase "file:///C:/Projects/AI/TestJavaSamples/JAASLoginModule/lib/soapclient12.jar" {
    permission java.lang.RuntimePermission     "createClassLoader";
    permission java.lang.RuntimePermission     "getClassLoader";
    permission java.util.PropertyPermission     "org.apache.commons.discovery.log.level", "read";
    permission java.util.PropertyPermission     "axis.EngineConfigFactory","read";
    permission java.util.PropertyPermission     "org.apache.axis.EngineConfigurationFactory","read";
    permission java.util.PropertyPermission     "axis.ClientConfigFile","read";
    permission java.util.PropertyPermission     "axis.ServerConfigFile","read";
    permission java.util.PropertyPermission     "axis.xml.reuseParsers","read";
    permission java.util.PropertyPermission     "axis.attachments.implementation","read";
    /* grant the sample all the jars present in axis1.4 */
    grant codebase "file:///C:/Projects/ActiveIdentity/axis-1_4/lib" {
    permission java.security.AllPermission;
    permission java.lang.RuntimePermission     "createClassLoader";
    permission java.lang.RuntimePermission     "getClassLoader";
    permission java.util.PropertyPermission     "org.apache.commons.discovery.log.level", "read";
    permission java.util.PropertyPermission     "axis.EngineConfigFactory","read";
    permission java.util.PropertyPermission     "org.apache.axis.EngineConfigurationFactory","read";
    permission java.util.PropertyPermission     "axis.ClientConfigFile","read";
    permission java.util.PropertyPermission     "axis.ServerConfigFile","read";
    permission java.util.PropertyPermission     "axis.xml.reuseParsers","read";
    permission java.util.PropertyPermission     "axis.attachments.implementation","read";
    permission java.util.PropertyPermission     "http.nonProxyHosts","read";
    permission java.util.PropertyPermission     "http.proxyHost","read";
    permission java.util.PropertyPermission     "axis.byteBuffer.cacheIncrement","read";
    permission java.util.PropertyPermission     "axis.byteBuffer.residentMaxSize","read";
    permission java.util.PropertyPermission     "axis.byteBuffer.workBufferSize","read";
    permission java.util.PropertyPermission     "axis.byteBuffer.backing","read";
    permission java.util.PropertyPermission     "axis.attachments.implementation","read";
    permission java.util.PropertyPermission     "axis.attachments.implementation","read";
    permission java.util.PropertyPermission "axis.http.client.maximum.connections.per.host","read";
    permission java.util.PropertyPermission "axis.http.client.maximum.total.connections","read";
    permission java.util.PropertyPermission "axis.http.client.connection.default.connection.timeout","read";
    permission java.util.PropertyPermission "axis.http.client.connection.default.so.timeout","read";
    permission java.util.PropertyPermission "axis.http.client.connection.pool.timeout","read";
    permission java.util.PropertyPermission     "java.protocol.handler.pkgs","read";
    permission java.util.PropertyPermission     "java.protocol.handler.pkgs","write";
    Thanks in advance,
    - Vidya

    Hi,
    I am using JBOSS-4.0.4GA .
    Do you have any idea how to configure JAAS on Jobss?

  • Access denial to mdb connections for asp

    I am new to DW asp but am confident with CSS.
    When setting up my asp connection for a mdb I get a successful test but then get "Access to C:\inetpub\wwwroot\nationalex_root\Connections\connnationalex.asp denied" on OK
    The Connections folder doesn't seem to be set up. Any ideas?
    Kev

    You'll need to set up a datasource in IIS. Also, after doing this make sure that your Access database is not "locked" or write protected, this can easily happen when using access, especially if you are working on the database in MS Access off and on during development.
    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF
    www.twitter.com/LawrenceCramer
    www.facebook.com/LawrenceCramer

  • Access denial on connecting SQL server 2000 with Microsoft JDBC driver

    Hi guys,
    I am developping a BMP invoking procedures stored in a SQL server 2000 instance on the Sun RI platform. I am using the Microsoft type 4 JDBC driver.
    the connection pattern is something like
    jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password;DataBase=Forethought;SelectMethod=cursor
    An type-like "access denied" exception is raised when trying to get the connection from the DataSource object with some code similar to :
    DataSource objDS = (DataSource)objCtx.lookup("jdbc/Forethought");
    Connection objConn = ds.getConnection();
    I have realised a CMP to access the database and everything works fine.
    It seems that the SunRI tries to get the db connection with an "impersonated " user even if i have specified the user name and password in the connection string.
    Does anyone have an idea how to force the connection with SQL Server user name and password ??

    I come accorss the same problem too,
    my URL jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password=123;DatabaseName=pubs
    and the password is right.I can establish connection to SQL server 2000 by JDBC Driver Manager,the code as follow:
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    Connection conn = DriverManager.getConnection
    ("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=123");

  • Deny application access to oid user

    Hi
    I'm developing an application that implements sso. The user that tries to access the application ( through any page ) is automatically redirected to the sso login page... so far, so good!
    What I want to implement is the application access denial when an user, even existing in the OID, shouldn't access the application.
    How can I accomplish such task using ADF UIX in JDeveloper 9.0.5.1. ?
    Thanks in advanced
    Vitor Cardoso

    Thanks for reploy,
    The way you have defined is better to avoide this issue,could you please tell me one thing,is there any request in application to disconnect all the user forcely on the spot who are connected and allow again to login in application only thoes user who have System Administator Responsibility,
    --thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Cant access a DFS share from a Windows 7 computer

    I am having DFS share access issues with a Windows 7 workstation.
    My setup is I have 6 windows 7 stations accessing this DFS Share.
    All computers have the same Administrator password and another User/Password
    All but 1 are working as they should.
    The DFS share is running under Server 2008 R2 and contains files from this and another server.
    From the workstation, I can see the server under Network.
    I can open it and see the individually shared volumes and I have full read/write permissions.
    I can see the DFS share and I can map it.
    If I try to open the shared volumes within the DFS file I get a message saying I dont have permission.
    Interestingly, when I look at the properties of the DFS share form the workstation, I dont see a DFS tab.
    If I do this from a workstation is is able to connect fully to the share, I see a DFS tab in the properties.
    I tried to include everything,
    Thanks in advance

    Hi,
    Please try hotfix in the following KB,and check the result.
    You cannot access a DFS share through a mapped network drive on a computer that is running Windows 7 or Windows Server 2008 R2
    http://support.microsoft.com/kb/983620/en-us
    Some steps for troubleshooting DFS you can try
    http://technet.microsoft.com/en-us/library/cc962144.aspx
    How to troubleshoot Distributed File System Namespace access failures in Windows
    http://support.microsoft.com/kb/975440/en-us
    use command dfsutil /pktinfo to test the access to the DFS root and connectivity to the root shares
    http://blogs.technet.com/b/askds/archive/2009/06/04/the-case-of-the-random-dfs-access-denial.aspx
    Regarding to the missing dfs tab, there's a policy, locate to User Configuration\Administrative Templates\Windows Components\Windows Explorer\remove dfs tab, then users can not view or change the properties of the dfs shares
    Yolanda Zhu
    TechNet Community Support

  • Access Denied When Attempting to Deploy an SQL Report Built in VS

    ------ Deploy started: Project: SQL Reports, Configuration: Debug ------
    Deploying to http://localhost:82/ReportServer
    Error rsAccessDenied : The permissions granted to user 'ALLIEDFIT\rculver' are insufficient for performing this operation.
    Where exactly is the access denial occurring?  I have full control on the report folder where the Visual Studio project is.  With SQL Reporting Services handling the URLs, frankly I'm not sure where the deployment is trying to put
    the report.
    Thanks.
    Ross

    The Reporting Services error rsAccessedDenied occurs
    when a user does not have permission to perform an action. May be do not have a role assignment that allows to open a report or did not open browser with the required permissions.
    Permission to access report server content and operations are granted through role assignments. On a new installation,
    only local administrators have access to a report server. To grant access to other users, a local administrator must create a role assignment that specifies a domain user or group account, one or more roles that define the tasks the user can perform, and a
    scope (usually the Home folder or root node of the report server folder hierarchy). You can use Report Manager to create the role assignments
    Hope this Helps

  • Severe Time Drifting after Migration from 10.5.8 - Help!

    Hey everyone, I'm hoping someone can help me out or shed some light on a very odd issue that came about this morning.  I'm really having a hard time figuring out a fix.
    I recently upgraded one of my old Mac mini servers to some new, (to me), hardware.  The old server was a last-gen G4, and the new one is a late 2006 Intel.
    The migration went totally fine, and all services are responding and working as expected.  This server really isn't used for all that much, so I didn't anticipate any real issues in upgrading from 10.5.8 (PPC) to 10.6.7 (Intel).  But after checking everything over this afternoon, I landed on a really weird issue. 
    I can literally watch the time progress slower on this server.  Really.  The seconds pass slower, and after about an hour, it will be up to five minutes behind all the other servers in my infrastruture.  The server is setup to watch time.apple.com as it's NTP, and there's no change with another NTP server.  I can grep the NTPd and it seems to be working fine.  I've "started fresh" by removing ntp.conf and ntp.drift, rebooted, and had NTPd recreate them after setting new time and date preferences.  That seems to have helped a *bit* but it's still persisting.  Time zone information is correct.  I've even turned off time sync altogether and it still persists, so it's got to be a local issue with the system.
    Now, after some pondering, I believe I know what's causing the issue.  The person I inherited the server from replaced the stock 1.5 Core Solo with a 1.66 Core Duo, which I've seen done plenty of times before, and never heard any real issues with.  And I did physically check the upgrade, and everything seems to be perfect.  The system sees both cores fine, and everything is stable.  Except this very odd time/clock issue.  This is the only root cause that I can possibly think of for it doing this.
    And what's odd, is that if the time is wrong in the menu bar, and I go into the Time and Date prefpane, it instantly updates to the right time. 
    Now really, this isn't *that* big of a deal for this server.  None of it's services rely on perfect time, (Kerberos and whatnot), but it's still rather annoying, especially for Time Machine backups.  My main curiousity is if anyone knows how to increase the interval for NTP syncing with time.apple.com, so it'll check every hour or so, (I believe it checks every 12 by default.  Correct me if I'm wrong).
    TL;DR
    After migrating from Leopard Server (PPC) to Snow Leopard Server (Intel), my system clock is running about five minutes slow per hour.  Suspecting processor upgrade is to blame.  How can I increase NTP syncing interval with time.apple.com?
    Thanks in advance everyone!

    You can add/modify the minpoll and maxpoll values in ntp.conf.  This should allow you to set the time poll and reset a bit more aggressively.
    The Xeon chips have been notorious for time skew.  I've not seen the same with CoreDuo and Core2Duo. 
    You may also just want to periodically stop and start the NTP process.  This can be down using systemsetup command:  systemsetup -setusingnetworktime on/off
    In corporate environments with Windows time servers that reboot frequently, I tend to automate a script that stops network time, waits a few seconds, and then starts it again.  This will force a sync.
    Hope this helps.  Oh, and by the way, time is critically importation to Kerberos authentication and authorization from the client.  Next the DNS, time is the most common cause of access denial.  Keep DNS and time healthy. 

  • Need help changing the default Save Path

    Hello,
    We are implementing SAP, and will be using Citrix as the source for the GUI.  One of our requirnments are, that we need to change the default "Save Path" that users save documents too.   By default, this is to the C drive, but, we need it set to a different drive (i.e. V: on the citrix server).
    We found this note on SDN (see below) - however, it does not explain how to change or add this registry value?  Is this done in the GUI options, or in regedit?  If in reg-edit, where abouts in the tree does it go?
    Thanks guys, and any help would be greatly appriciated.
    Richard
    (As of SAP GUI 7.20, patch level 4) the REG_EXPAND_SZ registry value InitSaveDir can be used to configure the default path and folder for users to save the reported information in case of an access denial due to security rules. If users change the default path and save the information to an individual location, this new path will be kept as long as the user does not terminate the program. When starting SAP GUI again, users will get the configured default path again to store the reported information, the individual path changes will be lost. If the registry value does not exist, the default directory is the document directory of the SAP GUI.
    By default none of the above registry values exists. In order to change the behavior of the security module, the registry values need to be created and set to the desired value. A not existing registry value means use the default.
    In this doc:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/002444be-7018-2d10-e18e-a8c537198ef6?quicklink=index&overridelayout=true

    Hi,
    "Security rules that are created for a large number of users can be centrally stored on a server by an administrator. The administrator can use the registry values below under the registry key
    [HKEY_LOCAL_MACHINE\Software\SAP\SAPGUI Front\SAP Frontend Server\Security]
    to configure the behavior of the security module.
    Note: For 64 bit operating systems please use the following registry key
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP\SAPGUI Front\SAP Frontend Server\Security]
    to configure the behavior of the security module."
    You can use regedit for installing this values.
    Best Regards,
    Aleh

  • Multiple Users on Lightroom? Or Other Solution?

    I just called Adobe technical support and spoke with someone about using Lightroom to organize patient photos in a medical office.  I was told that Lightroom does not support multiple users, and there is no work-around solution or plug-in for this.  Can you please confirm this?  I need a software to organize a photo library/catalog of appx 20K before and after photos.  Multiple users (appx 3-5) need to be able to access and update the same library/catalog simultaneously.  We are a Mac only office.  Please help.

    lrmdmedia wrote:
    Multiple users (appx 3-5) need to be able to access and update the same library/catalog simultaneously.
    Lightroom is the wrong tool for the job - consider Bridge instead.
    At the risk of stating the obvious: no matter which way you go (software-wise), you (your team, I mean) need to make sure one person isn't stompling on what another has done (or preventing access denial when it's needed).
    That said, many have come up with Lightroom-based solutions that support some people working on one set of photos (or same set of photos, but different metadata/settings), whilst another team member works on a different set (or same set, but not same settings/metadata). - whether any of these ad-hoc solutions would be acceptable to you, I can't say.
    But most of them involve using catalog export/import, or xmp, and/or reserving exclusive (master) catalog access temporarily...
    R

  • Community Nugget 4/08/2007 Action Engines

    Action Engines, What are They?
    “An action engine is Ben's term for a functional global which includes extra actions other than just holding the data.”
     (tst , 03-13-2007 01:18 PM)
    In a nut shell tst has nailed it except for the “Ben’s term” part. I was originally exposed to the term "Action Engine"
    by reading the book ""LabVIEW Applications Development A Course on Advanced LabVIEW Programming Techniques*”.  But
    before I get into details of the Action Engine (AE), I will attempt to clarify some terminology.
    Functional Globals
    Functional Globals (FG) are VIs that are functionally equivalent to LabVIEW globals. Functional Globals store
    information. You can read them or write them and that is it. No fancy stuff. Functional Globals are also referred to as
    LV2 globals because LV2 did not have globals but it did support Un-initialized Shift Registers (USRs). The USR is the
    entity that stores the information.
    USR.jpg
    USR’s
    Shift Registers (SR) come in two varieties “Initialized” and “un-initialized”. The presence or absence of a wire
    feeding the SR from outside the loop distinguishes how LabVIEW will implement the SR. If there is NO wire feeding a
    shift register (A), then the SR is not initialized. This is called an “Un-Initialized Shift Register”. The USR variety
    is implemented as static buffer that is re-used from call to call. The values written to the USR in and earlier call
    persist for access (B) in latter calls**. A Functional Global exploits this behavior by implementing two methods of
    interacting with the contents of the USR.
    Functional Global.JPG
    In the “Write” action (not shown) the value of “Numeric in” is placed in the USR. In the “Read” action the contents of
    the USR are returned via Numeric out.
    Action Engines
    An Action Engine (AE) can be thought of as a machine (Engine) that performs some useful task (action) often on
    something (typically but not limited to data in a USR). Functional Globals are very specific type of Action Engine.
    They have two actions “Write” and “Read”. They operate on the data stored in the USR either by replacing or using the
    contents of the USR. So AE’s are a superset of Functional Globals. In many documents the terms AE and FG are
    interchangeable. A recent poll on LAVA has indicated that Functional Global is the most popular term. Since this Nugget
    was prompted by answering the question “what is an AE?” in the remainder of this document you will find that I will
    generally use the term AE.
    Do What to What?
    AE design revolves around the ways the shared resource must be accessed manipulated or monitored. In a Functional
    Global, the actions “Write” and “Read” are appropriate. That is not necessarily the case for AEs. AEs can have entirely
    different set of actions depending on the interaction requirements for the information stored in the USR. A short list
    follows.
     A Configuration AE could allow for multiple processes to share a single copy of the system configuration (in a USR) by
    providing actions like “Set Device ID”, Set Device ON-Line…
    A hardware device can be realized as an AE that presents actions appropriate to the physical phenomenon being measured
    or controlled.
    A DO Port Controller AE could store a reference to the physical device in one SR and the port status in another SR and
    have action like: Set Main Motor On”, “E-Stop”, …
    An Instrument can be implemented to store the device name and settings with actions like “Set Input ON” “Auto-Scale Y”
    and “Get Trace”,…
    Screen Stacks can be implemented by using control references in one USR and maintain a screen view stack in another
    then implementing actions like “Set Config Screen”, “Set Login Screen”, “Back”…
    Users can be managed using an AE with action such as “Add New User” “Set Password”, “Disable User”…
    The list goes on and is limited only by our imagination. Here is an example that shows how a running average can be
    maintained.
    Running_Average_Example.jpg
    Running Average Example
    The Running Average Example shown above shows how a running average can be maintained using an AE. The AE is
    initialized before the While Loop executes. On each iteration of the loop the simulated measurement value (random
    number) is used to update the history of all measurements (Add Number(s)) and the mean is calculated (Calc Mean).
    Please note that although the buffer of all measurements is affected in every step of this example, the buffer (USR in
    the sub-VI) contents are never part of this VI’s diagram. Since the history is stored in the sub-VI, the history can be
    acted on from more than one thread as shown below.
    Parallel_Loops.jpg
    In the parallel Loops Example the history is initialized and then two loops run in parallel with one updating the
    history and the other plotting the average. Since the History resides inside the USR of the sub-VI the two while loops
    are effectively sharing the same block of memory, the block used to store the USR. The Sub-VI was implemented as shown
    in the following sequence of images.
    Init.jpg
    As was the case with Functional Globals, the actions are implemented as a type def’d enum***** driven case structure.
    Appropriate code is present in each case to realize the intended actions. In the “Init” case, contents of “Array in”
    are used to initialize the history. In our example above we did not pass an initial array value. Therefore the “Init”
    resets the history (cleared the array).
    Add Num.JPG
    The operation of the AE when the “Add Number(s)” action is called varies depending on its usage. If the caller passes a
    non-empty array, it is appended to the array. Alternatively, passing a value via the Numeric in” control, and leaving
    the “Array in” un-wired adds a single element to the history. We used the Numeric In input so we were continually
    building our history one value at a time.
    Calc_Mean.JPG
    When the “Calc Mean” action is invoked, the average is calculated and returned.
    This Nugget is continued in the next post
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    Nugget continued
    The Traffic Cop Behind the Scenes
    A detail I have not mentioned up until now is that AEs should be implemented as VIs that are not reentrant***. VIs that are not reentrant can only be executing in one context at a time. LabVIEW will ensure that if there is ever a situation were two contexts are attempting to act on the same AE at the same time, LabVIEW will schedule the first and the subsequent will wait until the first call completes. This is similar to a traffic cop preventing more than one vehicle from entering an intersection at the same time. The Traffic Cop is illustrated in the following timing diagram were we look at how the processing of two threads is affected by using a single AE.
    Execution_Timeline.JPG
    In the figure above the processing time of two processes “P1” and “P2” are illustrated by a red or blue solid arrow respectively. In the parallel loops example shown earlier, P1 could be the “Calc Mean” loop and P2 could be the “Add Number(s)” loop.
     t0 - t1
    Both processes are executable and run their assigned tasks. Neither process is accessing the AE.
    t1 – t2
    P2 continues to run while P1 calls the AE. Since the AE is idle it is available to run so P1 continues execution running inside the AE until all work inside the AE completes. The dotted arrow shows that the thread for P1 is executing in the data space allocated for the AE.
    t2 –t3
    At t2 the AE terminates and both process run as in t0 – t1.
    t3 – t4
    This time segment is similar to t1 – t2 with P2 running in the AE.
    t4 – t5
    Similar to t2 – t3 the AE terminates and both process run.
    t5 – t6
    Similar to t1 – t2. P1 take control of the AE.
    t6 - t7
    At t6 P2 attempts to call the AE. Since the AE is not idle it is not available to run. P2 is placed in a resource wait state (it is NOT running) waiting for the resource to become available. The dotted horizontal arrow indicates the process is not executing.
    t7 –t8
    At t7 the call of the AE by P1 that started at t5 completes and P1 continues to execute outside of the AE. When the call by P1 completes the AE becomes available. The process P2 is marked as executable. The scheduler includes P2 in its executable threads and the AE is available. P2 then executes inside the AE until the call completes.
    The Beauty of the AE
    This behavior of a non-reentrant VI is a wonderful feature we can exploit to eliminate race conditions. Race conditions are the nemesis of many a developer. In hardware this was solved with clocked enabled logic. In LV we solve race conditions with Queues, Semaphores, Rendezvous, Occurrences, and Action Engines!AEs can eliminate race conditions when all operations involving updates of the data stored in the USR are done INSIDE the AE. A very simple illustration of how the encapsulation of USR manipulation is shown in the following set of examples.
    Port_With_Global.jpg
    This VI is intended to demonstrate how two bits of an eight-bit port can be used to control the running state of two pumps. To illustrate the control process, one pump will be set running at start-up and then every half second the state of both pumps will be toggled to simulate switching of the supply. This example uses globals and fails miserably.
    Port_With_Global.jpg
    In this example we start out by initializing a global variable so that bit “1” (zero based) is the only bit set in an array of eight bits. This turns on Pump 2 to start. Then the “Port Update” and a “State Change” loops run in parallel. In the “Port Update” loop the state of the port is read from the global and used to update the GUI.
    In the “State Change” loop, the port status is read and the first Boolean is inverted before being written back to the global. Similarly for the second Boolean. Since the read of the globals both occur before the subsequent data processing, one of the threads will be processing old data.
    Port_With_Action_Engine.jpg
    The Action Engine version codes up the same way as the global version but now all of the data manipulation of the port states are encapsulated in the Action Engine  “Port Controller”. This encapsulation ensures all operations involving the data in the USR are forced to happen sequentially even though we did not have to implement any code to achieve this affect.
    The key point to take away from this example is a shared resource (the port status in the case) when implemented as AEs come with resource contention resolution built in provided that all manipulation of the shared resource takes place inside the AE.
    Action Engines to the rescue!
    Action Engines are not a replacement for Queues, Rendezvous and the other synchronization techniques. They are typically called for when your design dictates that a single resource must be shared by more than one parallel process and none of the LabVIEW provided techniques are sufficient. They require a design of their own to ensure they work correctly. They also have to be developed and supported.
    This Nugget is continued in the next post
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Cant play purchased itunes videos on 5k iMac HDCP error

    After a few days of smooth sailing with my brand new 5k retina iMac I tried watching some purchased tv shows on itunes and I get this instead  "THE SELECTED VIDEO WILL NOT PLAY ON YOUR DISPLAY This movie can be played only on displays that support HDCP (High-bandwidth Digital Content Protection)". I was able to watch episodes yesterday with no issue. There are no external monitors connected. I'm on my usual secure wireless network. I'm running version 12.1.2.27 of itunes. I have tried restarting the system, and itunes but the issue persists. Access to the file is not the issue as the files do download and start to play anywhere on the timeline but get cut off after 3  seconds or so by the error message. I have  not changed the display settings since unboxing and initial setup. The screen is at full resolution just like it was when itunes was playing shows and not giving me this error message.
    Any one else got this issue?
    Any solutions?

    You have 90 days of complimentary support, please click Complimentary AppleCare Support to get started.

  • ACL Found but not expected on "Library"

    I looked at the ACL's for Library and I wouldn't have changed that myself but also don't see where it's deviated from the standard in the Info window. Also, Disk Utility won't correct or repair the ACL so I'm not sure if I am exposed here or not. The current ACL for /Library/ is drwxrwxr-t+ 55 root admin. Can someone tell me what is expected or if there's another way to correct this or whether I'm exposed here or not... please advise.
    Thank you!

    I suggest that the message "ACL found but not expected on 'Library'" is not harmless, as suggested by Apple and echoed by many in this thread.
    My experience is that Spotlight searches are suddenly not comprehensive. In a recent search, a file that I knew to exist and saw onscreen was not included in Spotlight's result. That file is located in /Users/.../Library. I'm aware that that is not the same as /Library, to which the message refers, but since /Library is above /Users/.../Library in the file hierarchy, I assume that, in one way or another, the ACL (Access Control List) is causing my file not to be available for Spotlight's search. BTW, the file does not appear with Terminal's "locate" command either. I can select, open, and otherwise manipulate the file in the Finder.
    Another anomaly: my Mac Pro is connected to an older G4 Quicksilver by an Ethernet cable. Surprisingly, there are many – not all – files (in the G4's /Users/.../Library file and elsewhere) that are inaccessible to me in screen-sharing mode. I originally thought that this was because the G4 is running Tiger. But, upon consideration, it seems to be more likely caused by an access denial.
    Finally, the Mac Pro's Superdrive recently became unable to recognize or read CDs, though it continued to handle DVDs. I installed a new Pioneer Superdrive which works fine, with a major exception. It is not consistently recognized (mounted?) by the system. I.e., it does not respond to a Media-eject-button command. I installed the Media Eject icon into my Menubar and that usually works. But after the machine goes to sleep, even that doesn't work reliably and programs like Safari and Mail get hung unexpectedly. Disk Utility's Open and Close commands are reliable. It seems that the System still expects the original Superdrive and the tidbit of data that makes the new drive a part of the System has not been written and accepted. The most likely suspect seems to be a denial of access to write the new drive's identity.
    Accordingly, I suggest that the "ACL ... Library" message is not harmless. It represents an oversight by Apple's software engineers. The ACL may be intended to prevent accidental (or nefarious) deletion of important files, but, as written, it is overbroad and denies legitimate users access that enables the Mac to perform as advertised.

  • Windows 8.1 installation failed due to error code 0x80240031

    I tried to update my OS to windows 8.1 single language from windows 8 pc. But my installations was unsuccesful  due to error code 0x80240031 . What is the problem and what is it's solution

    Hi,
    How did you upgrade Windows 8 to Windows 8.1? Through Windows Store? To resolve this problem. Firstly, please check and install all Windows update, and upgrade hardware driver to be latest. After that, please try to create a new user account and upgrade
    system again.
    If problem persists, please access to the path below to check Windows installation log:
    setupact.log and setuperr.log in c:\windows.~BT\Sources\Panther. If this folder not exit, please check setupact log in C:\Windows\Panther. You may find the reason for this problem. You also can provide these log to us, we can help you analyze these log together.
    Roger Lu
    TechNet Community Support

Maybe you are looking for

  • Imessage for some contacts and sms for others

    My wife just bought a 4S, my (grown, married) daughter has a 3GS upgraded to iOS 5.  My wife would like to send text messages to my daughter but my daughter does not have SMS on her phone plan, so messages cost $0.25 each.  The question is how can my

  • Multiple writers for a field

    I get an error indicating that i have multiple writers for a field table_a.item_key. I have 3 classes that use this field as shown below. @Entity @Inheritance(strategy=InheritanceType.SINGLE_TABLE) ... @Table(name="table_a") @DiscriminatorColumn(name

  • How to measure a current signal with NI 6211?

    How to measure a current signal with NI 6211?

  • InCopy Won't Let Me Check Out a Story

    Hi, I appear to be having a very unusual problem with InCopy. It won't let me check anything out. I don't get an error, or a message, it's just not checked out. I have tried checking stories out in every way i know how and every time i am left with a

  • Exporting Slideshows in 16:9 format?o

    Hi Folks, Just spent hours cropping and editing photos to be in a 16:9 format (HiRes source), how can I export this slideshow to a file that I can import into iMovie (16:9) I've tried iDVD, but it seems that I can't extract that slideshow into iMovie