How to refer to JNDI PROVIDER_URL from within Tomcat Web app

Can anyone provide a clear description on how to refer to a "Provider_URL" relative to the web application root for which a Java Class resides within? My issue is as follows. I've looked through the JNDI tutorial and the Tomcat JNDI How-To's and I'm still unable to find a solution.
I'll elaborate:
I have a "PROVIDER_URL" class variable defined as:
private String PROVIDER_URL = "file:/C:/development/MyProject/MyWebApplication/WEB-INF/properties";I initialize my JNDI context within the class:
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
properties.setProperty(Context.PROVIDER_URL, PROVIDER_URL);
context = new InitialContext(properties);
cpds = (ConnectionPoolDataSource) context.lookup(baseName);
...The above example works fine. My question is given my web app's directory, how do I refer to "MyWebApplication/WEB-INF/properties" in a relative manner so that if I move my web application to a different server, the directory path does not affect my deployment and I dont have to hardcode the current path? Does this need to occur in the "server.xml" file? Can you provide a URL to an example?
Your suggestions are appreciated...thanks.

try to give
http://localhost:8080
or the app server based port address.

Similar Messages

  • How do I show/refresh data from an Access Web App in an Excel spreadsheet saved in a Document Library on Sharepoint 2013 online

    I have an Access 2013 Web App in my Sharepoint 2013 online website. It contains a query to report on its data (several, actually, but let's keep it simple). I want to connect an Excel spreadsheet to the query, visualise the data in pivot tables/graphs/whatever,
    save the spreadsheet in a Document Library, and let other team site Sharepoint users open the spreadsheet (preferably in Excel online, but with Excel client if it has to be) and see/copy the data, refreshed with the latest information from the Access Web App.
    Simple, surely!
    The way I'm doing it at the moment is to create an ODC file to connect to the cloud-based Access 2013 database, save that ODC in a Data Connection Library in the SP site, and use the saved ODC file as data source in the Excel spreadsheet. This works and
    successfully keeps everything 'in the cloud' but I can't get it to refresh in Excel Online, and if I open the spreadsheet in Excel Client I have to enter the database password every time to refresh it. I don't really want to issue this password to everyone
    who might want to view the data. There must be a better way than this ODC method, I suspect.
    Googlings on this have led down various blind alleys - Excel Services, PowerPivots, Web Parts - but I'm stuck on which to follow through. Please, someone, point me to an article/book/website that explains how to do this step-by-step in simple language..
    thanks
    Jonathan

    I don't see any quick way of achieving it - at least there's no such functionality exists in SharePoint. All you can do, develop an event receiver that will update the fields in the list item once the excel file is added/updated. You can use OpenXml API
    to manipulate the excel file.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • How to refer to enclosing instance from within the member class?

    Hi
    How to refer to the enclosing instance from within the member class?
    I have the following code :
    import java.awt.*;
    import java.awt.event.*;
    public class MyDialog extends Dialog
         public MyDialog(Frame fr,boolean modal)
              super(fr,modal);
              addWindowListener(new MyWindowAdapter());
         public void paint(Graphics g)
              g.drawString("Modal Dialogs are sometimes needed...",10,10);
         class MyWindowAdapter extends WindowAdapter
              public void windowClosing(WindowEvent evt)
                   //MyDialog.close(); // is this right?
    In the above code, how can I call the "close()" method of the "Dialog" class (which is the enclosing class) from the inner class?
    Thanks in advance.
    Senthil.

    Hi Senthil,
    You can directly call the outer class method. Otherwise use the following way MyDialog.this.close(); (But there is no close() method in Dialog!!)
    If this is not you expected, give me more details about problem.
    (Siva E.)

  • How to refer to an object from within a handler

    So I have a mouse listener that is attached to multiple objects as so:
      for (int i = 0; i < Grids.size(); i++) {
    Grids.get(i).addMouseListener(new GameMouseListener());
    }Now the problem I have is I need to know which of the Objects activated the handler
    obviously this wont work since the var "i" is not defined inside the class and was only used in the previous for loop.
    how to I know using the Handler Which Specific Object has been clicked on.
    public class GameMouseListener implements MouseListener {
            @Override
            public void mouseClicked(MouseEvent e) {
                if (Grid.get(i).isSelected()) {
                    Grid.get(i).unselected();
                } else {
                    Grid.get(i).selected();
            @Override
            public void mousePressed(MouseEvent e) {
            @Override
            public void mouseReleased(MouseEvent e) {
            @Override
            public void mouseEntered(MouseEvent e) {
            @Override
            public void mouseExited(MouseEvent e) {
            }

    user10689232 wrote:
    So I have a mouse listener that is attached to multiple objects as so:No, you have grids.size() amount of listeners, each listening to one object. Just pass the i along to the listener:
    new GameMouseListener(i); // and create that constructor

  • Cannot open file in Onenote client from within OneNote Web App

    I am facing a peculiar problem with One note.
    Environment: - SP2013 Enterprise with separate Office Web Apps server
    I can view/edit onenote files on OneNote web app without any issue but when I click "Open in OneNote" button, I get the error that "onenote cannot open the specified location..."
    Other office documents like word and excel work fine, only onenote has this issue.
    Any help is much appreciated

    Thank you for the update.
    We may try to use the Network Monitor tool to capture the network traffic for bothe problematic site and working site when reproducing this issue, and then read the traffic to find out the differences between them. To capture the traffic, start capturing
    first, then click the “Open in OneNote” button.
    Download Microsoft Network Monitor tool:
    http://www.microsoft.com/en-us/download/details.aspx?id=4865
    If you cannot find the differences, you can send the capture files to us via
    [email protected]
    and we will analyse them for you.
    Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • How can I access applet paramters from within javafx?

    I have a simple javafx applet from the clock tutorial, but I would like to initialise this from parameters that are specified in the <APPLET> tag, for exaple <param name="timeZone" value="America/Los_Angeles">My question is how do I access this parameter from within javafx?
    Thanks,
    Phil

    I'm looking for the same answer, if anybody knows ... ;)

  • Calling a webservice from within Bex Web Application Designer

    Hi
    I have a web-template built with BEx web application designer which also contains textboxes. This text should be stored by calling a webservice (standard BI-documents are not an option).
    Can anyone tell me how I could call a webservice from within the BEx web template to store the text contained in the textbox? The webservice-call should include some of the filter-varialbes of the web application.
    Is this only possible by the use of a JavaScript WebItem? If so - does anyone have an example of such a JavaScript.
    Thanks a lot in advance.
    Kind regards.
    Christoph

    Thanks for your response. The BSP page would work out fine if I only needed to save the data.
    But the next time I call the webtemplate, the textarea should be filled by another webservice call with the stored text (so the text can be modified und saved again). This will not be possible by calling a BSP page.
    Do yoiu have any suggestions how to integrate the text (return value from the webservice call) into the textbox in the webtemplate?
    Kind regards.
    Christoph

  • Start a BO report from within a web-application.

    Hi,
    An enuser want to start a BO report from within a web-application.
    The BO report ideally should not prompt for a login. The fact that we are using BO for reporting purposes should be transparent to the end users. The report should produce its output directly in Excel (pdf?) format. In WebI i can do a 'Save As' to obtain this, but it should go automatically so that the end users get their response directly in Excel
    the report should be parametrized. These parameters will be added to the URL by the calling application.
    To do a basic test of the Opendocument.jsp i created a number of test reports in WEBI, and i use the following URLs to execute them directly
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=tmsd1&sType=rep&sRefresh=Y
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=Yearselection&sType=rep&sRefresh=Y&lsSYear:=2002
    So this covers points 1 & 4
    What are the options for points 2 & 3?
    Kind regards,
    Johan

    The BO XI 3.1 environment works quite well now.
    Two more questions:
    1. When a user being member of the Readers group, still sees the Edit button in Webapplication - Infoview. Is it possible to hide or disable that Edit button ?
    2. Is it possible to make a user only seeing a part of the data in the universe ? When a query is run with a parameter, the user ses the parameter in the left column ... but in that way a normal user can change the value of that parameter giving him the possibility to see things he should not see. Making a separate query per user is overkill and too much work to do. Is BO XI 3.1 able to offer this possibility and how ?
    Rgds,
    Johan

  • Open client socket from within a Web Service

    Hello,
    I need to open a client TCP/IP socket from within a Web Service-type WebLogic
    Workshop app. When I try to read from the socket, the socket read operation hangs.
    When I use the same code in a J2SE Java app on the same machine using Eclipse
    everything works fine. It also works fine from within WebLogic, if I use a "URL"
    object instead of a "Socket" object. (However, I cannot use this type of connection.)
    Can anyone tell me how to work with raw TCP/IP sockets in this situation?

    Hi Udi,
    I have tested my code from within a Servlet and it works fine.
    The Servlet and the Web Service both call the same simple JAVA class. This class wants to access a DB, and therefor, I am using the Data Source.
    When the Servlet calls the class, everything works fine. But when I use the Web Service to call this class, I get the Exception "No attributes are implemented".
    I hope this information helps you understanding my problem?
    Thank you very much for your help.
    Kind regards,
         Nadine

  • I upgraded to Firefox 8.0.1 on may MacBook OSX 10.6.8 and not all files I download from my Outlook Web app are ashx file, not what they were originally sent in. How do I change this ?

    I have just upgraded to Firefox 8.0.1 on may MacBook (10.6.8) and now all files I download from my Outlook Web app labeled attachment.ashx, not as they were originally sent (.docx, .pdf, etc). How do I change this back?

    I'm going to back up to Firefox 7 next. I'm getting the drift that 8.0.1 and/or flash on 8.0.1 are unstable.
    I'll let you know if that solves this problem.
    NOPE. This had no effect.

  • HT204266 how can i make a cd from apllication in my app store

    how can i make a cd from apllication in my app store

    Export something from an app to cd?
    I'm afraid your quesion isn't very clear.
    If that's what you're wanting to do, you need to get the file off your iPad and onto your computer. You can use sync or mail it (if it's not big) or use something like dropbox to upload/download it.
    But there is no way to make a cd from the iPad. You have to get the file onto a computer with a CD drive

  • Calling a Portal Service from within a Web Dynpro DC

    Hello,
    I am trying to call a Portal Service from within a Web Dynpro development component without sucess.
    Can anyone give me some hints on the necessary steps in order to accomplish this task?
    Thanks
    Diz

    Hi Diz,
    I tried doing the same thing by following the steps as mentioned by you. Just to re iterate,
    1. Created a DC "Portal Application Standalone" project by the name myservice.
    2. Created a portal service inside myservice by the ame AmitsService.
    3. Exposed IAmitsService.class in the public part.
    4 Build and deployed the DC on server and tested it through an abstract portal component and it worked FINE !!
    Now..
    5. Created anoter DC of type WebDynPro
    6. Added SAP_JTECHS -> epbc.prtapi._api as a "Used DC" with dependency build time and runtime
    7. Specified the sharing reference in the properties as PORTAL:sap.com/myservice
    8. Tried to reference the service using the following code..
    IAmitsService portalservice=(IAmitsService)WDPortalUtils.getServiceReference(IAmitsService.KEY);
    9.Build and deployed the DC.
    10. When I run the application I am getting the following error
    Processing HTTP request to servlet [dispatcher] finished with error.
    The error is: com.sap.engine.frame.core.load.SAPNoClassDefFoundError: com/sapportals/portal/prt/service/IService
    Exception id: [000D6008418B005C0000002C00000D200004163CE6719E1D]
    PLEASE ADVISE

  • How to delete an old Iphone from "find my iPhone app"?

    How to delete an old Iphone from "find my iPhone app"?

    Swipe your finger accross the off line device and then select "Delete."
    You might want to review the app help file which explains this in detail (select Help upper left).

  • How to remove repeated mails in exchange online outlook web app

    Hi,
    Any help me , how to remove repeated mails in exchange online outlook web app . As we are in process of migrating mailboxes to office 365 . We have migrated 5 mailboxes . But when i checked outlook web app after migration completed , i could see repeated
    mails . When i compared with on premise outlook and office 365 outlook web app  , there was lot of differences in read and unread mails . 
    Customer is expecting , same read and unread count should be replicated to office 365 owa.
    Please suggest me to prevent this problem . As this is very urgent to give solution to customer . 
    Big thanks in advance.
    Vinoth .

    If you've setup Outlook 2013 so it's connected to Office 365, and you've import the .pst file into Outlook, it will be showing as another "mailbox" within Outlook, but default called "Personal Folders" (unless you renamed it when it was created).
    You should find that you can simply copy the mail items / folders from Personal Folders into their new home in the Office 365 mailbox. Once that's done Outlook will synchronise the items with o365 which may obviously take a while to complete, but once it's
    finished those messages will be available online.

  • Using the WLS 7.0 default realm can users/groups be added/deleted within a web app?

    If I use the default realm provided in WebLogic Server 7.0,
    is it possible for me to programatically add/delete users/groups
    from within a web application? Is there an API I can use to
    add/delete users/groups from the embedded LDAP server? Or can
    you only add/delete users/groups using the WebLogic Admin Console?

    Tom,
    The below is the program for creating a new user:
    import weblogic.management.MBeanHome;
    import weblogic.management.configuration.DomainMBean;
    import weblogic.management.configuration.SecurityConfigurationMBean;
    import weblogic.management.security.RealmMBean;
    import
    weblogic.management.security.authentication.AuthenticationProviderMBean;
    import weblogic.management.security.authentication.UserEditorMBean;
    import weblogic.management.security.authentication.GroupEditorMBean;
    import weblogic.management.utils.InvalidParameterException;
    import weblogic.management.utils.AlreadyExistsException;
    import weblogic.servlet.security.ServletAuthentication;
    import javax.naming.NamingException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    MBeanHome mbh;
    try{
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory" );
    // use administrator account in order to create a user
    env.put( Context.SECURITY_PRINCIPAL, "system" );
    env.put( Context.SECURITY_CREDENTIALS, "weblogic" );
    Context ctx = new InitialContext( env );
    mbh = (MBeanHome)ctx.lookup( "weblogic.management.home.localhome" );
    catch( NamingException e ){
    throw new ServletException( e.toString() );
    DomainMBean dmb = mbh.getActiveDomain();
    SecurityConfigurationMBean scmb = dmb.getSecurityConfiguration();
    RealmMBean rmb = scmb.findDefaultRealm();
    AuthenticationProviderMBean providers[] = rmb.getAuthenticationProviders();
    for( int i = 0; i < providers.length; i++ ){
    if( providers[i] instanceof UserEditorMBean ){
    UserEditorMBean uemb = (UserEditorMBean)providers;
    uemb.createUser( username, password, "dynamically created user" );
    hope this helps,
    Koji
    "Tom" <[email protected]> wrote in message
    news:[email protected]...
    >
    If I use the default realm provided in WebLogic Server 7.0,
    is it possible for me to programatically add/delete users/groups
    from within a web application? Is there an API I can use to
    add/delete users/groups from the embedded LDAP server? Or can
    you only add/delete users/groups using the WebLogic Admin Console?

Maybe you are looking for