Open a Local File located in a Web Dynpro Project

Hi, I'm trying to open a file saved in a new folder called (XSLT) created by me in a web dynpro project.
When I try to do this, the following exception is thrown:
...java.io.FileNotFoundException: F:\usr\sap\DEP\JC00\j2ee\cluster\server0\XSLT\sad.xsl (The system cannot find the path specified)....
The code that tries to load the file is the next:
Document xslDoc = dBuilder.parse("XSLT/sad.xsl");
My Question is: what should be the file path that I should use in order to be able to open a file that is saved into a folder inside my Web Dynpro Project, of course, using a relative path...
Any ideas???

Felipe,
Classes from custom folders are not included in build.
You may place "xslt" under src/packages and acces them via ClassLoader, i.e.
Document xslDoc = dBuilder.parse
  this.getClass().getClassLoader().getResource("xslt/sad.xsl")
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com

Similar Messages

  • Open a local file from a web Service

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

  • How to open a local file from javascript in a jsp-page

    Hi
    I have created an iview from a PAR file. In the par file I have a jsp-page with some javascript code. From the javascript coe I want to open a new window with an Excel file.
    I have tried window.open("c:
    test.xls", "test_window"), but it doesn't seem to work. I have created a small HTML page locally with the same command and there a new window opens with the Excel file.
    If I change the local file path with an URL it also works.
    Any idea how to open a local file ?
    Thanks
    /Jakob

    Jacob,
    I'm not 100% (but 99,9%) and it has to do with security ristrictions of the browser not allowing to have local workstation interation from the web. This is ofcourse very dangerous if the browser would allow it... So therfore it is blocked. What if somone would point to a file/executable that formats your drive so for that reason it is not allowed to have web interaction with a local file. Only with Java Applets this is possible but still with many limitations, and what I remember Google Gears and Adobe Air do have some limited web 2 local file interaction... So best and most simple solution you are left with is pointing to a url instead of a file on a c:\ drive.
    PS The reason why it works when you start the html from your local PC has todo with the fact that the browser detects that the html is not running in the web at that moment therefor allowing the access.
    Cheers,
    Benjamin Houttuin

  • Open a local file in webdynpro

    Hi All,
    I am trying to open a file residing on user's desktop in webdynpro.
    1. I have written a html page with javascript to open the file
    window.location = 'file:///C:/Documents and Settings/mkharoda/Desktop/Questions.txt';
    This file opens up if I open it up in IE browser and opens the file specified in the path.
    2. I added this html page in my mimes folder
    3. Assigned this html page as a source to IFrame (Although its deprecated but I don't see any other option)
    When I execute my WD Applicaiton, it shows a blank page in IFrame. The same html page works fine when opened directly in the IE.
    Expecting quick help sdn.
    Also, if you have an alternate solution to open a local file then please suggest me.
    Regards,
    Murtuza

    Hi,
    One thing you have to understand here is Webdynpro doesnot support java script.
    So their is no way to do things at client side using the scripting.
    What ever is possible is at the server side, when you say that the local file need to be read with out uploading to the server (FileuploadUI) looks a bit unrealistic with webdynpro.
    I dont have idea about JSF integration to WD , if you can create Components that supports java script and then embed them using the JSF bridge might be of help in this scenario.
    Other alternative could be a component in Flex (that too not sure)
    Regards
    Ayyapparaj

  • Why won't my I pad open a local file

    Why can't I open a local file with safari

    It was a web address that my employer gave me and when I put it in to the address bar and hit go it comes up with the error message cannot open a local file

  • How do we create Hyperlink to local file on c:\ in Web Intelligence

    How de we create Hyperlink to local file on c:\ in Web Intelligence.
    Thanks in advance,
    K.

    K,
    You can't hyperlink to a local file when you are in WebI.  The ability to hyperlink requires the http protocol to be employed, wrapped within a web service (like IIS, for instance).  So to hyperlink to any file, that file must be a part of a web service, and the web service must have access to the folder (again, like in IIS you must create web shares and IIS must "mount" those shares in an http environment).  Hopefully I'm making sense to you on why it can't be done. 
    On the other hand, content that is static and has been made available for browsing on the web can also be linked to by populating a cell in a WebI report, marking that cell as "read cell contents as hyperlink", etc, etc.
    Thanks,
    John

  • Firefox crashes when opening a local file (a .jpg photo) click drive, click directory and it crashes.

    Firefox crashes when clicking FILE / OPEN FILE / Drive (G:)/and when double clicking the directory containing the file. It happens every time I'm trying to open a local file. Must close, go to Internet Explorer, Opera or Chrome which have no problems doing this.

    You are running out of memory. In the stack notice this line:
    Caused by: java.lang.OutOfMemoryError: Java heap space
    Edit the sqldeveloper.conf file and add this
    AddVMOption -Xmx1024M
    That will bump it up some.
    -kris

  • How to create a Web Dynpro Project from Downloaded zip file?

    Hi,
    I have been working in Java Web Dynpro for last 1 month but not able
    to create any Web Dynpro from Downloaded zip file?
    Can anybody tell me how to create a Java Web Dynpro Project from
    Donloaded zip code?
    Regards
    Kaushik Banerjee

    Hi Kaushik,
    You can add the existing zip file into your workspace by the following way -
    First open the NWDS and create a new project by clicking file -> new -> Project -> Simple -> Project
    and then File -> Import -> zipfile and then browse the zip file into the newly created project.
    or else you can also unzip the zip file into a folder and then Use the option of Import an exisitng project into workspace. You can find this in the File-> import -> Existing project into workspace. and then use the Browse option to browse to the existing folder.
    After importing the project you need to rebuild the project
    Regards,
    Raju Bonagiri.

  • Moving Local Web Dynpro project from Dev to Prod

    Hi,
    i have a scenario where there is a small application to be developed. And m the only developer to work on it.
    I need to a create local web dynpro project for the same and deploy it to the deveopment server. and test it here. However, the client for whom i am developing this service, is based somewhere else. How do i deploy this local application on his production server?
    I dont have JDI architecture here. Can i achieve this without JDI? and How? Which is more feasible -  using JDI or not in my case ?
    Regards,
    Apeksha

    Hi,
    Genrally, it is recommended to work with JDI. But, as you said you have only project that needs to be deployed then you can change the server settings in your NWDS and make it point to the production server.
    Windows>Preferences>SAP J2EE Engine--> <details of your remote production server>
    NOTE: You should have sdm password to deploy this applicaiton.
    Regards,
    Murtuza

  • How to save file in km using web dynpro abap

    Hi Experts,
    We have a requirement that file should be saved in a folder in km, the name of the folder should be the employee number.
    Could you please tell me how to create folder with employee number in KM and store file in it using web dynpro abap.
    Thanks and Regards,
    Santhoshi.

    Thanks Naga Raju Meesala.
    How come all these methods are deprecated...getEP5User
    Also, since I am building a weddynpro DC, what is the proper way to include these jar files as Used DCs?
    Now proceed in the same way with the variable PORTAL_HOME and add the following .jar files:
    u2022 \lib\prtapi.jar The portal runtime APIs
    u2022 \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.ep5.jar The user management APIs of the Enterprise Portal 5.0 are deprecated, but still in use in SAP NetWeaver 04
    u2022 \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar KM Repository Framework APIs
    u2022 \portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urlgenerator_api.jar Repository Framework Utility: URL Generator
    u2022 \portalapps\com.sap.netweaver.bc.sf\lib\bc.sf.framework_api.jar Repository Framework: Repository Services
    u2022 \portalapps\com.sap.netweaver.bc.util\lib\bc.util.public_api.jar Repository Framework Utilities

  • HI Masters , I need information for file upload program in web dynpro java

    Hi masters,
           i need some inforamtion and documentation on file upload program in web dynpro java

    Hi surya,
    You can follow this procedure to upload the file
    i) Take One Context Attribute named as "D1" of Type "binary".
    ii) Take one FileUpload UI Element in the Layout Tab.
    iii) Bind FileUpload UI Element's data Property to the taken Context Attribute. Here it is "D1".
    iv) Take one Button UI Element in the Layout Tab named "Upload" and in the Action of that Button write the following Code.
    v) The following code Generates one Folder in the Server & inside that Folder given file is Uploaded.
    File ff=new File("FolderXYZ"); // Creates One Folder with the given Name ( Here Folder name is "FolderXYZ")
    ff.mkdir();
    try
    byte b[]=null;
    IWDAttributeInfo objAttinfo=null;
    IWDModifiableBinaryType binType=null;
    File f=null;
    FileOutputStream fos=null;
    if(wdContext.currentContextElement().getD1()!=null)
    b=wdContext.currentContextElement().getD1();
    objAttinfo=wdContext.getNodeInfo().getAttribute(IPrivateAttachView.IContextElement.D1);
    binType=(IWDModifiableBinaryType)objAttinfo.getModifiableSimpleType();
    f=new File(ff.getName()+"
    "+binType.getFileName());
    fos=new FileOutputStream(f);
    fos.write(b);
    fos.flush();
    fos.close();
    objMessageManager.reportSuccess("File uploaded to server");
    } catch (Exception e)
    objMessageManager.reportException("Unable to upload file to server, error is:"+e,false);
    return;
    The Uploaded file is stored in the folder & that folder is stored in the Server's following Path.
    <Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0
    You can access your Uploaded file from the following Path
    <Your Server>\c$\usr\sap\J2E\JC00\j2ee\cluster\server0\FolderXYZ
    Regards
    Sagar Ingalwar

  • Migrating Local Web Dynpro Projects to the JDI -- labels missing

    Hi all
    I am trying to Migrating Local Web Dynpro Projects to the JDI .But the labels are missing..?.
    The runtime output is coming well. Any suggestions.Do any of you come accross this problem before?.help appreciated and I promise to award full points for best solution
    Thank you
    Regards
    Maruti

    Hi Maruthi,
    Please look at this link,
    Re: How to modify ESS  ii views code which are imported from NWDI to NWDS
    Thanks,
    Raj.

  • Using External JARs in a Web Dynpro Project

    Hi,
    I'm having some difficulties building and deploying a Web Dynpro application that uses the Apache JaxMe libraries.  We're using SP11 of Developer Studio and WebAS and we're using JDI Scenario 2+ for building and deployment.  Thus far here's the procedure I followed:
    1) Created a DC of type "External Library"
    2) Added the necessary jars to the "libraries" folder of the External Library DC project (the jars that I added were jaxme2-rt.jar, jaxme2.jar, jaxmeapi.jar, jaxmejs.jar, jaxmepm.jar, jaxmexs.jar, xercesImpl.jar, xml-apis.jar all of which were pulled from the Apache JaxMe implementation download)
    3) For each of the jars in the libraries folder I right-clicked, selected Develoment Component then clicked "Add to public part" 
    Then after reading this note:
    https://websmp206.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=012006153200000038152005
    I created a J2EE Library Component DC following these steps:
    1) Created a new DC of type J2EE Server Component / Library
    2) Added the External Library DC that I had just created as a "Used DC"
    3) Edited the DC so that it is used a Build Time and Run Time
    Finally I went to the Web Dynpro application and included the J2EE Library Component DC as a Used DC at build time and run time. 
    I was able to build all of the project successfully (doing a DC build for each) then I was able to succesfully deploy the applications to my local development WebAs (by doing a DC deploy for both the J2EE Server Component and the Web Dynpro application)  The problem is that at runtime the Web Dynpro application cannot find the external libraries.  For example, I receive the following error when running the application:
    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    The "missing" class is included in one of the jars but for some reason these jars are not accessible to Web Dynpro at runtime. 
    Any help you can provide on this problem is very much appreciated.
    Thanks in advance!
    Jason

    I created the <b>JAR</b> with the following class (structure):
       <b>com.sap.tc.webdynpro.tests.utils.TableSorter.class</b>
    I have followed the steps that was suggested in the forum:
    ==========================================================
    1) creating an Extneral library DC
    2) import the JAR "com.sap.tc.webdynpro.tests.util.jar" to the libraries folder of the External Library DC project
    3) Right-click on the JAR imported to the project and add them to the public part.
    This DC is now ready to be used as a build-time reference that will allow CBS to build the "main" Web Dynpro application that will use the external libraries. Next, we have to create a new Web Dynpro DC to hold the class files here are the steps:
    1) Create a new Web Dynpro DC
    2) Create a new public part, selecting the "Can be packaged into other build results" option
    3) Rename the JARs as Zip files and extrct the full content (folders and class files) to your root folder
    4) Import the folders and files to the src/packages folder
    5) Expand the public part node that was created and select the "Entities" node, right-click it and choose Edit
    6) In the Entity Type list select the "Folder" option then in the selected entities tree pick each of the folders that you imported in step 5 (above)
    7) Now do a DC build and a DC deploy of the project
    Then check-in, activate, and release any activities you have associated with creating these two projects. In the DC perspective, refresh the Active DCs and Inactive DCs to ensure that both new DCs appear in the Active list. Now we have to setup the references to these DCs in our main Web Dynpro application. To do this, follow these steps:
    1) Open the Web Dynpro perspective and right click the Used DCs node then choose "Add Used DC.."
    2) Pick the public part of the External Library DC that we created (first) and set it to have a Build Time dependency
    3) Again, right click the Used DCs node and choose "Add Used DC.." then choose the public part of the Web Dynpro DC that we created and give it a Run Time dependecy (weak) and click finish.
    4) Now, due to what I think is a bug. You must right click on the Web Dynpro "used DC" that you just added in the previous step, and set the run time dependency again (it seems to revert to the default values for some reason)
    5) Now do a DC build and a DC deploy on the "main" web dynpro application.
    6) Check-in, activate, and release any activities associated with adding these references and then others on your team may use the classes in the external libraries within the Web Dynpro project.
    However, when I executed, the following exception occurred:
    ===========================================================
    Error stacktrace:
    java.lang.<b>NoClassDefFoundError</b>: <i>com/sap/tc/webdynpro/tests/utils/TableSorter</i>
         at br.com.embraer.materiais.zdplmm001.view.Zdplmm001_0500View.wdDoModifyView(Zdplmm001_0500View.java:138)
    <b>What's missing????</b>
    Thanks
    Robson Lima
    Sao Paulo - Brazil

  • Query related to Migrating non Dc Web dynpro project to DC.

    Hi All,
    I have the requirement to migrate a non DC Web dynpro project to DC.
    I have a project which involves few models.The models are nothing but BAPIs released as web services. So, when I am trying to do what i intend to do, I am getting compile time errors and I am not able to deploy.
    WHAT I AM DOING?
    I am cerating an empty DC project. I am giving the Name and keeping the domain as basis which comes as the default one.
    Later I am moving to the Navigator tab and trying to copy and paste the packages under src and the model folder.
    Coming back to the web dynpro tab, i am trying to rebuild the newly created DC project. here i am getting thousands of compile time error.I have even tried changing the domain as enterprise portal while creating the DC project. But the result is same.
    Kindly through some lime light on this.Its very urgent and I am still not very clear with componentization in web dynpros.
    Looking forward to you.
    Regards
    DK

    Hi DK,
    Follow this procedure to Migrate Local Web Dynpro to DC Component.
    <b>Creating a New Development Component</b>
    1. Create a new Web Dynpro DC Project [Page 5].
    You create an empty container for a Web Dynpro DC that does not have
    functions. The new DC should include all relevant development objects
    project.
    <b>Do not check the newly created DC into the DTR yet.</b>
    1.Copying Packages from the Local Project
    2. In the Web Dynpro perspective, switch to the Navigator view.
    3. Select the local Web Dynpro project to be migrated and expand the project
    down to the source folder: <My_Local_Project> &#61614;&#61472;src &#61614;&#61472;packages.
    4. Select all packages and choose Copy using the right mouse-click.
    <b>Inserting Packages into the New DC Project</b>
    5. Now choose the DC project that was just created and expand the project structure in
    the Navigator view, again down to the source folder.
    6. Select the Packages node and choose Paste.
    The Add Files to DTR dialog box appears.
    7. Choose OK to confirm your selection.
    8. Assign a DTR activity either by creating a new activity or choosing an existing one.
    Execute Reload
    9. Switch to the Web Dynpro Explorer.
    10. Choose the project node of the DC project and select the Reload function.
    11. In the displayed dialog box, again choose Reload.
    Reload now also reloads Web Dynpro metadata into the new project.
    Building the Project
    12. Execute a local rebuild for the entire DC project. Choose the function Rebuild
    project.
    13. If there are no errors in the task view, execute a DC-based build by choosing the
    function Development Component &#61614;&#61472;Build.
    This build is identical to the central build tool and is required to take dependencies of
    DCs among each other into consideration.
    <b>Result</b>
    You have migrated your local Web Dynpro project into a DC project. You can now deploy the
    new DC into your local environment and test it before you commence checking the assigned
    activity into the DTR.
    After all these steps, when you reload your project, if you happend to see errors in your project. Check few things.
    - All the model classes has been genreated or not.
    - Close the project and open it again, sometimes it works fine.
    - Findout what is the reason for errors, any thing is missing.
    Regards,
    Sridhar
    Message was edited by:
            Sridhar kanchanapalli

  • Workpace - Web Dynpro Projects vs. DC Projects

    Hello,
    When creating a DC Project out of the DTR (development track) on the Development configuration perspective, those Projects do not show up on my workspace folder like a regular Web Dynpro projects does.
    How do I get these DC projects into my workspace? I had a problem before with my computer and I lost everything I did on these Projects, I just recovered the regular Web Dynpro Projects.
    Please advice.
    Best Regards,
    Diego.

    Hi,
    First, if you have not already done so, copy the old .dtc files to your new .dtc directory. 
    Next, open the Development Configurations perspective in the Local DC's section under My Components you should see your old code.
    Right click on the DC that you want to import and choose Create Project.
    Your old code should now be available for editing!
    Good luck,
    Erin

Maybe you are looking for