Saving in files in webcontext from ejb

How do I make a session EJB save data(image, xml files, etc) in the webapp root context like a images dir??
Or asked in a other way how do I make data(again image, xml files, etc) accessible to both the EJB's and the webapp frontend(the html).
If anybody got a exmple or howto I would love to see it.
Regards
/marc

How do I make a session EJB save data(image, xml files, etc) in the webapp root context like a images dir??
Or asked in a other way how do I make data(again image, xml files, etc) accessible to both the EJB's and the webapp frontend(the html).
If anybody got a exmple or howto I would love to see it.
Regards
/marc

Similar Messages

  • FileNotFoundException thrown when opening a file for writing from EJB

    Hi,
    I know it is against EJB rules that access file IO from EJB. However we have a legacy system to working with and we need to generate a text file on file system.
    Weblogic (we are using 10.3) allows open a file for read from EJB. When we tried to open a writer like below:
    BufferedWriter writer = new BufferedWriter( new FileWriter(fileName, false));
    FileNotFoundException was thrown from the native method of open. The fileName is an absolute path and permission is properly set. The same piece of code can execute correctly in a test application with same filename.
    Does anyone know how to achieve this or whether Weblogic just forbids this kind of output access?

    Sorry guys. Just double-checked the source code and found out a bug produced wrong filename, the filename was surrounded by "", so FileNotFoundException is a correct result.
    Weblogic does allow read/write external file.

  • Saving a file as PDF from CC Illustrator

    Just updated from CS3 to CC Illustrator. In the old CS3 if I saved a file as a PDF. Adobe acrobat would open and I would then see the file on the screen as a PDF. Now in CC the file just save as a PDF in illustrator and doesn't reopen so I can see the document large and clear with the trim marks and bleeds. Is there a setting I need to change?
    Thanks in advance. Self trained illustrator user here with little experience:) Any help is appreciated.

    In the PDF Save Options (second dialog), make sure this box is checked.

  • Saving PSD files after exporting from Lightroom saves incorrectly

    I've only recently moved to Lightroom from using Photoshop/Bridge together, so I'm not 100% sure how saving files exported from Lightroom should go. But here's what I experience:
    Base edit of file within Lightroom
    In library view, right click on image -> Edit in -> Open as Smart Object in Photoshop
    Perform all my necessary edits and such
    File -> Save As, and save it to another location as a PSD file (totally different HDD)
    Perform more edits....
    Shortcut CTRL+S to save, and it saves it as the TIFF file under the location it was originally in within Lightroom
    Eh...? Am I missing something. It should just save as the original PSD I created when I went "Save As". I have seen on a few occasions, immediately after "Save As", the file name resorts back to TIFF and not as PSD.
    My settings for External Editing in Lightroom are as follows:
    File Format: TIFF
    Color Space: ProPhoto RGB
    Bit Depth: 16 bits/component
    Resolution: 300
    Compression: None
    Does anyone have any ideas what I'm doing wrong? Also, to note, that sometimes I double click on the Smart Object within Photoshop to load Camera Raw and perform some edits, but not often.

    Modesto Vega wrote:
    Replying to your last 3 posts.
    Re Camera Raw being used to pass an image to Photoshop
    a) I am assuming this is independent of the Compatibility level in Preferences\File Handling DNG creation.
    b) Does the same apply to other photo editing software made by Adobe like Elements?.
    Reply: Yes, the principle is the same. Photoshop Elements cannot read raw data either. That's why it has to be converted before it's opened.
    c) Assume that I have LR 5.7.1 and CS5. Is Camera Raw is still used to pass an image to Photoshop? If so, why is there a need to get LR to behave differently?
    Reply: Camera Raw is used IF you choose the option to open anyway. Then Camera Raw will be used to convert the image that's opened in Photoshop. But since it is older than Lightroom some of the new adjustments might not be transferred to Photoshop. That's why there is a need to let the user make the choice.
    d) Sometimes it does seem as if Adobe might be using Camera Raw updates and process version updates to get consumers to change their habits, this includes having to buy subscriptions or having to change workflow to some ideal that somebody at Adobe or working with Adobe might have in mind.
    Reply: The fact is that in the past, when a new version of Photoshop is released then all support and updates cease for the previous version. Since the introduction of the creative cloud, at least users of Photoshop CS6  get support for new cameras. They just don't get the new features. Yes, there's motivation to upgrade. Adobe is a business. What do you really expect?
    Re stacks
    I find impossible to see collapsed stacks on the film strip. Stacks are only visible on the Library module and using a grid view; I don't say clearly visible because they are only recognisable by the label at the top left corner with the image count; I don't even think it is possible to change the colour of that label or the grey colour surrounding an image. Also I cannot name stacks. If I could name stacks, see them as virtual folders underneath a library folder and make them glaringly visible I would use them extensively.
    Reply: The only reason I can think of that you are unable to see collapsed stacks on the filmstrip is if you have the filmstrip reduced in size to the point that Lightroom can't display all the icons. I'm able to see the collapsed stacks in the library grid view and on my filmstrip
    Re storing your Raw files and processed files in separate locations
    Assuming Raw files are negatives and Photoshop files are transparencies or prints, would you want negatives being handled/read on a regular basis? If anything happens to your negatives, you would never be able to produce another print or another transparency again.
    Reply: The raw files or the negatives, as you put it, are never modified by Lightroom. They always remain in their pristine state they were in when they were imported. If I have a backup of that raw file then I can do whatever I want to the one in my working folder. Resetting that raw file so that it looks unaltered is just a click away.
    I have worked extensively with databases and database systems, it is a standard feature of database systems to be able to choose where to store different database objects. I don't see why LR cannot do the same, it is a database after all. I do agree with both the OP and photo.
    Reply: Well, I won't argue that point. If that's what you really want than lobby for it. It just won't get my vote because I don't see any real advantage.
    If you read back through this quoted message you'll find that my replies are included. I don't know how to separate them out so they are highlighted properly. Read through it and think about it. But personally, I don't want to waste anymore time on this discussion because it isn't accomplishing anything in my opinion.

  • On my new Imac, I had the trial version of Pages, and saved some files in it. Now I have purchased the full version from Apple via a download, but I cannot save or print the old files, please help!

    On my new Imac I saved some files on the free trial version of Pages, since downloading the full version from Apple, have been unable to save or print from old files saved when using the trial version. Any ideas? Thank you!

    My guess is the 30-day trial period has expired but you didn't remove the trial before installing the full version. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user.
    Yvan Koenig has written an AppleScript that removes the files. You can find it on his iDisk in For_iWork > iWork '09 > uninstall iWork '09.zip.

  • How do I prevent AE from saving .AEP files in the wrong folders?

    I've been using AE heavily for about 6 months, and it has this really pesky basic Windows UI problem that makes life quite frustrating. I work on lots of projects that I maintain sequentially numbered in their respective folders. Typically in Windows when you choose "Save As" windows defaults to the folder the current file resides in.  For some reason After Effects defaults to the last folder I saved a file in, which often times is not the folder I am in. So I end up with project files from projectA stored in the projectB folder.  This leads to version control problems when members of the team can't find the most recent version of projectA and so they start working on the previous version of ProjectA and later on ask me where all my changes are.  I want to believe that AE has a checkbox in preferences somewhere that says "make save-as feature operate like every other windows program" - but I haven't found it yet.  Does anyone have any advice on this topic?

    I want to believe that AE has a checkbox in preferences somewhere that says "make save-as feature operate like every other windows program" - but I haven't found it yet.  Does anyone have any advice on this topic?
    I think you are operating on wrong assumptions - a project is just a reference to other files plus some internal data, so it doesn't exactly make sense to maintain endless lists of absolute paths, given that you can import things back and forth in a million ways. What happens as soon as you import a project into another one? What, when you collect files? What happens when you re-import pre-rendered files? A "same origin" policy would be riddled with tons of issues to figure out the logic as to what the user actually wants to do and which path is the correct one.... I've never missed any such feature.
    Mylenium

  • When saving a file in [.jpg] format, i am asked to choose a quality from 1 to 100. what changes in the file created based on the quality parameter chosen?

    when saving a file in [.jpg] format, i am asked to choose a quality from 1 to 100. what changes in the file created based on the quality parameter chosen?. i would like to know what changes, so in the future i can set my camera to a setting that will give me the highest quality to begin with,allowing me to make crops and still preserve the quality.
    thank you
    dovid

    It's the level of compression. Lower number, more aggressive compression, more visual artifacts.
    Aside from that you should never use jpeg as a working format. The compression is destructive and cumulative, and the file deteriorates every time you resave it.
    Use TIFF or PSD, and if you need jpeg save out a copy as a single final step.

  • This is an error from my HP scanner. How can I fix the problem? An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only.

    I recently uploaded the Maverick operating system. I wanted to scan some things on my HP Printer/Scanner and could not . This is the error message I received: An  error has occurred saving the file because it could not be written to.   Check the properties for the file to make sure it is not read-only. I am a novice with the computer and have no one to help. I hope someone knows an easy fix.
    Thank you

    This worked for me:
    "Although it is not a 'fix' for the HP issue, I did find a workaround that helped me. In the Preferences Panel in MacOS X you can pull up the Printer/Scanner preferences and scan directly from OS X. I'd not known of this prior to posting here and it worked like a charm."
    "Of course, HP should still update their software, but it's good to know that Apple has it covered for them."
    I found it here:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/MAVERICKS-WONT-SCAN-HP-C3 09A/td-p/3052105

  • How to get File Reference of a properties file from EJB

    Hi,
    I am using Sun App server 7 with Oracle 9i. I am keeping all my SQL statements in a properties file from which I am loading it while making a database operation from Stateless beans. My problem is I am not able to get the reference of the properties file. Here is the code through which I am getting the SQL statements loaded to a cache.
    String sqlFileName = "SQL.properties";
    sqlCache.load(new FileInputStream(sqlFileName));
    From the cache I am sending the SQL statement depending on the key value. But the problem is I have to keep the SQL.properties file on the App Server config directory of the instance where the server.xml file resides. Otherwise it is not able to find the properties file. But I don't want to put the properties file on the config directory of the server instance. Please help how to get the properties file from the packakge. My file is residing inside a package com.company.sql . Botht the properties file and the class accessing the file are residing in the same package. Please help how to get the reference of the file with out putting the file in the config directory.
    Thanks
    Amit Patnaik

    Just wanted to warn you of the hazards if you read a file from EJB
    So please make sure that these hazards will not affect your application. However the solution suggested to use getResourceStream() concurs with ejbSpec
    This snippet is from suns blueprint on ejb
    Why can't EJBs read and write files and directories in the filesystem? And why can't they access file descriptors?
    Enterprise beans aren't allowed to access files primarily because files are not transactional resources. Allowing EJBs to access files or directories in the filesystem, or to use file descriptors, would compromise component distributability, and would be a security hazard.
    Another reason is deployability. The EJB container can choose to place an enterprise bean in any JVM, on any machine in a cluster. Yet the contents of a filesystem are not part of a deployment, and are therefore outside of the EJB container's control. File systems, directories, files, and especially file descriptors tend to be machine-local resources. If an enterprise bean running in a JVM on a particular machine is using or holding an open file descriptor to a file in the filesystem, that enterprise bean cannot easily be moved from one JVM or machine to another, without losing its reference to the file.
    Furthermore, giving EJBs access to the filesystem is a security hazard, since the enterprise bean could potentially read and broadcast the contents of sensitive files, or even upload and overwrite the JVM runtime binary for malicious purposes.
    Files are not an appropriate mechanism for storing business data for use by components, because they tend to be unstructured, are not under the control of the server environment, and typically don't provide distributed transactional access or fine-grained locking. Business data is better managed using a persistence interface such as JDBC, whose implementations usually provide these benefits. Read-only data can, however, be stored in files in a deployment JAR, and accessed with the getResource() or getResourceAsStream() methods of java.lang.Class.
    Hope this info helps!

  • After downloading Maverick I cannot save or email scans from my HP L7780. I receive  error message "An error has occurred saving the file because it could not be written to.  Check the properties for the file to make sure it is not read-only. "

    After downloading Maverick I cannot save or email scans from my HP L7780. I receive  error message "An error has occurred saving the file because it could not be written to.  Check the properties for the file to make sure it is not read-only.

    Read the user manual that came w/the scanner and/or contact HP Support.
    http://support.apple.com/kb/PH14141 OS X Mavericks: Reset the printing system 
    http://support.apple.com/kb/HT3669 Printer and scanner software available for download 
    A scanner driver you may wish to consider:  VueScan Scanner Software

  • Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Saving a file directly from Photoshop into Aperture

    I am interested in saving a file while in Photoshop back in to Aperture. Proposed workflow:
    Load digital file from camera into Aperture>Drag file to CS3; edit/print>save new file in same folder as the original in Aperture.
    I would like to do this directly- I can save the edited file in CS3 to my desktop and then go to Aperture and import the file from my desktop but this seems arcane to me. Anyone know a direct route?
    Thanks in advance- Jay

    BUT, you must save the Photoshopped image using Save (not Save As using a new name or saving to a new location) so that a Photoshop file is saved back in the Aperture library. It would be nice if you could use the Apple-Shift-O to open in Photoshop, and save back as a Jpeg automatically, but we're not quite there yet.
    Those full size Photoshop files will swell your library size pretty quick, which is a good thing; you'll begin to appreciate non destructive editing more fully

  • Why aren't all view options available when saving a file from Adobe InDesign CC 2014 on OS X Yosemite?

    Why aren't all view options available when saving a file from Adobe InDesign CC 2014 on OS X Yosemite?

    ASk in the ID forum and explain better what you actually mean.
    Mylenium

  • How do I import bookmarks from a saved bookmark-file fron older version?

    How do I import bookmarks from a saved bookmark-file from older version?

    See:
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • How can i stop my Macbook from saving every file opened?

    How can i stop my Macbook from saving every file opened?

    Take a look at this link, http://osxdaily.com/2012/07/11/disable-auto-save-and-versions-in-mac-os-x/

Maybe you are looking for

  • Scheduled Report Error

    Hi All, I configured Scheduled Report. But its showing following Error.Please tel me how to rectify this Problem. Thanks, Nithi

  • Connecting to an xbox 360

    I've been driving myself crazy this afternoon, trying to get my xbox 360 to connect to the internet via my Airport Express. I know it can be done, at least with an Extreme (in b/g only mode), because I used to have it hooked up to my old roommates se

  • I want to download and install adobe flash player. When I do so one occur. A dialog box appears but it has no run option but a save file or cancel option.

    # Question I want to download and install adobe flash player. When I do so one of 2 things occur. A dialog box appears but it has no run option but a save file or cancel option. The other is if the proper dialog box appears, I agree and the a differe

  • Mini Displayport (jack) is bent. Can I fix, or must I replace?

    It seems after some wear, my Mini Displayport has had it. In order to get an extended display on my second monitor, I have to push the cable into a certain position in the Displayport jack and hold it there (not sustainable). I'm wondering if there's

  • Hi abaper expert

    hello   i hv a problem .in transaction fk10n.i hv been copy its program.i hv to add one more field as a plant code .and the data should be fatch depend on plant code.because plant code may be vary. code is   report RFARBALANCE message-id FDBL. ...tab