Properties's load method

Good morning,
I am trying to read a configuration file and then load its properties. I added a StringBuffered to be sure that the file was correct and it is. But at the moment to do the Properties load method, I don't get an exception and my Properties variable is empty.
I don't know if I am doing something wrong, this configuration file was already used in another application, so I am sure it is well encoding (ISO 8859-1).
Here my code
  private Properties loadProperties(Properties p_props, String p_propertyFile) {
    try {
      FileInputStream inputStream = new FileInputStream(p_propertyFile);
      BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
      String line;
      StringBuilder sb = new StringBuilder();
      while((line = reader.readLine())!=null) {
        sb.append(line).append("\n");
      p_props.load(inputStream);
      inputStream.close();
    }catch(IOException ioe) {
      m_log.error("Le fichier de properties est introuvable", ioe);
    }return p_props;
  }My properties file:
service.distribution.init.enabled=smtpDistributor
service.distribution.smtpDistributor.smtpHost=mail.company.com
Thank you in advance.
Elsy

You already read all lines into the buffer, so there is nothing left for p_props.load to read. Either reset or re-open the input stream or remove the buffer entirely.

Similar Messages

  • Setting values to properties on load

    Hi,
    I have a big Trouble on Data Populating to the components on page loading like,
    Have page1 and page2.Based on ID passed from page1,query should execute and results should set to the form on page2 through Backing Bean.
    What doing is..
    using setActionListener passing ID from page1 and setting to method in page2 as argument which gets results based on ID and sets to component properties, here the problem is..
    Before page2 loads method called first from setActionListener where we cannot set the values to properties before loading.
    How can we set values to components in backing bean only on load based on ID from other page.
    And one more issue is, if we make any code in setter property it get executes every time,
    what is the correct procedure to execute the method only on loading.
    Does there any procedure to make method to excecute only on load.
    Please suggest me, how can i overcome this issues,these were become major issue for the Development.
    Thanks,
    Bandaru.

    hi,
    we tried to achieve the same thing.. But its not possible to set the values to individual segments of a KFF..
    Thanks,
    raghav.

  • Change position of SWF using load method

    Hello,
    I'm a new Flash user, so I apologize in advance if this is a
    dumb question. I'm trying use the load method to load an external
    SWF, which I've done. However, the SWF loads in the upper-left
    corner. How can I manipulate its position?
    (I want to position it more in the center?)
    Thanks

    you must have loaded it into a holder movie clip correct? you
    can use the x and y properties of the holder movie clip to
    manipulate the position. The SWF must be loaded first before those
    properties are available. It is best to use the MovieClipLoader
    class to load the SWF so you can use the onLoadInit event to
    manipulate the properties.

  • Load Akamai plugin example using Static plugin loading method

    Hi,
    I want to load Akamai plugin example using Static plugin loading method. For that, I passed "com.akamai.osmf.AkamaiBasicStreamingPluginInfo" as a class defination, but I got error stating, ReferenceError: Error #1065: Variable AkamaiBasicStreamingPluginInfo is not defined.
    Makjosh once sent a post that the title was "Getting an error while loading the plugin using static plugin load method". I then follow the solution. But how can I add the dependent project(Flex/AS Build Path -> Library Path -> Add Project). As a result, I do not find the AkamaiBasicStreamingPlugin project only having the NetMocker project and the StrobeUnit project in it.
    So I try to link the AkamaiBasicStreamingPlugin project use the following method(project properties->Project References->select "AkamaiBasicStreamingPlugin"), it still causes the same error.
    Please help me.
    Thanks.

    Hi,
    A couple of things to look at:
    1) Make sure you have the import statement in your project:
                import com.akamai.osmf.AkamaiBasicStreamingPluginInfo;
    2) Make sure you add the AkamaiBasicStreamingPlugin folder to your Flex Build Path (right click project, select "properties", then "Flex Build Path", in "Source Path" you need to add the plugin folder).
    3) If you are still getting Error #1065, you can try a trick where you force the swf compiler to pull in the class:
                private static const loadTestRef:AkamaiBasicStreamingPluginInfo = null;
    Now you should be able to use getDefinitionByName to load the plugin:
                    var pluginResource:IMediaResource;
                    var pluginInfoRef:Class = flash.utils.getDefinitionByName(className) as Class;
                    pluginResource = new PluginClassResource(pluginInfoRef);
                    pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOADED, onPluginLoaded);
                    pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOAD_FAILED, onPluginLoadFailed);
                    pluginManager.loadPlugin(pluginResource);
    Hope that helps,
    - charles

  • In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File

    Post Author: bhaveshbusa
    CA Forum: Crystal Reports
    In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File. When the application calls ReportDocument.Load(reportFileName). This
    tries to connect to the database using the connection information embedded in
    the "reportFileName". This was only realised on checking the ODBC Trace
    Log. The connection itself is not a problem. The problem is that the embedded
    connection information is related to OLD production system. And failed
    connections had raised some concerns.
    Note: I am using
    SetDataSource to populate the data for the report. So I don't need the
    connection.
    Is there any way I
    can disable this auto-connect?
    Thanks and
    regards,
    Bhavesh

    960738 wrote:
    I need a help in answering one of the issue encountered last week.
    I have created a database link and tried to access the information from a table using the program written in another language. The password provided was incorrect for that user while creating database link. So we expected that,while retrieving the data, Database connection has to be errored out as password provided is incorrrect.
    But unfortunately, user account was locked out. When i checked with DBAs they mentioned that it tries to connect 16 ports with in a min of time.we were shocked as it STOPS another scheduled jobs with that user. and affects production badly.
    As per the program, it has to connect only one time and yesterday we tried to execute the program in DBAs observation and it errored out as expected. Didn't tried for multiple ports.
    Now the question is, WHY the database connection established 16 times last week and caused user account locked. DBAs are unable to answer it. Any EXPERTs opinion on this would greatly appreciated.
    I have verified managing ports in oracle documentation, it was mentioned that if one port is busy it will try to connect to another port in the range of ports mentioned during the installtion. DBAs verified ports related file and it was blank. and they are not agreeing with this reason. Please HELP me in finding the correct REASON for this.
    is it a NETWORK issue or issue with DATABASE SERVER only?
    Thanks
    SSP
    Edited by: 960738 on Sep 22, 2012 9:13 PMDBLINK is 100% oblivious to the fact any port exists.
    DBLINK only contains username, password & TNS Alias.
    can you post actual SQL & results?

  • Report Document.Load Method Hangs

    The following code is an exceprt from an asp.net web application we developed.  The report file (TestReport.rpt) file was designed using a 'manually' created schema (xsd) that mirrors the structure of pApptDT. The .xsd file has no DB connection info stored in it.  NOTE: the DBServiceORA and Registrations are base and middle tier classes respectively that do the heavy lifting.
    protected void Page_Load(object sender, EventArgs e)
        mDBService = (DBServiceORA)Session["DBService"];
        this.BuildReport();
    protected void BuildReport()
        ReportDocument pReport = new ReportDocument();
        try
            DataTable pApptDT = Registrations.GetApptSmry (mDBService);
            string pReportFile = Server.MapPath(Global.WEB_ROOT + @"/Reports_Appointment/TestReport.rpt");
            pReport.Load(pReportFile);
            pReport.SetDataSource(pApptDT);
            MemoryStream pStream = (MemoryStream)pReport.ExportToStream(ExportFormatType.PortableDocFormat);
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ContentType = "application/pdf";
            HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=Report.pdf");
            HttpContext.Current.Response.BinaryWrite(pStream.ToArray());
        catch (Exception ex)
            Response.Write("<p>" + ex.Message + "</p><p>" + ex.StackTrace + "</p>");
        finally
            pReport.Close();
            pReport.Dispose();
    This code has worked for over a year in our VS2008 development environment.  We use IIS, .Net 3.5, and ODP.Net with an Oracle 10g DB.  In our development environment we use IIS (not the built-in web server) which uses Windows integrated security.   My company recently pushed down new global policies to all desktops.  These new ploicies affected Local Security Policies and permissions on some files in the \windows\system32 directory.  When stepping through the code with the debugger, the application now hangs on the pReport.Load method.
    I need help in understanding the internals of the CR ReportDocument.Load method. We think the problem is somehow associated with CR trying to connect to a non-existent DB using some protocol that got affected by the policy changes. Can anyone shed some light on our problem, in particular what's happening inside the Load method.
    Thanks
    Dan

    Tried several options.
    OPTION 1:
    Created new VS2008 "Crystal Reports Application".
    'Manually' created schema (Activity.xsd) containing no DB connection information.
    Created Activity.rpt (that referenced the above Activity.xsd file).
    Created our 'normal' aspx page with code as follows:.
    DataTable pActivityDT = mDBService.GetDataTable("select * from E_ACT;");
    string pReportFile = Server.MapPath(@"/CRTestApp1/Activity.rpt");
    pReport.Load(pReportFile);
    pReport.SetDataSource(pActivityDT);
    MemoryStream pStream = (MemoryStream)pReport.ExportToStream(ExportFormatType.PortableDocFormat);
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.ContentType = "application/pdf";
    HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=Report.pdf");
    HttpContext.Current.Response.BinaryWrite(pStream.ToArray());
    First attempt at displaying the above page results in making it past the pReport.Load but hung on the pReport.SetDataSource.  All subsequent attempts hung on the pReport.Load method. (?????)
    OPTION 2:
    Usng the VS-generated Default page (which included the CR Viewer) the ReportSource was set declaratively as follows:
    <form id="form1" runat="server">
        <div>
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
                Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" />
            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                <Report FileName="Activity.rpt">
                </Report>
            </CR:CrystalReportSource>
        </div>
    </form>
    Attempting to display the above page results in the application hanging.  I also tried setting the source to a non-existant file just to see if an exception would be thrown.  I got the expected 'Load report Failed' message followed by parital rendering of the CR viewer.
    OPTION 3:
    The report displays as expected when a new connection (pproviding the DB login credentials) is created in the CR Database Expert dialog screens and the Activity (E_ACT) table is selected and used as the datasource for the report.  With this option, the designer displays data from the Activity table in the Main Report Preview screen.  When running the application the CR Viewer prompts for DB login credentails.
    Hope this  sheds some light on the issue we're having.
    Dan
    Edited by: Dan Cannon on Dec 10, 2009 7:23 PM

  • How to include columns with a space in name in clientcontext load method in JSOM

    Hi Gurus,
    I have a situation where I need to read a list that has a column 'Repositary Name'.
    While I am reading the list in my JSOM I need to load this column in the clientcontext.load method.
    My code likes this below.
    this.collListItem = list.getItems(camlQuery);
        ctx.load(collListItem, 'Include(Title, 'Repositary Name')')
    The Issue is I can not load this 'Repositary Name' column. I tried with its internal name, removing the space, putting the name in single quote but nothing works.
    Please advice how to include a column in clientcontext.load method that has a space in its name .
    Changing the column is not a option and I have to have call it before I use it my Async Methods.

    Hi,
    If I am getting your issue correctly, I think you should put _x0020_ in place of space in your column name. In your case try Repositary_x0020_Name.
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • CacheLoader load() method is getting invoked all the time

    The cache.get() method invokes the CacheLoader load() method if the key is not present in the cache.
    But the key is present in the cache already and when ever i invoke cache.get() it is invoking the load() method to get the data from DB.
    The expiry delay is also not met but still it invokes load() method all the time when the cache.get() method is invoked.
    Please let me know what is the issue with this?
    because it is connecting to DB from the load() method all the time even the key is in the cache. This will be an over head.

    Please find the contents of coherence cache config file below,
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>DBBackedAccessoryCache</cache-name>
    <scheme-name>distributed-db-backed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>distributed-db-backed</scheme-name>
    <service-name>DistributedCache</service-name>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
         <local-scheme>
         <expiry-delay>10h</expiry-delay>
         <flush-delay>4h</flush-delay>
         <high-units>250M</high-units>
         </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>DBAccessoryLoader</class-name>
    </class-scheme>
    </cachestore-scheme>
    <read-only>true</read-only>
    <refresh-ahead-factor>1.0</refresh-ahead-factor>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <listener/>
    <autostart>true</autostart>
    </distributed-scheme>
    </caching-schemes>
    </cache-config>

  • System Properties Class Loader, how to?

    Hi,
    I am trying to configure the WLS startup class to load some property class into system, i.e example.properties
    What does is it take?

    Hi,
    Step1). Create a Startup class like following:
    package startup;
    import java.util.*;
    import java.io.*;
    public class MyStartUp
        public static void main(String ar[]) throws Exception
               MyStartUp start=new MyStartUp();
                  Properties p=new Properties();
               InputStream stream=start.getClass().getClassLoader().getResourceAsStream("a.properties");
                     p.load(stream);
               System.out.println("\n\n\t Your City is : "+p.getProperty("city"));
    } Step2). Compile the above class like following
    javac  -d . MyStartUp.javaStep3). Now make a Jar which will include your properties file and the above Class
    jar -cvf  MyStartup.jar   startup  MyStartUp.java  a.propertiesStep4). Now put the MyStartUp.jar inside "$DOMAIN_HOME\lib" directory
    Step5). Configure the startup class from AdminConsole then restart your Server.
    Thanks
    Ravish Mody

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

  • Batch Scheduler Load Methods (A, R)

    We currently load 3 files from FDM to HFM. The first is loaded as a type 0 replace. The second is loaded as type 1 merge. The third is loaded as type 2 accumulate. Which load methods would I use with the batch loader to accomplish this? RR, AR, AA, etc. Thanks!

    Hi,
    The first item of the load tag indicates the method to use when bringing the data into FDM at the import stage 'R' will perform a replace, 'A' will perform an append. You can also have 'RZ' and 'AZ' which do the same but suppress zero values at the import step. It is the 2nd item which indicates the HFM load method and can be either 'R' for replace, 'M' for merge and 'A' for accumulate. I would therfore suggest, assuming you always import ito FDM using Replace that your batch file load tag would be
    1) RR
    2) RM
    3) RA
    All the load tags and options are well detailed in the FDM admin guide. Hope this helps.

  • Getting properties from loaded swf

    hi there,
    I am loading different swfs into my loader object "loader"
    and I also have a description of each swf below it ("desc"
    "desc_back").. Each swf is different in size and i want to move/
    scale "desc" and "desc_back" it to fit. This seems to be kind of
    working but it changes to fit the loaded swf before the one I want
    it to. it is if it is taking the properties of the last loaded swf
    instead of the one just loaded...I have tryed using an onload
    listener amoung a number of things. my action script is not very
    strong so it could be something simple.
    thanks :)

    you must wait until loading is complete before trying to
    access the _width and _height of the about-to-be-loaded swf. ie,
    use preloader code or the onLoadInit() method of the
    moviecliploader class.

  • Retreive contents of "*.properties" file loaded into jvm in oracle 10.2.0.1

    Hi,
    I have a 10g database with a few jars loaded. One of the files, a .properties file is required to be changed. Whilst I understand how to use loadjava and dropjava, I would like to retrieve the "*.properties" file that is currenly installed in the db.
    Any thoughts on how to do this would be much appreciated....
    regards
    Sc0tt...

    Scott,
    As far as I know, when loading JAR files into the Oracle database, the files contained in the JAR are extracted and stored separately. Hence you should be able to drop and load only your desired properties file. The following query may help verify this:
    (Assuming the properties file is in the schema of the current user.)
    select *
      from USER_OBJECTS
    where DBMS_JAVA.LONGNAME(OBJECT_NAME) = 'name of your properties file'Good Luck,
    Avi.

  • Accessing properties of loaded WindowedApplication from the Main WindowedApplication.

    Hi Friends.
    I am trying a project and according to my plans I am trying
    for some thing but don't know is it possible..
    I am compiling multiple air applications and One of them will
    be the main application. and another will not be actually *.air but
    the compiled swf file.
    In my final Air package I am going to package the Main
    application withe the other swf file too.
    So the main application will load the second swf file on
    requirement.
    Now my issue is i am able to access properties/functions of
    main application from the loaded WindowedApplication but I am not
    getting the idea how to access the loaded WindowedApplication
    properties/function from the MAIN application..
    This i am doing Because I can later Modify only the other
    application with out EFFECTING the MAIN.. like software updates..
    But getting the issue... Local Connection is Success. but
    still I want to establish a direct connection between the two
    WindowedApplications so to avoid lots of code what we write for
    LocaConnection objects.
    Please Give me any idea.

    I'm not sure how successful you will be with this in the long
    run. The WindowedApplication component is meant to be used as a
    singleton.
    If your goal is simply to modularize your code, you might be
    better off creating components that your main application loads,
    rather than trying to create multiple separate AIR applications and
    then combining them.

  • Load Method of MimeMessage

    Hi all,
    I have tried a number of ways of using the method
    load(session, inputstream) to create a new MimeMessage from a MIME compliant piece of text (in a byte array form).
    The headers get created OK but the attachments are still encoded.
    I would like to know if you HAVE to write your own
    handling functions to decode these, or if it is
    possible to load them correctly without doing this ?
    Thanks,
    **Phill**

    what happens when you try to create a mimemessage from a bytearrayinputstream is that it reads the stream and creates the header object and stops there with the pointer being positioned at the body part. After that you need to manually create a message.
    if you want the code for the same... mail me at [email protected]
    anurag

Maybe you are looking for

  • I am planning on getting a new IMAC will my old software work on the new mac

    I am planning on buying a IMAC so will I have to replace all my software that is on my G4 running 10.5.8 ?

  • Untrusted connection

    I am using xp os when iam open fire fox ever time it's asking the the connection was untrusted that msg was showing ever time and Facebook chat also was disabled My system Time and date is correct My Firefox Data pleas resoul My problem Application B

  • Regarding cell count

    hi, when i am selecting column in a particular table it is giving negativ value, i am using the method getSelectedCellColumn()  but  if i select row with method getSelectedRow() it is showing correct value, both i am using in  the same program, can a

  • Captio on array

    Hello! I wonder how to set caption for array data. For example I want to have caption drink in the first column, on second food, and on third desert. As I get in array only numbers bu I can not find how to make caption for all the columns of the arra

  • Scope of web services

    Hi all; In my research studies, I m working on testing BPEL processes. I read once when invoking a web service, one must distinguish between the scope of web services: application scope, session scope and request scope. To create BPEL process and web