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

Similar Messages

  • 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***

  • 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.

  • 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>

  • 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

  • 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.

  • 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

  • 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.

  • FDM Metadata Load Method in ERPI

    Hi,
    Can anyone point me in the right documentation for how the FDM metadata load rule in ERPI works? I've read through the ERPI admin guide which gives the basics but I want to know more detailed information. If we have this method selected for our source Ebusiness system, do we still need to run the metadata rule everytime we need to run a data load into Planning ?
    Thanks

    You do not need to execute the metadata rule each time you do a load to PLanning. The Metadata Load Rule is used to load metadata from EBS into the target environment. What specifically are you looking for?

  • Webview crash WebEngine load method - Win + Mac

    The code below crashes on Win 7 JavaFX 2.0 and Mac OS X 10.6 Java FX 2.0 EA
    On Win 7 32 bits under Java 7 it crashes in WebPane.dll
    On Mac OS X I get: Invalid memory access of location 0x170 rip=0x11e7c0d67
    The culprit is
    eng.load("https://graph.facebook.com/me/friends?access_token="+token); in the change listener.
        public static void main(String[] args) {
            Application.launch(args);
        @Override
        public void start(Stage primaryStage) {
         primaryStage.setTitle("Hello World");
             WebView view = new WebView();
            final WebEngine eng = view.getEngine();
            eng.load("https://graph.facebook.com/oauth/authorize?" + "client_id=" +
                   API_KEY +  "&"
                   + "redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup);
            final TextField locationField = new TextField("http://www.oracle.com/us/index.html");
            locationField.setMaxHeight(Double.MAX_VALUE);
            Button goButton = new Button("Go");
            goButton.setDefaultButton(true);
            EventHandler<ActionEvent> goAction = new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent event) {
                    eng.load(locationField.getText().startsWith("http://") ? locationField.getText() :
                            "http://" + locationField.getText());
            goButton.setOnAction(goAction);
            locationField.setOnAction(goAction);
            eng.locationProperty().addListener(new ChangeListener<String>() {
                @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
                    locationField.setText(newValue);
                        if (newValue.startsWith("http://www.facebook.com/connect/login_success.html")) {
                                           URLCodec codec = new URLCodec();
                            try {
                             String s = codec.decode(newValue);
                              String[] splits = s.split(",");
                             try {
                                 String json = s.substring(s.indexOf('#') + 1, s.length());
                                 System.out.println("JSON = " + json);
                                 String st = URLDecoder.decode(json, "UTF-8");
                                 System.out.println(st);
                                 String params[] = st.split("&");
                                 HashMap<String, String> parmsMap = new HashMap<String, String>();
                                 for (String param : params) {
                                  String temp[] = param.split("=");
                                  parmsMap.put(temp[0], java.net.URLDecoder.decode(temp[1], "UTF-8"));
                                 String token = parmsMap.get("access_token");
                                 System.out.println(token);
                                 eng.load("https://graph.facebook.com/me/friends?access_token="+token);
                             } catch (Exception e) {
                            } catch (DecoderException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
            GridPane grid = new GridPane();
            grid.setVgap(5);
            grid.setHgap(5);
            GridPane.setConstraints(locationField, 0, 0, 1, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.SOMETIMES);
            GridPane.setConstraints(goButton,1,0);
            GridPane.setConstraints(view, 0, 1, 2, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
            grid.getColumnConstraints().addAll(
                    new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true),
                    new ColumnConstraints(40, 40, 40, Priority.NEVER, HPos.CENTER, true)
            grid.getChildren().addAll(locationField, goButton, view);
            Scene scene = new Scene(grid, 1024, 768);
    {code}
    Edited by: user10787071 on Oct 8, 2011 9:52 PM
    Edited by: user10787071 on Oct 8, 2011 9:53 PM
    Edited by: user10787071 on Oct 8, 2011 9:55 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Created the following JIRA http://javafx-jira.kenai.com/browse/RT-17313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

  • Pls give me the code to load method only once in JVM.

    Hi all,
    Pls give me the code to execute method only once in JVM.Even if we create more than one instance to call the method.
    Thanks & Regards,
    Vinodh

    [How to ask a question on these forums|http://catb.org/~esr/faqs/smart-questions.html]

  • FDM Load Methods - Merge and Replace What is going on behind the scenes?

    Hello All
    We are using FDM to load Peoplesoft Files into Hyperion planning and ultimately Essbase.
    I am wondering what is actually going on within Planning, and ultimately Essbase, when the Replace option is selected when loading, and also the Merge option.
    Is it performing different cleardata options, and what criteria is it using to fix on?
    Thanks

    Hello,
    The clear statement that is being executed can be found in two places.
    It can be found as a pure statement in the FDM Logs (Analysis -> Log -> Adapter/Master Adapter: Load)
    It can be found in the coding form in the Adapter -> Load action (found in the Workbench)
    Hopefully this helps...

  • Recommended InfoObject loading method in 2004s

    We are trying to work out the recommended way of loading InfoObject texts, attributes and hierarchies into BI7 given the new data modelling components in the system. Should we still use the old InfoPackage route or is there a simpler and neater solution?
    Any recommendations would be most appreciated.

    With the new data flow concept in the new release (BI in SAP NetWeaver 2004s), the only role of the InfoPackage is to acquire data into the PSA (datasource).  From the PSA, the DTP takes over to drive the data load into data targets such as an InfoObject.  You'll need a transformation in place to connect the source (DataSource ie PSA) to the target InfoObject. Once the dataflow is modeled, you can build a DTP.
    Thanks for any points you choose to assign.
    Best Regards -
    Ron Silberstein
    SAP

Maybe you are looking for

  • Should I Get An iMac?

         I am thinking about getting an iMac 27". I will be using it for school, web browsing, and editing YouTube videos. I want it to last me for a few years. I this is what I will get on it: iMac 27" 3.4GHz Intel Core i7 34GB of Ram 768GB Flash Storag

  • How to execute the blocks in java

    Hi I have doubt on block programing class A{ System.out.println("hai"); public static void main(String[] args){ A a = new A(); compile and run the code the its display "hai" in console how is it possible. How it default called ?

  • Vlaue of valuated stock(0valstckval)

    Hi All,           in my inventory query valued stock is getting wrong val. but in the inventory cube Value Received into Valuated Stock ,Value issued from  Valuated Stock are fine. but in the query val of valuted stock was wrong means getting differe

  • Problem in Templates in smartforms

    Hi All, I got one requirement to create table with three rows and three columns. First two columns are with three rows and  In third column They want to merge three rows as one row. My idea is to create two templates for this requirement and mix two

  • Database - List Mode

    I can't figure out how to change the font for the column headings in the database list mode. The default font is very small and difficult to read. Can anyone help?