How to find the root document in my application, if application is deployed as  EAR file ??

          Hi,
          I want the real path, i mean root document.
          I my EAR file, i have only one WAR file. In my WAR file the following are the
          folders:-
          enterprise/..
          properties/sql/..
          locale/..
          WEB-INF/..
          Once i get the 'real path' or 'root document', I will use that in application
          in no.of times. Path is used in the following way in our application:-
          File emailTemplatesFolder = new File( path + "/enterprise/"+ enterpriseCode+"/EmailTemplates");
          If i use getRealPath() method, it works fine, in use Oracle9ias, because, EAR
          file will be extracted. Where as in Weblogic 6.1, EAR file willn't be extracted,
          so that getRealPath() is giving 'null', that is reason why i am seeking for alternative.
          Thanks in Advance
          Srinivas
          

Yes, that is the corrected behaviour.
What you need to do is to get the ServletContext, and then load the files as resources.
Here is how to load a properties file in the init() servlet method, which has access to the ServletConfig object that can give u the ServletContext.
String classesDir = "/WEB-INF/classes";
ServletContext sc = config.getServletContext();
InputStram is = sc.getResourceAsStream(classesDir+"default.properties");
props.load(is);
Hope it helps,
Liviu

Similar Messages

  • How to find the root document of my web application, if it is in WAR file ?

    Hi,
    I want the root document of my web application. I my EAR file, i have only one WAR file. In my WAR file the following are the folders:-
    enterprise/..
    properties/sql/..
    locale/..
    WEB-INF/..
    Once i get the 'real path' or 'root document', I will use that in my application in no.of times. Path(root document) is used in the following way in my application:-
    File emailTemplatesFolder = new File( path + "/enterprise/"+ enterpriseCode+"/EmailTemplates");
    If i use getRealPath() method, it works fine, in use Oracle9ias, because, EAR file will be extracted. Where as in Weblogic 6.1, EAR file willn't be extracted, so that getRealPath() is giving 'null', that is reason why i am seeking for alternative.
    Thanks in Advance
    Srinivas

    Yes, that is the corrected behaviour.
    What you need to do is to get the ServletContext, and then load the files as resources.
    Here is how to load a properties file in the init() servlet method, which has access to the ServletConfig object that can give u the ServletContext.
    String classesDir = "/WEB-INF/classes";
    ServletContext sc = config.getServletContext();
    InputStram is = sc.getResourceAsStream(classesDir+"default.properties");
    props.load(is);
    Hope it helps,
    Liviu

  • How to find the accounting document

    Dear all,
    Can somebody tell me how to find the accounting document from the MIGO transaction. I entered a goods delivery into the system. An accounting document should already be created.
    Best Regards
    Jerome

    Hi Jerome
    Go to that that material document (which was created through migo transcation)and click on Doc info header. There you can find FI documents. It will give the accounting documents (if any that has been created).
    Hope this helps.
    regards
    Anand.c

  • How to find the Internal Document Structure Number STLNR from the DIR Key

    Hello:
    Our requirement: When a user moves the Header DIR of a Document BOM to Released Status, we need to check if all the BOM Items in this Document BOM have also been released (in Status Released). If not, we need to give the user an error message informing them which component DIRs need to be released before the system will allow them to release the Header DIR. We can do this by entering the DIR Key of the Header DIR and find out the Internal Document Structure Number (Document BOM Number = STLNR for BOM Category Document Structure STLTY = D) from the available input of the DIR Key DOKARDOKNRDOKTL+DOKVR. Then we need to use the value of STLNR in Table STPO to find the Document BOM Items and check the status of each BOM Item DIR.
    If Table STKO had DIR Key as an input we would have our solution, but alas it does not. Can anyone point us in the right direction by suggesting how to get to STLNR from the DIR Key? Your help would be much appreciated!
    Niraj Pant

    Hi Niraj,
    the STLNR should be contained in structure rc29k. You can also use the DMS BAPI DOCUMENT_GETDETAIL2 with parameter GetStructure or DOCUMENT_GETSTRUCTURE. With these BAPIs you should be able to determine the document structure to an existing document info record. For further information on the mentioned BAPIs please see SAP note <a href="https://service.sap.com/sap/support/notes/766277">766277</a>  which contains a complete documentation on all existing DMS BAPIs.
    Best regards,
    Christoph
    P.S.: Please reward points if this information was usefull.

  • How to find the roots of other system in the network

    With out using RMI can we find the other system drive information(the roots available) from local(my) system..?

    public class roots{
    public static void main(String args[]) throws Exception
    System.out.println("The Drives are:");
    File[] roots = File.listRoots ();
         for (int i = 0; i < roots.length; i ++) {
         System.out.println (roots);
    This displaying the local system roots. Here how can i implement remote-filesystem protocol such as SMB or NFS .?
    I am not aware of this implementation as i am beginner ...
    kindly help me

  • How to find the Inventory document no based PO number

    I need to identify the PO no. for the inventory document nos which were generated thru MM.
    Any report or transaction code to view the PO number
    Regards
    KRISH

    Hi
    You need to check Mb51 report. You may not see Purchase order field in selection screen of Mb51. But in customizing you can bring it. see the belwo config
    spro>Materials management>inventory management>Reporting->define field selection for material document list
    here for program RM07DOCS(report mb51) add MSEG-EBELN and MSEG-EBELP. and tick output and selection.
    Now MB51 is ready for PO input. In desplay you get all transactions after PO in that.
    If your problem is not solved write to me
    regards
    Antony

  • How to find the attached docuements in po

    hi gurus,
    i have a typical issue, we r using ecc6.0.
    whenwe attach docuement to a sales docuement in sales order it has to be view in the production order.
    but we r not able to c the attachemnt in the production order pls help me in this.
    very urgent

    Hey,
    Plz ckeck out the schedule line category.whether is indicator tick on Requirement, Product allocation, availabilty check,assembly etc or not.
    If not plz do that and also check whether u have created Copy control setting or not.
    plz let me know.
    thanks
    mk

  • How to find the current document No in VBAK table?

    Hi
    I want to fill the set up tables from 2LIS_11_VAITM using Number ranges . Iknow initial Sales Order number but I want to know the current number so that I can set up a range..
    Thanks,
    Suresh

    Look in VBAK on the day you want to load on.  Grab the the highest number right before you load the setup tables.

  • How to find the XML file size in the scenarios?

    Hi All,
    Recently i have attended an interview at a MNC.
    They asked some realtime questions like
    1.how to find the XML document size in a File-File scenario?
    2.What is mass-assignment replication etc.....
    Can anybody tell me the solution for these.
    Best regards
    Hari prasad

    If the input is a flat file, there is no exact way to calculate the size of the generated XML file, since it depends on many factors (number of fields in the recordsets, size of the name of the fields, number of records, etc).
    As a rule of thumb, generally ppl use XML file size = 2 x Flat file size, in order to do sizing calculations etc. But again, that is just an estimation, not a precise calculation.
    Regards,
    Henrique.

  • To cancel logs in SM35 and find the root cause

    Hi,
    The role "PM****" is creating lot of sessions with the same session name and each session has hundreds of logs everyday in SM35. The logs is all about scheduling maintenance plans. There are hundreds of maintenance plans scheduling logs everyday. Can anyone help me how to find the root cause for this problem and stop the logs being generated in SM35?

    Hi,
    When you schedule RISTRA20 (transaction IP30) there are options for 'log control', check these and decide what level of logging you require.
    -Paul

  • How do I find the root cause of a NetConnection closed event?

    Hi,
    I am maintaining a large project developed in Flex/Actionscript.
    The application is using tunneling (RTMPT), and we often get Netconnection "closed" events.
    There is no problem with the physical network.
    I think the event may be caused by either a TCP/HTTP/RTMP event, or may be caused by
    some function in the client calling close() on the connection.
    How can I find the root cause of the "closed" event being thrown?
    Thanks,
    David

    Thanks for the information.  It is helpful but it seems there must be a specification of
    what the client side is expecting, independent of any server implementation. 
    When I say client side, I mean the Adobe communication libraries.
    Where is the specification or source code for how the client libraries treat HTTP tunneled requests and responses?
    One question in particular:  How does the client side library treat a
       Connection: Keep-Alive
    versuse
       Connection:close
    HTTP header setting?

  • How to find the GL Account for a Billing Document Item?

    Hi All,
       For a specific Billing Document Item, how to fetch the corresponding GL Account No.?
       I tried the below approach.
       Using the Billing Document Number, I fetched the corresponding Accounting Document No. then I tried to match the item of billing document with the item of Accounting Document by comparing the amount and then fetch the GL Account from table BSEG. When I compared the line items of both the documents, the no. of line items in the Accounting Document is more compared to the no. of line items in the Billing Document. I tried to match the items using Amount, but what if more than one item has the same amount but different GL Account No.?

    Hi,
    i would agree with what 'Rajasekhar Dinavahi' said.
    quote,
    <b>Hi
    If you open the billing document in VF03, click on 'Accounting' , select the accounting document, click on 'Administrat. data' tab.
    Here you will find the Reference Document and Reference item no.
    Regards,
    Raj
    </b>
    unquote
    The reference Doc will be XBLNR .
    Regards,
    Shehryar

  • How to find the WBS element for the payment document?

    Dear All,
    How to find the WBS element in the payment document?...I know in payment doc there will not be any WBS but is there any option where I can find in any of the Tables.
    I am in the process of developing a Z report where i need to fetch the payment documents based on WBS. Can any one please help me on this.

    Hi Ram,
    As you are not giving any input of WBS at the time of payment you cannot fetch this directly. But to know the WBS for the reporting purpose on which WBS the payment has been made, you can develop a Z-Report. The WBS elements of clearing documents against the payment entry can be fetched out.
    In this report if there is a single payment against many invoices also possible with different invoice and WBS elements to be displayed on the Z-Report
    Regards
    Divya S

  • How to find the related PI document from a material document

    Dear All experts,
        If I know the materil document number, how to find the related PI document?
    Thanks!
    Xinling

    Hello Xinling,
    You can extract the details from table MSEG.
    Regards
    Kalpana

  • How to create the change document functionality for a dependent objects?

    May I please know how to create the change document functionality for a dependent objects?
    I have done it follow the same process as for business process objects. But when i try to test it in BOBT, there is no records under "FIELD_CHANGE_WITH_FILTER". It seems the change hasn't been recorded.
    If the way I did to create change document for dependent object is correct, please also kindly advise the possibilities for why there is no record during testing.
    thanks in advance.

    I also have some doubts about the business object.In this case,one abstract BO hase a subnode wihich is root extended.I added the change document for this node under the category "root_extended" and then tested the function in BOBT.I got some error message "can't find the root key".Shall i redefine the method /BOFU/IF_CDO_CREATION~IS_CDO_CREATION_ACTIVE so as to solve the problem?
    Thx.

Maybe you are looking for

  • Passing multiple values to select-option low by submit at one go from zpro.

    Hi all, I have a requirement pass descrete multiple values form my z-program to to select-option low on selction screen of standard SAP program using SUBMIT statment at one go.At the same time select-option high will be empty.I will be thankful if an

  • Just upgraded to itunes 7.0 and want to add a new nano to my itunes

    I just bought an additional ipod to take running. I have an existing 20gb Ipod that I bought last year that I had synced to my old Itunes library. When I plugged in the new nano, it made me download itunes 7.0, and now it kept all of my songs in my l

  • How to convert date format in R3 system

    hi i have the problem converting the date formate in bapi for that i take value attribute value and map it with but it shows error

  • Recover lost activation code for CS4 [subject edited by moderator]

    I'm Cheong Man Keong, my software is Adobe Dreamweaver CS4 with product no.992536501348201435 and I have registered this software in Adobe.com in year 2009. Can help and support team Adobe.com tell me "activation code" for my software because I lost

  • Depreciation With skiped periods

    Dear experts, I have uploaded assets from legacy system with the depreciation value uptill end of may 2009. Now in running the depreciation AFAB unplanned puting period six (06), the system is calculation depreciation from january and i intend to pos