Need Advice: Accessing JNDI resource which uses configuration file

Currently I have a class which has a constructor which takes a path to a configuration file. If I wanted to use this class as a JNDI resource what would be your advice when working with a configuration file? If an application was to use a remote JNDI resource I could see how this would be a problem. I understand how to do it I'm just not sure of the right way to do it. I guess I'm looking for best practices advice.

Hello,
Yes, you can use the API RessourceBundle to read configuration informations.
Just create a propertie file with your locale, and access it to read informations :
for example :
you create a file config_fr_FR.properties (i'm french).
for accessing your information ( strValue1 = aValue) :
String ressource = null;
try {
ressource = ResourceBundle.getBundle("config",new Locale("fr","FR")).getString("strValue1"); // better is to create a static Locale... here just for the example.
} catch(Exception e) {
// ooops...
return ressource; // return aValue
Hope this help.

Similar Messages

  • I need to access a website that uses Safari 5.0. I'm using 5.1 and OS 10.6.8 and would like to install 5.0. I do not have time machine installed so I cannot go back and reinstall. Any Suggestions?

    I need to access a website that uses Safari 5.0. I'm using 5.1 and OS10.6.8. I do not have Time Machine activated - so I cannot go back and reinstall Safari 5.0  that way. Any suggestions?

    Safari 5.1.9 and Java 6 are the latest versions available for OS X 10.6.8. To upgrade any further you would need to upgrade to Mountain Lion (OS X 10.8.4) through the Mac App Store.
    http://www.apple.com/osx/how-to-upgrade/

  • Logging with jdk1.4 - how to add a handler using configuration file

    Hi, all
    I am playing around with java.util.logging in jdk1.4. In particular, I am using a properties file for configuration. However, one thing I couldn't do is to assign a handler, such as the ConsoleHandler, to the com.xyz.foo logger. Everything for the root logger works just fine. Here's the file I use
    handlers= java.util.logging.FileHandler
    .level= INFO
    java.util.logging.FileHandler.pattern = jdk14.log
    java.util.logging.FileHandler.limit = 50000
    java.util.logging.FileHandler.count = 1
    java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
    java.util.logging.ConsoleHandler.level = INFO
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    com.xyz.foo.level = WARNING
    com.xyz.foo.handlers = java.util.logging.ConsoleHandler
    Nothing comes out on the console and everything from the com.xyz.foo logger is logged to jdk14.log file.
    Can any one tell me why the last line has no effect?
    Thanks much!

    Logger configuration files are grossly misunderstood due in large part to extremely poor documentation (some of the worst I have ever seen for the Java platform). The LogManager class uses logger configuration files to do three things:
    1. Load porperties into a private Properties object that application programmers can subsequently access using the getProperty(String name) method in LogManager.
    2. Those properties (or else the documented defaults) are then used to configure the root logger as well as the "global" handlers that are used by the root logger
    3. Finally, whenever a logger is created the Properties object is checked to see if a key exists for the logger name + ".limit". If so, then the logger is assigned that level.
    Notice that nowhere in here does it say that a programmatically created logger is configured. In your case, you must invoke getProperty("com.xyz.foo.handlers"), parse the property value (which is a bit tricky if there is more than one handler class name), load and instantiate the handler class, and invoke addHandler. Great huh? I'm in the middle of a indepth study of logger configuration, and I can tell you for sure the static configuration using configuration files is an order of magnitude harder than dynamic configuration. It offers the advantage of field service engineers being able to change the logger configuration, but at a very significant cost.

  • Error message Indesign:Either the file does not exist, you do not have read access to it, or use the file in another application.

    I've got problem with opening a file in InDesign. The file type is an InDesign Markup Document. The error message is: Either the file does not exist, you do not have read access to it, or use the file in another application. What's wrong?

  • How to declare a JNDI resource which is not a datasource ?

    Hi,
    I'm looking for a way to create a jndi bound resource, as a jang.lang.String for instance, within oc4j enterprise console or maybe by editing config files.
    I'm trying to configure an application once for all, so that I can deploy a .ear which is identical for development, testing, validation, production, ... environments while being able to configure those instance independently.
    Can it be done with oc4j ? (it's intuitive to create a jndi bound resource if it's a datasource, but it seems to be the only kind of resource we can create) and if so, how ?
    thx in advance
    Olivier

    Hi Olivier,
    As far as I know, this is not possible. I see only three ways
    1. Add an OC4J startup class and bind the desired names into JNDI
    (not sure, whether this is really possible)
    2. If you need the bound JNDI objects only in a web application: just add them to your web.xml file
    3. Write your own provider and add it to the default application.xml or to your application's application.xml
    Best,
    Manfred

  • How do i stop the "Opening Ads" download javascript file everytime i access a website which uses googledoubleclick ads??

    Every time a access a website which has embedded googledoubleclick ads in it, i get this pop up-like thing which tells me to download a javascript file called "ads", from http://googleads.g.doubleclick.net and it asks me to save it... i would love to send a screenshot, but this question text area doesn't allow me...
    therefore, i have uploaded the snapshot .jpeg file on my website so you can see it. This has been bothering me a lot, sometimes there are pages which have embedded 5 ads, and i get a pop up for each ad. Mind you, it's not the window popup that you get, it's a download popup...
    snapshot link:
    http://www.avosarafian.com/snapshot.jpg
    regards,
    Amjo

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Use configuration file VIs to set AppFont in INI

    I am using the following code in an attempt to set AppFont, SystemFont, and DialogFont in an executable's .ini file all to Segoe UI 15. I was disappointed to discover that the configuration file VIs don't seem to write the key correctly. When I use this code, I get the following in the .ini file:
    AppFont = ""Segoe UI" 15"
    SystemFont = ""Segoe UI" 15"
    DialogFont = ""Segoe UI" 15"
    What I really need is:
    AppFont = "Segoe UI" 15
    SystemFont = ""Segoe UI" 15
    DialogFont = "Segoe UI" 15
    In other words, the configuration file VIs add an extra set of quotation marks. With this extra set of quotation marks, the executable ignored these settings. The "write raw string?" input didn't seem to affect this behavior. 
    Does anyone know of a way to get the configuration file VIs to write this key/value pair correctly, or do I need to write extra code to either remove the quotations or do the whole thing myself? It seems like the configuration file parsing/editing VIs that NI provides should be able to parse and edit NI-provided configuration files...

    There is no way to do this with the current config file API. That "write raw string" input only pertains to escaping certain characters. We also have an internal API for writing data specifically to the LabVIEW.ini file, but it has the same problem with extra quotes.  For now, you'll need to either refrain from using the config file VIs, or add some post-processing code to go in and remove the extra quotes.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Can I change the content of a section in config data file use Configuration File VIs of LV?

    There are  few sections in my .ini file, I need to change the content of a section in this .ini file. Are Configuration File VIs in File I/O fuction pallete able to do that?
    Thanks.

    You should be able to.  Open the .ini file, read the key (if it exitst) delete it and write a new key (you might be able to directly overwrite the key but I havent tried this). Close the file with the write file? set to true and you should have modified the .ini file with the config vis.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How to use configuration files in jsp

    Hi all,
    I need to handle the data from a properties file (txt file). Where should I keep this file in tomcat. Any examples related to this in jsp ? Plz help me.
    Regards,
    Sam

    You can have this file in any location under Tomcat ROOT Directory.
    preferably under conf/ directory

  • Need Advice WRT iPod Purchase - Which Model?

    I've never considered buying an iPod before, but I've been making a lot of business trips by car in the past couple of years, so having music to play all long the way would be A Good Thing. But, which model to buy???
    I don't think I'll have the need to play videos, but I like the idea of having an info screen. I'm not sure the Shuffle is for me, because I'd like to have more control over what's playing and what to play next. But I can't imagine having more than 6 or 10 albums stored at any given time. My tastes in music just aren't that broad.
    However, I have thought about the option an 80GB iPod would give me. That is, I could copy all of the installer disc images for all of the Final Cut Studio discs and the latest updates to the OS and support apps. Then when I'm on a Final Cut system support call, I'd have all the files I'd need in a very small package, rather than a large firewire drive.
    So, advice anyone? Thanks.

    Thank you. Yes, I'm familiar with that type of FW drive. That would be buying two new devices. Not out of the question, but if I could get by with one, it would be a bonus.
    The iPod nano, huh? I assume the display on those will help me see what's playing and what song I can choose to play next, right?

  • Problem accessing company resources remotely using Cisco VPN Client

    I connect to my company's network remotely using Cisco VPN client both from a PC (v 4.0.1) and from a MacBook Pro (v 4.9.00)(same configs), and use Remote Desktop to connect to my work computer, and now i'm able to use Citrix to run applications on the company server.
    The problem occurs on the Mac when I'm connecting from a location that uses the same private domain IP as our company's private domain. Our company's private domain is 192.168.1.x, so when I'm using the Mac on a WiFi router that happens to be set to 192.168.1.1, the Mac can connect using VPN but the remote desktop cannot connect to my work computer. Presumably, the Mac doesn't "know" that I'm trying to go through the VPN for the connection and not connect to something locally.
    This problem seems to be unique to the Mac. Every Windows machine with the same client installed has no problems no matter what WiFi I've tried. The Mac works fine on any WiFi that is not 192.168.1.x.
    However, since 192.168.1.x is very common (hotels, airports, etc., its a major problem with the Mac.
    Suggestions are greatly appreciated!
    Also, now that we're moving to Citrix, our administrator has created a webpage on the intranet that we launch applications from, but the Mac cannot find that page when connected to VPN from 192.168.1.x. Same problem.
    Thanks in advance.

    Hi,
    I presume you have split-tunneling activated.
    1. Make sure the 192.168.1.x is on the protected networks and on the MacBook client, disable "Allow local LAN access"
    2. Create a separate group for the Mac users and assgn them a different pool (192.168.100.x )and advertise it in your company to point to the VPN Concentrator.
    3. Use the NAT feature on your VPN concentrator.
    If this helped, please rate.
    Regards,
    Daniel

  • Need advice on making a simple Flash video file. Trying to accomplish two things.

    I have some video files (.avi) that I am trying to convert to a Flash video format. I am trying to export it to a Flash player to go into a Powerpoint file. With this, I am trying to accomplish two goals:
    1. To have the short clip (15sec, 30fps) endlessly loop, like an animated .gif.
    2. To allow the user to click on the video player and drag left/right to ff/rew.
    The video itself is a turntable animation. One of our products is making a complete 360degree turn. By allowing the user to grab and drag, it will simulate them rotating the model.
    So far, I have already accomplished Goal 1. I made a new Actionscript 3 file, imported video (embed flv in swf and play in timeline), and then made the video loop on the timeline. This seems to export properly, and the video loops as needed. The only thing I can't figure out is how to make the video "interactive" and let the user drag left/right.
    For context, I have never used Flash before. Any help would be greatly appreciated.

    This will come down to essentially moving the playhead of Flash based on the movement of the mouse. It's certainly not going to be smooth however, you'd need a timer to be responsible for moving your playhead and reversing spatial compression is very CPU intensive (moving backwards on the timeline). I'd recommend having a forward and backward version of the video so you could flip between them but if you're new to flash you're already in way above your head.
    Add a new layer and try adding this example script (or Download Source example here, saved to CS5):
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.MouseEvent;
    // make sure we don't trip this frame twice
    if (!stage.hasEventListener(MouseEvent.MOUSE_DOWN))
              // stop playhead
              stop();
              // set state (forwards? backwards?)
              var movingForward:Boolean = true;
              var curFrame:int = 1;
              var mouseStartX:int; // used later to determine drag
              // detect mouse click and drag left or right
              stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseF);
              stage.addEventListener(MouseEvent.MOUSE_UP, onMouseF);
              // create new timer to control playhead, start it
              var phTimer:Timer = new Timer(33,0);
              phTimer.addEventListener(TimerEvent.TIMER, movePlayheadF);
              phTimer.start();
              // function to control playhead
              function movePlayheadF(e:TimerEvent):void
                        curFrame += movingForward ? 1 : -1;
                        // validate frame (60 total frames)
                        if (curFrame > this.totalFrames) curFrame = 2;
                        else if (curFrame < 1) curFrame = this.totalFrames;
                        // goto the next frame
                        this.gotoAndStop(curFrame);
              // function that controls the direction variable
              function onMouseF(e:MouseEvent):void
                        if (e.type == MouseEvent.MOUSE_DOWN)
                                  // user started touching, record start spot
                                  mouseStartX = int(stage.mouseX);
                        else if (e.type == MouseEvent.MOUSE_UP)
                                  // user let mouse go, determine direction change (swipe stype)
                                  if (stage.mouseX > mouseStartX)
                                            // swiped right, move forwards
                                            movingForward = true;
                                            trace('Moving forward now');
                                  else if (stage.mouseX < mouseStartX)
                                            // swiped left, move backwards
                                            movingForward = false;
                                            trace('Moving backwards now');
    This is pretty simple. In the example source link above an object on the timeline (nice ugly red circle) moves right over 60 frames and then left over 60 frames (120 total). Consider that your movie.
    A timer ticks at a speed of 33ms (30fps). This is where it isn't necessarily going to be too smooth with video. If you increase it to 60FPS then decrease the timer by half (16.5ms), season to taste. Each time the timer goes off the playhead is moved, either forwards or backwards.
    To know if it should go forward or backwards a simple variable (movingForward) keeps track of the last 'swipe'. The swipe is simply captured when a user touches the screen (mouse/finger), moves in a direction and then lets up. If they moved to the left the direction will be reverse. If they moved to the right it will move forward. This doesn't take into consideration any more than that logic, but illustrates how you can watch the mouse for movement and "do something" based on it.
    A very simple validatior in the timer event function checks to see if the next frame (in either direction) is valid and if it's not, it corrects it so it stays within your videos timeline length.
    Note there is a MOUSE_MOVE event you can try to hook to which can be used to literally let the user drag the video forwards and backwards the amount they drag their finger/cursor. Also if this is some kind of circular surface like a record spinning, the direction the user moves the mouse based on where they touch the record would change which direction they expect it to move. Etc etc..
    That should get your feet wet in how much you need to consider for your project.

  • How to access the content in the configuration files

    Hi, Folks,
    To make it easy, the questions can be like this:
    how to access the content in web.xml in a web application?
    Through ServletConfig and context?
    how to access the content in ejb-jar.xml in an ejb?
    initial context?
    Thanks

    There is no documented way to delete data stored in archived log files: you can only remove the archived log files if needed.

  • I'm desperately needing advice to a common question.  I use Quicken and love it.  But the Mac version is not as great as the PC.   Has anyone installed it by segmenting their Mac with Parallels or Fusion or Boot camp.  If so, which one do you recommend.

    I'm desperately needing advice.  New Mac.   Used Quicken on my PC.  Researched all software for Financial programs and Quicken is still the most recommended.   I want to use Quicken on my Mac.  The Mac version is not highly rated so I would need to partition my Mac.   Has anyone done this for their quicken program and if so, which partitioning program did you use - Parallels, Fusion ware or Boot camp?
    Thx

    Lisa Ellies-Laye wrote:
    Thanks.  Hadn't heard of it. ?  Is there any concern installing this free program on my Mac.    Have you used it?  Apart from being free is there any other advantage of Parallels and VMfusion. ?
    Virtual Box is safe and well developed, it offers similar or identical features to the paid competition, it may be a little less polished but that's all.
    Download and try it out, nothing to lose (except time).

  • Access to Resources via Non-admin accounts

    Is there any way to provide access to resources so that they are accessible via
    non-admin accounts. For e.g. to Retrieve my JMSConnectionfactory i do a
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(username);
    env.setSecurityCredentials(password);
    Context ctx = env.getInitialContext();
    The username and password here is the admin account. This works fine but if i
    use a non-admin account(member of Operators group), i get exceptions on Domainloghandler
    runtime
    Problem: I need to register a mbean that needs to access JMS Resources. Since
    our deployment team doesnt want to provide us access to admin accounts, we use
    a "operators" group account to register our mbeans. if i do this, i get a
    Access not Allowed for subject:principals=[operator, Operators], on ResourceType:
    DomainLogHandlerRuntime Action: execute Target: registerToMe.
    This happens when my managed resource tries to access a JMS ConnectionFactory.
    Instead if i register my mbeans using the admin account, everything is fine and
    my managed resource works nice.
    This is on weblogic 81 SP1 on Solaris. Please let me know if you need more details.
    Any clues/hints/solutions greatly appreciated. There is not a lot of documentation
    on how to access/register mbeans using non-admin accounts.
    TIA
    Raj

    I have done some more debugging on this and have narrowed down the issue to the
    location where my initialcontext is being obtained.
    so if i register my mbean as a non-admin account and do an operation on the managed
    resource which fetches initial context, i get the below exception. This is how
    i get my initialcontext
    weblogic.jndi.Environment env = new weblogic.jndi.Environment();
    env.setProviderURL("t3://machine:8102,machine:8103");
    env.setSecurityPrincipal("operator");
    env.setSecurityCredentials("operator");
    Context ctx = env.getInitialContext();
    I am doing this from a mbean thats registered on a different managed server(t3://machine:8101)...
    Whats wrong with this?
    TIA
    Raj
    "Raj" <[email protected]> wrote:
    >
    Is there any way to provide access to resources so that they are accessible
    via
    non-admin accounts. For e.g. to Retrieve my JMSConnectionfactory i do
    a
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(username);
    env.setSecurityCredentials(password);
    Context ctx = env.getInitialContext();
    The username and password here is the admin account. This works fine
    but if i
    use a non-admin account(member of Operators group), i get exceptions
    on Domainloghandler
    runtime
    Problem: I need to register a mbean that needs to access JMS Resources.
    Since
    our deployment team doesnt want to provide us access to admin accounts,
    we use
    a "operators" group account to register our mbeans. if i do this, i get
    a
    Access not Allowed for subject:principals=[operator, Operators], on ResourceType:
    DomainLogHandlerRuntime Action: execute Target: registerToMe.
    This happens when my managed resource tries to access a JMS ConnectionFactory.
    Instead if i register my mbeans using the admin account, everything is
    fine and
    my managed resource works nice.
    This is on weblogic 81 SP1 on Solaris. Please let me know if you need
    more details.
    Any clues/hints/solutions greatly appreciated. There is not a lot of
    documentation
    on how to access/register mbeans using non-admin accounts.
    TIA
    Raj

Maybe you are looking for

  • Some mp3 files do not play after upgrading to iTunes 8.0

    some mp3 files do not play after upgrading to iTunes 8.0 have upgraded and some songs which used to play on iTunes 7 no longer play. album art is missing. when trying to play on of these songs, nothing appears in the playbar at the top of the window.

  • CommandLink in dataTable rendered method is called multiple times

    I have a dataTable in which one of the columns contains a commandLink. The commandLink has the "rendered" option bound to a backing bean method. When the page is submitted, the backing bean method gets called 8 times for each row in the table if the

  • MS SQL Server 2000 + tomcat 5.5  problem

    hi, i'm working with netbeans 5.5, ms sql server 2000 and servlets (mvc without frameworks). When i launch my webapp with netbeans, with bundled tomcat 5.5, it works fine but when i export and deploy it under an independent tomcat (5.5 too) it crashe

  • 8.0.2 Searching for Signal

    I have an iPhone 5c and at random times keeps saying "Searching". It's the most aggravating thing! I followed all the steps on one forum(Airplane mode and restarting my phone, resetting network settings, taking my sim card out, Restoring phone, setti

  • Error 1180: Call to a possibly undefined method class_name

    hi, i am new AS 3.0. When i try to compile my file it show the following error. 1180: Call to a possibly undefined method ClassA.                                 var obj =new ClassA(10,10); My class file contains... class ClassA {     public var Avg: