Want to read a file (I/O )f rom a EJB, How ?

I 'm implementing drools in a J2EE project to implement business logic at Session Bean level. The normal way of reading the rule file(.drl) is as follows.
final Reader source = new InputStreamReader(BaseRuleImpl.class.getResourceAsStream(rulefile.drl));
but this gives a Server Error because of this IO operation.
Can anyone kindly give me a solution to this ?
Thank You.

Could you post the exception stacktrace?

Similar Messages

  • I want to read a file which is in a zip and this zip file is at ftp site

    i am facing this problem and try to find the solution from last month please help me
    i want to read a file which in ziped and this zip file is at ftp site. and i want to read this file without downloading this zip file to local machine. i have to read it from ftp location only

    You can open an URLConnection to a file on an FTP server (search this forum to find out how). You can get the InputStream from the URLConnection and feed it to ZipInputStream. That should do the job.

  • I want to read a file on the client side

    Hi all,
    I want to read a file on the client side, then the server show the contents of that file.

    Signed applet sounds cool - I guess Microsoft's ActiveX technology would be the mirror of this.
    Write you file access code as you normally would and then just drop it in a applet and JAR it up.
    Use keytool to sign it - users will be requested to accept/review your certificate in order to grant file-access permissions.
    Warm regards.

  • I want to Read a file throw any where..

    I want to read a file like www.yahoo.com how ?

    http://developer.java.sun.com/developer/onlineTraining/

  • My file has insert command and i want to read that file line by line in sql

    myfile.txt
    insert into emp values(100,200,"sumedh",11);
    insert into emp values(101,200,"amit",11);
    insert into emp values(102,200,"sam",11);
    insert into emp values(103,200,"ram",11);
    insert into emp values(104,200,"stev",11);
    I want to read this file line by line and enter this value in emp table.

    Why did you begin this thread in security.
    just like
    sqlplus <schema_owner>/<password>@<your_sid> @<path_to/myfile.txt>

  • I keep getting the message: "what should firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    I keep getting the message: "what should Firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    cor-el,
    Thanks for your prompt reply. However, the sources you gave do not seem to apply exactly to my situation. I have attached some screenshots that show what the dialogue box looks like for a pdf download, and what my settings in the Apps panel of Options are. You will note in the first screenshot that I have checked the box to handle this file type automatically; however, the next time I try to download a file of that type, the same dialogue box appears looking exactly like the one shown, so checking the "automatic" option appears to do nothing. The files to be downloaded from my Gmail messages are not generic or altered file types - they are shown as pdf, doc, docx, etc. So while your intent was good, your post did not help. Thanks anyway.

  • I want to upload some files from mobile phone to webserver? how? thanks!

    I want to upload some files from mobile phone to webserver? how? thanks!

    The vibrating phone was created in Java. Some british company is selling the program to women for on the go fun. I'm pretty sure the actual code in the program is only a few lines.
    Oh... you were talking to the other guy. He wants a java app to upload something to a JSP or database server.

  • I want to read tif file and encrypt it by aes. who can help me?

    I have several questions:
    1. Is there a java api to read and write tif files. this api can read the header of tif(IFH) and add something into the header.
    2. Is there a java api to encypt the stream of tif file by AES?
    Thanks a lot!!! every superman comes here and helps me.
    Thank u

    1. Is there a java api to read and write tif files. this api can read the header of tif(IFH) and add something into the header.javax.imageio.ImageIO
    2. Is there a java api to encypt the stream of tif file by AES?javax.crypto.CipherOutputStream

  • I want to view email file attachments in the 6.0 browzer, how?

    Operating System XP SP2, Firefox 6.0, Email Outlook Express.
    I am emailed video files as attachments in Quick Time Player formats .MOV and M4V. I am unable to view the files from the Browzer. I have to save the files and access to access them in VLC Media Player. I want to be able to click on the attachments and view within Firefox as in prior versions.
    I see no one else has asked this question, but there are a multitude of complaints on line.
    Edward Pinhey

    You can't. Not in landscape. There is no way to hide or remove it.

  • I want to open a file and have it fill the desktop - how??

    I have recently moved over from CS2 on PC to CS3 in MAC - I used to be able to open a file and it would open up in a full window filling the whole screen - now it opens up in a box with no surrounding space. When I maximize the minute I tap cmd + the widow reduces to minimize and just zooms into a part of the file. I am sure this is basic stuff but any help out there please??
    gratefully
    Angus

    That's the difference between Macs and Windows. Windows opens applications in a... Window.
    Try hitting the F key and see if that works for you.

  • I can't read PDF files online, they must be saved. How can I go back to having the option to read them online?

    When I click on a link to view a PDF file, Firefox tries to make me save the file. This started when I clicked the "do this every time" check box for ONE file. Now I can't undo the selection and my Applications Options control window is completely blank: not only are no PDF options available, no options are available for ANY file type. I have to use Google Chrome to view PDFs online without saving them. I'm running Firefox version 34.0 but the problem started with version 33.

    Part of the AAQ (ask a question) process is to ask if you want to supply troubleshooting information.
    Acknowledging this will install the Troubleshooter 1.1a ([email protected]) extension that also appears in the System Details, so it is likely that you have approved this.
    If you click the "More system details" link in the menu at the right of your first post then you can see what is send.
    See also:
    *https://support.mozilla.org/kb/Using+the+Troubleshooting+Information+page

  • File to RFC scenario want to read file name

    Hi All,
    I am having file to RFC scenario in which i am having file name in format  text_yyyymmdd.txt.
    i want to read this file name and by separating the date in file name i have to pass this to one of the RFC date parameter.
    please help me to sort out this.
    Thanks
    Swapnil

    Hi,
    By writing simple UDF in your mapping you can Acheive this
    Try this Once
    DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
    String MyFileName = dynamicconfiguration.get(key);
    String str[] = MyFileName.split("_");
    return str1[1];
    Map this to the date parameter(RFC) in the mapping .
    Thank & Regards,
    Deepthi
    Edited by: Deepthi Muppasani on Sep 23, 2011 8:17 AM

  • Read multiple files and write data on a single  file in java

    Hello,
    I am facing difficulty that I want to read multiple files in java and write their data to a single file. Means Write data in one file from multiple files in java
    Please help me out.
    Naveed.

    algorithm should be something like:
    File uniqueFile = new File();
    for (File f : manyFilesToRead)
       while (readingF)
           write(dataFromF, intoUniqueFile);

  • Read a file at a fixed time of day using PS in OSB

    I have a proxy service which read a file, now I want to read that file at a fixed time in a day(suppose 12pm every day).
    How do I make the JCA file/proxy configuration?
    Pls suggest!

    Re: How to implement in OSB: Scheduling, Timers and Custom properties
    Regards,
    Anuj

  • Got problem in tomcat while read xml file..

    hi' i just wondering, why i always got his exception, i just want to read this file
    java.io.FileNotFoundException: C:\Program Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\bin\dbconfig.xml (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)......How to read dbconfig.xml??
    Right now i put dbconfig.xml in /webapps/myapp/web-inf/classes/dbconfig.xml. but i always got that exception, why??
    if i put my dbconfig.xml in apache-tomcat-5.5.17\bin directory (see exception...), i got no exception.
    So, is there anyway to read dbconfig.xml while i put it in /webapps/myapp/web-inf/classes/ directory?
    This is my code :
    public UserWrapper(){
            builder = new SAXBuilder();
            try {
                doc = builder.build(new File("dbconfig.xml"));
                rootElement = doc.getRootElement();
                System.out.println(rootElement.getChildText("db-driver"));
            } catch (JDOMException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace(); 
        }   Thanks a lot..

    The JVM looks for files relative to the pwd or directory in which it was started. For Tomcat it is the bin directory. That is why it can find dbconfig.xml in the bin directory but not the classes directory.
    You have two choices.
    1; give the path to the file inth eclasses directory. You can use the ServletContext getRealPath method to build this path.
    2: Since the file is in the classpath you can use the Class getResourceAsStream method to get an InputStream to the file. Then see if the SAXBuilder class has an api that takes an InputStream.

Maybe you are looking for