Proper way to configure JDNI datasource

Hi all.
I'm a little bit confused about the myriad of ways to potentially configure a JNDI resource reference (in this case a datasource).
I'm using Tomcat 4.1 and Struts. It appears that JNDI references can be specified in the files:
Tomcat: server.xml and web.xml (for all apps)
Struts: struts-config.xml
App: web.xml
I'm trying to configure an Oracle Connection Pool DataSource using the OracleDataSourceFactory and OracleDataSource types. The question is, where is the resource properly specified? I've gotten it to work by putting code in the Tomcat server.xml file but that obviously ties me to Tomcat. If I put it in struts-config.xml that ties me to Struts, so what I'd like is the proper way to configure it in web.xml (which is supposed to be the same no matter which app server you drop the app into).
Anybody got any advice??
Dave

Hello!!
I think that your code is 100% portable, but the datasource isn't it. Because you need do a new connection pooling for every diferent server you have, and you can reference it from your code for use it. I don't know if you can export the server configuration to a file and then this file could be loaded in another similar server, the same way that you can do a war file and then you can deploy it in a new server.
I hope this can be helpful
Bye!!

Similar Messages

  • Vendor-independent way to configure a DataSource

    Does anyone have advice on a app-server independent way to configure DataSources for a J2EE app? I currently define my connection pool in weblogic.properties, but I'm trying to get as much out vendor specific config files as possible.
    Thank you,
    Adam

    I remember that in weblogic6.0sp2 you can config a DataSource in a file named config.xml. and that file belong to a individual application(or a website? that project is not on my hands and I can not sure). Hope it can help you.
    Best Regards.

  • What is the proper way to extend 2nd generation time capsule network to 2nd generation Airport Express?

    I have a Simultaneous Dual Band Time Capsule. Up until now, I have been extending the network with the Airport Express (2nd Gen, the 802.11n model). Since it was not simultaneous dual band, it was extending over the 2.4 GHz band so as it could extend b, g, and n and support my iPhone at 2.4 n as well as my iPad and MacBook Pro at 5 GHz.
    I just bought the new simultaneous dual band unit, which theoreticalkly should be able to extend both bands.
    Now, it is not that simple. I also run a guest network, which I assume also gets extended when WDS is on. I also still have the old Express which I have relegated to another part of the house.
    When I set up the new Express, it asked me which one of the networks I want to join, either <SSID> or <SSID 5GHz>, the automatically generated name for the the 5 GHz band on the Time Capsule. Which one do I join? How do I know that both are extended? When I connect to the <SSID 5GHz> now my iPhone can see that one and connect to it, so I am assuming it is NOT going at 5 GHz.
    And I have no idea at all what the guest network is doing....
    Does anyone have any insight into tthe proper way to configure all the units, and what I can expect? My network is as follows:
                                                                                             Airport Express (Simultaneous Dual Band)
    Cable Modem > Time Capsule (Simultaneous Dual Band) >
                                                                                             Airport Express (802.11n, last gen)
    I want to run guest network (hopefully simultaneous dual band) and personal network. I want the new express to run both bands just like the Time Capsule, and for the old express I want to know which of the two bands I am extending.
    Thank You!

    I also run a guest network, which I assume also gets extended when WDS is on
    Unfortunately, the Guest Network cannot be extended.
    When I set up the new Express, it asked me which one of the networks I want to join, either <SSID> or <SSID 5GHz>, the automatically generated name for the the 5 GHz band on the Time Capsule.
    This likely indicates that the Time Capsule has been setup to use separate names for the 5 GHz and 2.4 GHz bands, instead of the default, which uses the same wireless network name for both bands.
    In order for the AirPort Express to be able to extend both bands, the Time Capsule will need to be configured so that both bands use the same wireless network name.
    Then, configure the AirPort Express to extend the wireless network name of the Time Capsule, and it will extend both bands.  At least, that is the way an AirPort Extreme works, and I assume that the Express is the same. I don't have an Express here to test, but will in another day or two.
    The location of the Express is important, since the 5 GHz signals are not as strong as 2.4 GHz signals. You may need to experiment by placing the Express closer to the Time Capsule than normal.  With an AirPort Extreme, I find that the Extreme must be located no more than about half the distance from the main router to the area that needs more wireless coverage.
    If you continue to use the previous model Express to extend as well, it too must be configured to extend the wireless network name of the Time Capsule. Configured this way, the Express will extend the stronger of the 2.4 GHz or 5 GHz signals, so it will likely extend the 2.4 GHz band unless it is located close to the Time Capsule.
    To find out which band the previous model Express is extending, locate a Mac laptop close to the Express and hold down the option key on your Mac while you click on the AirPort icon at the top of the screen. The info displayed will indicate whether you (and the Express) are connecting using 2.4 GHz or 5 GHz.

  • What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

    I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
    alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
    Thanks in advance. Been struggleing with this for days!

    When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
    Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
    There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
    However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
    Hope this helps.
    Marcos Kirsch
    Principal Software Engineer
    Core Modular Instruments Software
    National Instruments

  • Problem configure mysql datasource

    Hi, I am trying to use mysql datasource for my application. I had configured MYSQL_DRIVER and then
    i had configured gtasappdb datasource with
       driver-class-name = com.mysql.jdbc.Driver
       url               = jdbc:mysql://localhost:3306/appdb
       alias             = appdbdatasource
    And then i tried to deploy a EJB application which uses the above 'appdbdatasource'. When the application starts
    it says cannot find 'gtasappdb' connectionfactory.
    So can anyone tell me what should be done to use mysql for my application, please

    Hello mahesh,
    There are two ways.
    1. You should add a resource reference to the ds alias in the deployment descriptor of the application component.Once you have defined the reference,use the following snippet to access the data source
    DataSource ds = (DataSource) context.lookup("java:comp/env/<res-ref-name>").
    2. If you have not defined the reference in your application, use the JNDI reference "jdbc/alias".
    Hope this helps,
    Prasad

  • What is the proper way to publish standard proxies/services using PI?

    Hello experts,
    Iu2019m working on a Project where we have an ECC 6.0 and we need to publish some standard services to external third-party applications. We found that the functionality that these third-party applications need is accomplished by the service MaintenanceRequestCreateRequestConfirmation_In of component ESA ECC-SE 603. As we are centralizing all our interfaces in SAP Process Intregration I have installed the ESA ECC-SE 603 XI content in SAP PI. After the installation, in tr. SPROXY transaction of the ECC system I can see the proxy properly implemented and ready to be called. And now I have to configure the interface in Integration Directoy. What I wonder is whatu2019s the best practice to configure this in PI? As I can see in ESR the service category is Inbound but, if Iu2019m not wrong, I have to publish a Outbound service? What should I do? Copy the entire definition to my own Software Component and create my own Outbound service? What is the proper way to publish standard proxies/services using PI?
    Thank you in advance.

    Using the Page Items to Submit property on the report region, the Refresh action is all that should be needed. I created a copy of page 2 on page 3, removed the Set Value action, and it is working as expected. I don't have access to 4.2.1 to try it on that specific patch level, but I've been using Page Items to Submit with a Refresh DA since 4.2.0 with no problems.

  • What's the proper way to use reusingView in a custom UIPickerView

    Does anyone have an example of the proper way to use the resuingView parameter when implementing pickerView:viewForRow:forComponent:reusingView: in a UIPickerViewDelegate?
    The documentation states that reusingView is "A view object that was previously used for this row, but is now hidden and cached by the picker view."
    and: "If the previously used view (the view parameter) is adequate, return that. If you return a different view, the previously used view is released. The picker view centers the returned view in the rectangle for row."
    I need to create UILabel views so I can right justify things, and I have that working by always returning my copy of the view, but it seems like things could be made more efficient by returning the view passed to me if it's "adequate". So, how do I tell if the view is adequate?
    I've tried something like this:
    // check to see if the view we're given is a UILabel and return that view
    if ([view isMemberOfClass:[UILabel class]])
    v = (UILabel *)view;
    return v;
    else
    ... return a UILabel instance for this row ...
    But the view I'm being passed is never a UILabel instance. That or I'm not using isMemberOfClass correctly.
    Thoughts anyone?

    - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
    iPregnancyAppDelegate *iPregAppDelegate = [[UIApplication sharedApplication] delegate];
    UILabel *pickerLabel = (UILabel *)view;
    // Reuse the label if possible, otherwise create and configure a new one
    if ((pickerLabel == nil) || ([pickerLabel class] != [UILabel class])) { //newlabel
    CGRect frame = CGRectMake(0.0, 0.0, 270, 32.0);
    pickerLabel = [[[UILabel alloc] initWithFrame:frame] autorelease];
    pickerLabel.textAlignment = UITextAlignmentLeft;
    pickerLabel.backgroundColor = [UIColor clearColor];
    pickerLabel.text = @"Put YOUR text here!";
    return pickerLabel;
    Message was edited by: gpmoore

  • Spa112 proper way to provision

    History
    We have been using PAP2t and they worked and provisioned well.
    I create the file on my tftp server and then plug the PAP2T into my network.  In 5 minutes it has downloaded its config, upgraded its firmware and is registered.  The IVR works after about 5 seconds of plugging it in.  On a rare ocasion or when we are in a rush we get the ip and do a admin/resync
    Using the spa 112 this does not work
    I create my tftp config file and plug in the spa112.  After between 1-20 minutes (usually closer to 10) the IVR comes up and I can get an ip address.  Now I do a admin/resync  to get it to pick up the /spa112.cfg file.  now the spa112 has the profile rule a with all my default configs, profile rule b with the ata specific stuff.  I have to again wait the 1-20 minutes to get IVR to to an admin/resync.  now the spa112 has a firmware (1.1.0) file saved.  I have to do another admin/resync to get it to get the firmware
    It literally takes us 45 minutes on average to get a spa112 provisioned vs 5 min (and no work) on the pap2t
    What is the proper way to provision, shouldnt this work like the PAP2t or the spa50x phones do?
    Shouldnt the spa112 request the spa112.cfg file on boot up as the defualts contain resync at boot?
    Just tired of the spa112  
    If anyone has a batch of PAP2T's please contact me 714-338-8807
    Sage

    At the first, 5minutes for PAP2T is so long for me. So I developped procedure to minimize the delay that works for PAP2T. Now, it works for SPA112 as well for me with no modification, I ha snot been affected by problem your described.
    I can describe my procedure to you, it may help you to solve your problem.
    Following data are taken from SPA configured to "factory default" via IVR, then disconnected. Time is in format M:SS
    SPA in question has 1.2.1 firmware, but if I remembered correctly, it worked even with 1.0.2 for me.
    +0:00 - device powered on
    +0:40 - DHCP started by device
    +0:49 - DHCP handshaking completed, device has IP address and option 66 with TFTP server name
    +1:04 - NTP query started from device, got reply from server, completed
    +1:08 - DNS query with TFTP server name, got reply from server
    +1:08 - TFTP RRQ /spa112.cfg, data transfer
    content of first-time configuration file downloaded from TFTP:
            Yes
            30
            30
            Yes
            No
            Yes
            https://test-provisioning...cz/Cisco/Provisioning.php?PRVST=-2
    The trick is "flip/flop" of Enable_CDP. As this attribute require rebot on change, this force device restart. You can use any other attribute that force restart on change. As Resync_On_Reset is set to Yes, new provisionign request will be issued after reboot.
    In advance, there is Resync_Periodic and Resync_Error_Retry_Delay set to 30s, just to be sure.
    +1:09 - first-time configuration download complete
    +1:54 - DNS request for test-provisioning...cz, resolved succesfully
    +1:55 - HTTPS request
         final device configuration downloaded from HTTP server
    +1:55 - device reboot
    +2:43 - DHCP started
    +2:54 - DHCP completed
    +3:02 - NTP started & completed
    +3:52 - SIP REGISTER sent, registration completed, device ready for call
    You can compare my results with yours. It may help you to solve the problem.

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • What is the proper way to record line numbers in Master/Detail records?

    Guys and Gals,
    Been thinking about this for awhile, but thought it best to ask the people who really know what they are doing.
    What is the proper way to record & show line numbers in a Master / Detail record set?
    For example, take Master/Detail relationship Orders and OrderItems. Orders has a column Document_Number and OrderItems has Document_Number, Line_Number. Line_Number should contain the row number 1,2,3,4 ... etc. for each row in a document.
    Should I ...
    <ol><li>Add a sequence and a trigger in the database? The FusionOrderDemo does this, but then the sequence never "resets" and I've got row numbers that keep incrementing. So one document has rows 4,5,6 and the next document has 7,8,9 when they should both have 1,2,3.</li>
    <li>Programmatically take care of the row numbers? This seems like I'm asking for trouble. Anytime an insert or delete operation gets done, I'll have to iterate through rows and re-assign row numbers.</li>
    <li>Is there a way to assign row numbers in a table iterator (or data collection?) to an entity?</li></ol>
    Any suggestions would be appreciated. It's looking like #2 is my only option, but if anyone knows different I'd love the input.
    Will

    Thank you both guys.
    As John said, I believe I'm looking for a gap-free sequence per master record.
    The line number of the OrderItems table is the second half of the primary key. The first half of the primary key (DocumentNumber) is the foreign key to the Orders table.
    Think of it like line items on an order or invoice. For example, if you were talking to someone on the phone concerning an invoice, you might say, "The pricing for line item #3 is incorrect." In this case, it's good to have a common reference. Or imagine a Microsoft Excel spreadsheet with no row numbers displayed! You'd never get anywhere if you had to explain something over the phone.
    If this is tricky to perform, I take it using a sequence and trigger such as the Fusion Order Demo is the best way to approach the challenge for simplicity's sake?
    Will

  • What is the proper way to open the app store  for ios

    Using Air3.1 to develope a game.
    I want to have links on my main menu which will open the iOS app store for a specific application.
    The only way I have found to do this is by opening a url "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=<THEAPPIDHERE>&mt=8"
    However, while this does work, so to speak, when I try to go back to the application, it starts up as if it had crashed... and it does several "redirects" before it get's where it is eventually going.
    Is there a better/proper way to open the app store?
    Cheers
    dave

    Read this page, especially the later examples:
    http://bjango.com/articles/ituneslinks/

  • What is the best way to configure my iPods and user accounts?

    I'm looking for a little guidance. Here is my situation:
    I am running the latest version of Tiger. It is currently configured with three accounts; mine is the admin. account and each of my two children have their own accounts.
    My account is the one that is used most of the time. All of our calendars in iCal are maintained here including one for each of the kids. Each of the kids has their own Contacts list in the Address Book as well. I currently have a 5G 30GB iPod Video that I sync with iTunes through this account. Shortly, I will be buying an iPod Touch. I want my 30 GB iPod to be the one that has everything on it; it will be the one we take in the car on trips for music. I want the Touch to have some, but not necessarily all, of my music and all of our calendars and contact information. I am looking to use it to replace my Palm as my PDA.
    My son has a 2G Nano which currently syncs through his account.
    My daughter will be getting a 3G Nano soon.
    I will also be upgrading to Leopard very soon.
    Ultimately, I would like each of the kids to have their own iTunes libraries for music and podcasts and to sync their iCal calendars. As I understand it, however, they cannot access their calendars from their own accounts under my current arrangement. I also understand that there are several ways to configure my Mac to work with multiple iPods.
    Given all of this, what is the best thing for me to do? Should I set up all of the kids' iPods to sync through the admin. account so they can get their calendars at the same time? Or is their some way for them to have access to their calendar information from their own accounts under Tiger (or Leopard)? And as far as my two iPods (the Video and the Touch), should they sync through separate libraries, or through one using playlists. I also want to minimize duplicate data wherever possible, be it music or records in iCal and the Address Book.
    Thanks in advance for any suggestions or advice!

    Anyone...anyone? Bueller...Bueller?

  • What is the "best" way to configure iTunes on an iMac with personal user acounts so each user can access the media library but sync devices on their personal user account?

    I am trying to determine the best way to set up our imac so each user account can access the same media (songs, movies etc.) through itunes and also back up and manage their personal devices under their own personal user account.  There are 4 users on our iMac.  Me, my wife, and our 2 children.  We have built an extensive library of music/media together using the same iTunes store account.  I would like to establish a seperate apple id and iTunes store account for each of us going forward but have the ability for each of us to share our purchases.  What is the best way to configure our system and devices in order to allow shared access to media and at the same time allow for individual management of devices including contacts, apps, photos, etc. Please help, I would like to do this once!
    Thank you in advance! 

    OK, seeing as no-one replied (presumably because a lot of this information is on the forums in bits elsewhere) here's how I've got on so far.
    Applications - just went through them.  About the only one I needed was my media server app.  Just downloaded and re-installed, had a quick look back though my email to find the license key and it all went on fine.  Installation never seemed quite right on my old machine so solved that problem too. 
    Movies - New iMovies just copied across the clips and projects into their respective folders.  Seems to have worked but haven't checked it all that thoroughly.  Some duplicate footage here but I can trim this out at some point when I get a chance to go through here. 
    Documents - Just copied these across. 
    Photos - used an app called iPhoto Library Manager.  You can download for free but have to pay to use the part that consolidates your libraries.  Possibly if I was willing to spend a bit more time I could have got away without using this but given I didn't know the state of my different libraries and just how many duplicates I had this was too much of a convenience to ignore.  Also got my library into a state where I can now spend a few hours organising it a bit better with Faces / Events etc. 
    Not attempted Music or iPhone sync yet as been stuck trying to solve a problem with my power adapter. 

  • Is there a way to configure NTFS file system on an NSS 324 SmartStorage unit. So far I can setup ext 3 or ext 4 but no option for NTFS

    Is there a way to configure NTFS file system on an NSS 324 SmartStorage unit. So far I can setup ext 3 or ext 4 but no option for NTFS. This unit should be joining a Windows Server 2008 R2 network and needs to be shared with all users. This unit will replace a File server running Win 2003 SP2.
    Message was edited by: Hermann Koster
    Thank you very much for your reply. The idea is to decommission the Windows file server which is running Windows Server 2003 SP2 operating system but is not running as a DC but just a member server. All this server is doing is providing file server services so my idea is to replace it with the NSS 324 box. My only concern is that when my NSS joins the domain all my users would be able to see and access network shares transparently, the same way they saw the former W2003 file server. After I transferred the data from File server I will use the same for NSS that was used for file server as well as same IP address and folders path as before.
    Any suggestions or advice?
    Once again thank you very much for your reply.
    Cheers,

    The internal HDDs must be formatted in either EXT3 or EXT4 file system because NSS uses Linux OS.  This is mainly because the RAM designed to fit with the customized Linux OS's size.
    You can connect to an external HDD via a  USB or eSATA port. The external HDD's file system can be NTFS, FAT32, AFT or EXT3/4 to be recognized for read/write. You can connect a 2TB USB/eSATA drive connec to the NSS via USB port to format your HDD for NTFS, AFT, FAT32, or EXT3/4 partition.
    You can join the NSS to a Windows domainr so all domain users to access NSS. You cannot replace the NSS for the Windows 2003 SP2 server. They are two different products and do different jobs. Windows server is features sets server while the NSS is the files/data server.
    Hope that helps!!

  • Proper way to embed PDF into IE6 or 7

    Does anyone know the official proper way to embed these files?
    I have seen it this way
    [code]
    EMBED src="example1.pdf" width="450" height="450" href="example1.pdf"> /EMBED>
    [/code]
    and this way
    [code]
    OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH=728
    HEIGHT=728>  EMBED SRC="manual.pdf"
    HEIGHT=728 WIDTH=728> NOEMBED> Your browser does not support embedded PDF
    files. /NOEMBED> /EMBED>/OBJECT>
    [/code]
    Any help is appreciated.
    (I had to take out all the less-than signs becase it was trying to run the actual code.)
    thanks,
    -brett

    To send an html email, you must first build a web page (with the contents you need) then send that.
    Keep in mind that a lot of people have disabled the option to get the html so they will see garbage.
    Here is a great resource for html email design...
    http://www.mailchimp.com/resources/html_email_design.pdf

Maybe you are looking for