Error: Generic Error Creation

Hi All,
Following in the line which is giving error "Generic Error Creation" on compile:
Line:
public static Queue<String>[] mqPrcLst = new LinkedList<String>[BankerAndFifo.miNoOfPrc];
Result:
FIFO.java:12: generic array creation
public static Queue<String>[] mqPrcLst = new LinkedList<String>[BankerAndFifo.miNoOfPrc];
Here is what I am trying to do:
Create an array of Queue objects where each process will have its own queue containing a set of instructions pertaining to that process.
I am a novice in this field[Collections].
Kindly guide me.
Regards,
java_learner_s

jverd wrote:
java_learner_s wrote:
@jverd
What would you have me do? Either use a List instead of an array, or don't use generics here. Those are your only real options.Or fake it:
   public static void main(String[] args) {
      List<String>[] x = createGenericArray(10);
      x[0] = new LinkedList<String>();
   @SuppressWarnings("unchecked")
   public static <T> T[] createGenericArray(int length) {
      return (T[]) new Object[length];
   }Use at your own risk (though, to be honest, I don't see anything unsafe about it. Except the ClassCastException...give me a sec to fix).
Edit Here we go.
   public static void main(String[] args) {
      List<String>[] x = createGenericArray(List.class, 10);
      x[0] = new LinkedList<String>();
      x[1] = new ArrayList<String>();
//      x[2] = new LinkedList<Integer>(); // doesn't compile
   @SuppressWarnings("unchecked")
   public static <U, T extends U> T[] createGenericArray(Class<U> type, int length) {
      return (T[]) Array.newInstance(type, length);
   }I don't like it and would probably never use it, but is it unsafe?
Edited by: endasil on 12-Nov-2009 2:28 PM

Similar Messages

  • Getting 'generic error' when trying to 'add media'

    Working with a brand new Surface Pro 2.  New user of Premier Elements 12.  Cannot get 'Add Media' to work.  Getting an error message of 'add media error - generic error'.
    Media is on a Kodak Z981 with a file type of .MOV.
    I am thinking that there is some simple error that is preventing me from 'adding media'.
    What is it?

    Welcome to the forum.
    Do you have the latest version of Apple's QuickTime Player installed?
    If one does not, that can cause a Generic Error, upon Import.
    Good luck,
    Hunt

  • Generic Error on all reports

    I am a salesforce.com veteran user who is trying to get Dynamics CRM up and running for a small business.  This software was purchased several years ago and never implemented because no one could figure out how to do it.   I wanted
    to run a very simple report to see which accounts have an account number tied to them and which do not. I can get through the report wizard but at the very end, I get a generic error message that says "Error Uploading Report". An error occurred while
    trying to add the report to Microsoft Dynamics CRM. Try again, if the problem continues check the Microsoft Dynamics CRM Community" I am the administrator so this is not a permission issue. All the forums talk about needing to do stuff with SQL and code.
    I don't do code. I am a salesperson trying to get some very basic information out of this system. Is it even possible for a non-programmer to create and run a report in Dynamics? I find most everything ridiculously complicated. Any advice would be greatly
    appreciated.  Remember, you are dealing with a salesperson, not a programmer.  Thanks again! 

    Hello,
    I'm not pretty sure why do you need Report for such kind of task - Advanced Find would be enough. Regarding issues with reports I would suggest to
    turn-on trace, restart IIS and then repeat creation of a report - once error occurred recheck traces for explanation why error occurred.
    Dynamics CRM MVP/ Technical Evangelist at
    SlickData LLC
    My blog

  • JACK2 error: DBus exception: org.jackaudio.Error.Generic:

    I try to follow https://wiki.archlinux.org/index.php/JA … ection_Kit
    to work with JACK2 D-Bus but I get:
    $ jack_control start
    --- start
    DBus exception: org.jackaudio.Error.Generic: Failed to open server
    I have consulted this thread without results.
    When I open qjackctl and attempt to start the server I get:
    01:56:11.937 Patchbay deactivated.
    01:56:11.943 Statistics reset.
    01:56:11.945 ALSA connection change.
    Cannot connect to server socket err = No such file or directory
    Cannot connect to server request channel
    jack server is not running or cannot be started
    01:56:11.954 ALSA connection graph change.
    01:56:20.676 JACK is starting...
    01:56:20.676 jackd -dalsa -dhw:0 -r48000 -p1024 -n2
    Cannot connect to server socket err = No such file or directory
    Cannot connect to server request channel
    jack server is not running or cannot be started
    01:56:20.680 Could not start JACK. Sorry.
    01:56:22.012 JACK was stopped
    Any ideas?
    PS: There are no relevant messages in dmesg and my /etc/pulse/client.conf is:
    $ cat /etc/pulse/client.conf
    # This file is part of PulseAudio.
    # PulseAudio is free software; you can redistribute it and/or modify
    # it under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2 of the License, or
    # (at your option) any later version.
    # PulseAudio is distributed in the hope that it will be useful, but
    # WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    # General Public License for more details.
    # You should have received a copy of the GNU Lesser General Public License
    # along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
    ## Configuration file for PulseAudio clients. See pulse-client.conf(5) for
    ## more information. Default values are commented out. Use either ; or # for
    ## commenting.
    ; default-sink =
    ; default-source =
    ; default-server =
    ; default-dbus-server =
    #; autospawn = yes
    ; autospawn = no
    ; daemon-binary = /usr/bin/pulseaudio
    ; extra-arguments = --log-target=syslog
    ; cookie-file =
    ; enable-shm = yes
    ; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
    ; auto-connect-localhost = no
    ; auto-connect-display = no
    More info:
    $ uname -vro
    3.19.0-mainline-3.19-test-1 #1 SMP PREEMPT Wed Feb 11 13:27:53 WET 2015 GNU/Linux
    $ kwin -v
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Qt: 4.8.6
    KDE Development Platform: 4.14.5
    KWin: 4.11.16
    Last edited by costis (2015-02-28 02:07:41)

    Got the errors.
    1) DB_STATUS.. error was coming since the lookup I gave there was not actually created in the database due to a refresh I did while creating it effectively deleting all the entered data.
    2) The error in logs was coming due to wrong input of the GTC database provider during the creation of IT Resource.

  • A generic error occurred in GDI+ while assing tiff image file to Bitmap and Image

    Hi,
    I am getting "A generic error occurred in GDI+" error while reading the tiff image file to Bitmap or Image.
    Below is my sample code.
    string filePath=@"c:\Images\sample.tif";
    Bitmap bmp=new Bitmap(filePath);   // here getting exception
    int totalpages=bmp.GetFrameCount(.....);
    etc......
    I tried using Bitmap.FromFile() and also from FromStream() even for Image also but there is no use.
    Moreover i m having full permissions for the file path and the tiff file is having multiple pages.
    Can anyone help me to solve this issue please.
    Thanks & Regards,
    Kishore
    Kishore

    Make sure that the Tif file is valid (can other software open it)?  If you are able to save a Tif using GDI+, try saving that Tif, then opening it.  Part of me wonders if there is something about that specific Tif that GDI+ doesn't like.
    You could also try using WIC to open the TIF, perhaps you would have better luck there.

  • RC-00118: Error occurred during creation of database

    adcrdb.sh started at Mon Nov 14 16:16:13 EAT 2011
    The environment settings are as follows ...
    ORACLE_HOME : /u04/d01/tech_st/11.2.0
    ORACLE_SID : JCLONE
    TWO_TASK :
    PATH : /usr/bin:/u04/d01/tech_st/11.2.0/bin:/usr/bin:/usr/sbin:/u0 4/d01/tech_st/11.2.0/jdk/bin:/usr/ccs/bin:/bin:/usr/bin/X11:/usr/local/bin:/u04/ d01/tech_st/11.2.0/appsutil/clone/bin/../jre/jre/bin:/usr/lib/qt-3.3/bin:/usr/ke rberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbi n:/usr/bin:/usr/X11R6/bin:/root/bin:.
    LD_LIBRARY_PATH : /u04/d01/tech_st/11.2.0/lib:/usr/X11R6/lib:/usr/openwin/lib :/u04/d01/tech_st/11.2.0/ctx/lib
    Executable : /u04/d01/tech_st/11.2.0/bin/sqlplus
    The log information will be written to
    /u04/d01/tech_st/11.2.0/appsutil/log/JCLONE_oracle/adcrdb_JCLONE.txt
    Creating the control file for JCLONE_oracle database ...
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Nov 14 16:16:13 2011
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected to an idle instance.
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1071333376 bytes
    Fixed Size 1348968 bytes
    Variable Size 427821720 bytes
    Database Buffers 629145600 bytes
    Redo Buffers 13017088 bytes
    CREATE CONTROLFILE REUSE SET DATABASE "JCLONE"
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01159: file is not from same database as previous files - wrong database id
    ORA-01110: data file 1: '/u04/d01/apps_st/data/system01.dbf'
    alter database open resetlogs
    ERROR at line 1:
    ORA-01507: database not mounted
    alter tablespace TEMP add tempfile '/u04/d01/apps_st/data/temp01.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    ALTER DATABASE RENAME GLOBAL_NAME TO "JCLONE.jtl.co.ke"
    ERROR at line 1:
    ORA-01109: database not open
    ORA-01507: database not mounted
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1071333376 bytes
    Fixed Size 1348968 bytes
    Variable Size 427821720 bytes
    Database Buffers 629145600 bytes
    Redo Buffers 13017088 bytes
    Database mounted.
    BEGIN dbms_backup_restore.zeroDbid(0); END;
    ERROR at line 1:
    ORA-01119: error in creating database file
    '/u04/d01/tech_st/11.2.0/dbs/MISSING00015'
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 4754
    ORA-06512: at line 1
    ORACLE instance shut down.
    Connected to an idle instance.
    ORACLE instance started.
    Total System Global Area 1071333376 bytes
    Fixed Size 1348968 bytes
    Variable Size 427821720 bytes
    Database Buffers 629145600 bytes
    Redo Buffers 13017088 bytes
    CREATE CONTROLFILE REUSE SET DATABASE "JCLONE"
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01159: file is not from same database as previous files - wrong database id
    ORA-01110: data file 1: '/u04/d01/apps_st/data/system01.dbf'
    alter database open resetlogs
    ERROR at line 1:
    ORA-01507: database not mounted
    alter tablespace TEMP add tempfile '/u04/d01/apps_st/data/temp01.dbf' REUSE
    ERROR at line 1:
    ORA-01109: database not open
    ALTER DATABASE RENAME GLOBAL_NAME TO "JCLONE.jtl.co.ke"
    ERROR at line 1:
    ORA-01109: database not open
    Error Running create/replace library with adupdlib.sql
    ORA-01109: database not open
    PL/SQL procedure successfully completed.
    File created.
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Pr oduction
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    exit_code=0
    Checking for errors ...
    The database has not been successfully created. Shutting down the instance ...
    SQL*Plus: Release 11.2.0.2.0 Production on Mon Nov 14 16:16:32 2011
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected.
    ORACLE instance shut down.
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Pr oduction
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    .end std out.
    .end err out.
    ADX Database Utility
    getConnectionUsingAppsJDBCConnector() -->
    APPS_JDBC_URL='null'
    Trying to get connection using SID based connect descriptor
    getConnection() -->
    sDbHost : oracle
    sDbDomain : jtl.co.ke
    sDbPort : 1524
    sDbSid : JCLONE
    sDbUser : apps
    Trying to connect using SID...
    getConnectionUsingSID() -->
    JDBC URL: jdbc:oracle:thin:@oracle.jtl.co.ke:1524:JCLONE
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter cou ld not establish the connection
    Trying to connect using SID as ServiceName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle .jtl.co.ke)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=JCLONE)))
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter cou ld not establish the connection
    Trying to connect using SID as ServiceName.DomainName
    getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle .jtl.co.ke)(PORT=1524))(CONNECT_DATA=(SERVICE_NAME=JCLONE.jtl.co.ke)))
    Exception occurred: java.sql.SQLException: IO Error: The Network Adapter cou ld not establish the connection
    Connection could not be obtained; returning null
    -------------------ADX Database Utility Finished---------------
    RC-00118: Error occurred during creation of database
    Raised by oracle.apps.ad.clone.ApplyDatabase
    StackTrace:
    java.lang.Exception: Control file creation failed
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:661)
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:328)
    at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:304)
    at oracle.apps.ad.clone.ApplyDBTier.<init>(ApplyDBTier.java:154)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
    at oracle.apps.ad.clone.util.CloneProcessor.run(CloneProcessor.java:68)
    at java.lang.Thread.run(Thread.java:595)
    Current database Version is 11.2.0.2
    Apps Version is 11.5.10.2
    RUP version is 6
    Forms Patchset version is 19
    Please advise how to resolve this error ?
    Regards
    Mohammed.

    Please refer to these docs/links.
    Troubleshooting RapidClone issues with Oracle Applications 11i [ID 364565.1]
    Adcfgclone.pl DBTier is failing with error for dbms_backup_restore.zeroDbid(0) [ID 361157.1]
    https://forums.oracle.com/forums/search.jspa?threadID=&q=ORA-01503+AND+ORA-01159+AND+ORA-01110&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Can't find printer connected by ethernet through airport extreme.  All I get is a generic error message - I'm using printer IP address as address.

    Old imac using snow leopard printed just fine to Ricoh cl2000n printer that is connected to airport extreme via ethernet (as was the imac). New iMac with Lion otherwise same cable configuration and the computer cannot find the printer.  It searchs and spits out a generic error message.  Any suggestions?  Thanks!

    Is your printer listed?
    http://support.apple.com/kb/HT3669
    If not then you need to get the driver and install it.
    Otherwise you may want to reset the printing system.
    http://support.apple.com/kb/ht1341

  • Apple support page "generic error" message when I want to open a case

    the case is 2 folds, I been trying to register my ipad 2, which I bought at the same time and location togther with macbook pro 13", the macbook product registration went throuh fine, but for the iPad I got the message that the product is already registered under a different apple ID, so, I wanted to reach out to apple ID support to see what the story is and how I can resolve it, I dont have another ID and Idid not register the ipad prior to that], but every time I go through the list of choices to select the proper category, of course I have to follow >>more products and services >> other apple ID topics >> the topic is not listed >> enter new topic - prodcut registered under a different apple ID - >> continue >>
    We're sorry, but we are unable to complete your request at this time.
    Please try again in a few minutes or start over now.
                                                                                                                                            (error.generic)
    the centered text is the message I get evreytime I tried, and I start over and it gets me to the same place,
    dunnu what to do guys, I hope you can help me with this

    update to the product registration problem
    so, I managed to complete the process of registeting my ipad using
    https://register.apple.com/cgi-bin/WebObjects/GlobaliReg.woa
    but, I was supposed to receive an email notification, and for the ipad to appear in the list of registered products, but it still did not happen, I hope its just a matter of time,
    as for the alternate ID, it seems to me that apple still recognises the old "@me" email address automatically assigned to users, but now disabled, I think that was the source of confusion as to the "other ID"

  • When I try and add a video from my iPhone it fails to load with a generic error. How do I fix this?

    I have been trying unsuccessfully to get a video from my iPhone to load.  It plays just fine on windows media player, but every one I try and add on Adobe gives me the same "Add media failure.  The importer reported a generic error."  what do I do to fix this.?

    Here is more information on problems some people have had trying to edit iphone video
    http://forums.adobe.com/thread/881246
    http://forums.adobe.com/thread/1011411?tstart=0
    http://forums.adobe.com/thread/934466

  • When I open itunes to play content I've already purchased and while attempting to view trailers for movies in the itunes store, I receive a generic error message from windows, and I'm directed to reinstall the latest version of itunes.  Not a fix.  Help?

    When I open itunes to play content I've already purchased and while attempting to view trailers for movies in the itunes store, I receive a generic error message from windows, and I'm directed to reinstall the latest version of itunes.  Not a fix.  Help?

    after perusing other subjects with playback issues: 
    this is the fix: 
    -Launch Control Panel - Double click Quicktime, If you do not see quicktime, look on the top left side of control panel and switch to classic view. This will then allow you to see Quicktime.
    -Now click the advanced tab and click on Safe Mode GDI Only, Apply, then ok.

  • Error occured during creation of oracle snapshot

    Dear All,
    I am getting error messange in my SAP Inbox in t.code SBWP.
    In SBWP, the nessage text is as follow.
    =============================
    Error occured during creation of oracle snapshot (Creation aborted)
    (Log see also transaction SLG1, Object ORASNAP, Subobject ORASNAPCR)
    Oracle snapshot creation program aborted
    Error while copying from oracle view to SAP table
    Oracle view SAP$KCBFWAIT
    SAP table ORA_SAPKCBFWAIT
    Return code (ORA-....) 942
    You tried to work with the name of a table or view that does not exist in the database
    The table does not exist on the database. A table name or view name was used that does not exist on                           the database.
    ===============================
    I also check in T.Code SLG1, but i am not getting the reason for this error.
    Regards,
    Nisit

    Hi,
    Check each of the following :
    the spelling of the table or view name.
    that a view is not specified where a table is required.
    that an existing table or view name exists.
    Contact the database administrator if the table needs to be created or if user or application privileges are required to access the table.
    Also, if attempting to access a table or view in another schema, make certain the correct schema is referenced and that access to the object is granted.
    Regards
    Krishna

  • GDI+ Generic Error, multple frame tiff, multiple image formats

    This is a question I posted on stack exchange, but have not gotten any answers.  This is occurring on Windows Server 2008 R2 systems.
    I have seen many issues involving the GDI+ Generic Error, but I have not seen this particular matter raised before. We are consistently getting the error, on Windows systems other than Windows 8, when attempting to read (System.Drawing.Image.SelectActiveFrame)
    a multiple-frame tiff that includes frames in mixed Photometric Interpretation formats. That is to say, the file includes both RGB color and min-is-white formats, with corresponding differences in the Bits/Sample and Samples/Pixel frame parameters. The error
    is consistently raising as soon as a frame is encountered with a format that is different from that of the first frame.
    // Convert File from .tiff to .PDF
    static void ConvertFile(string file, string pdffilename)
    string localMessage = string.Empty;
    try
    //if it's a PDF Just renamed it and continue
    if (file.ToLower().Contains(".pdf"))
    File.Copy(file, pdffilename);
    return;
    // If file exists return
    if (File.Exists(pdffilename)) { return; }
    using (var stream = new FileStream(pdffilename, FileMode.Create))
    localMessage = "01";
    var document = new iTextSharp.text.Document();
    localMessage = "01";
    var writer = iTextSharp.text.pdf.PdfWriter.GetInstance(document, stream);
    localMessage = "02";
    var bm = Bitmap.FromFile(file);
    localMessage = "03";
    var total = bm.GetFrameCount(FrameDimension.Page);
    localMessage = "04";
    document.Open();
    //iTextSharp.text.pdf.PdfContentByte cb = writer.DirectContent;
    localMessage = "05";
    iTextSharp.text.Image img = null;
    for (var currentframe = 0; currentframe < total; ++currentframe)
    localMessage = "06=>" + currentframe.ToString();
    bm.SelectActiveFrame(FrameDimension.Page, currentframe);
    localMessage = "07=>" + currentframe.ToString();
    img = iTextSharp.text.Image.GetInstance(bm, ImageFormat.Bmp);
    localMessage = "08=>" + currentframe.ToString();
    img.ScalePercent(72f / img.DpiX * 100);
    localMessage = "09=>" + currentframe.ToString();
    img.SetAbsolutePosition(0, 0);
    localMessage = "10=>" + currentframe.ToString();
    iTextSharp.text.Rectangle pageRect = new iTextSharp.text.Rectangle(0, 0, img.ScaledWidth, img.ScaledHeight);
    localMessage = "11=>" + currentframe.ToString();
    document.SetPageSize(pageRect);
    localMessage = "12=>" + currentframe.ToString();
    document.NewPage();
    localMessage = "13=>" + currentframe.ToString();
    document.Add(img);
    localMessage = "14";
    bm.Dispose();
    localMessage = "15";
    document.Close();
    localMessage = "16";
    stream.Close();
    catch (Exception exception)
    string msg = exception.Message + "\r\n" +
    "Coversion Error--\r\n" +
    "\tinput file name: " + file + "\r\n" +
    "\toutput file name: " + pdffilename + "\r\n" +
    "\tlocal message" + localMessage + "\r\n";
    Console.WriteLine(msg);
    SaveError(msg);
    throw;
    The "local message" is always "06=>n", where n is the 0-based index of the frame that transitions to a new format.
    The error occurs whether the transition is from black and white to color, or color to black and white.  The issue does not seem to occur on Windows 8 boxes, but we only have W8 developer PCs, not servers.  It is a production process and needs to
    be deployed on a server.
    Does anyone know why this is happening or how to fix it?

    Hi,
    For the GDI related issue, i think you may ask in the following forums:
    http://forums.asp.net/150.aspx/1?System+Drawing+GDI+
    Thanks for your understanding.
    Regards.
    Vivian Wang

  • ExternalException was unhandled : A generic error occurred in GDI+.

    I am try to save this bitmap as jpg file for every 5 sec. It works fine at another application, before I move this method to another app. The error message shows ExternalException was unhandled : A generic error occurred in GDI+. I do not know if
    it is write permission issure or anything else. Since I use same computer and try to save at same file path, the error message keep going. I think I need help.
    The error code:
    public void captureScreen()
    bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
    Debug.WriteLine("width:{0}, height:{1}", Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
    gfxScreenshot = Graphics.FromImage(bmpScreenshot);
    gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
    //Save the screenshot to the specified path that the user has chosen
    i++;
    string i1 = Convert.ToString(i);
    string name = "good" + i1 + ".jpg";
    ImageCodecInfo jpg = GetEncoder(ImageFormat.Jpeg);
    System.Drawing.Imaging.Encoder myEncoder = System.Drawing.Imaging.Encoder.Quality;
    EncoderParameters myEncoderParameters = new EncoderParameters(1);
    EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder,
    50L);
    myEncoderParameters.Param[0] = myEncoderParameter;
    bmpScreenshot.Save(name, jpg,
    myEncoderParameters);
    Bitmap bitmap = new Bitmap(name);
    System.Drawing.Image image = (System.Drawing.Image)bitmap;
    The error shows here:
    bmpScreenshot.Save(name, jpg,
    myEncoderParameters);
    And Only alow me save one jpg, then pop up error

    Hi
    Since I can't reproduce your issue with some
    undefined code.
    Just take a look at from
    Graphics.FromImage Method
      in MSDN  document.
    You should always call the Dispose method to release the
    Graphics and related resources created by the
    FromImage method.  Please try and test it again.
    If still can't resolve, please post the complete code.  Thanks.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SSRS 2012 SP2 - Windows 2008R2 - Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: A generic error occurred in GDI+

    Hi,
    I have built new SQL 2012 SSRS SP2 with Windows 2008R2 and BAR reports are not showing (just "x" mark in the left corner).
    Following is the log file information. I have gone through other forums and all are with windows 8 or windows 2012. Your help is much appreciated.
    library!ReportServer_0-15!d7c!08/13/2014-10:52:17:: i INFO: RenderForNewSession('/ProductionReporting/PlantProduction')
    reportrendering!ReportServer_0-15!d7c!08/13/2014-10:52:18:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: , Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: A generic error occurred
    in GDI+. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
       at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
       at Microsoft.Reporting.Chart.WebForms.Chart.Save(Stream imageStream, ChartImageFormat format)
       at Microsoft.ReportingServices.OnDemandReportRendering.ChartMapper.GetImage(ImageType imageType)
       --- End of inner exception stack trace ---;
    Thanks,
    Vel
    Vel Thavasi

    Hi Vel,
    According to the error message, the issue is related to GDI+. Based on my research, it is a known issue that the GDI+ need to be updated on Windows Server 2008 R2. If we want to know what version of GDI+, we can do a file search for Gdiplus.dll.
    To fix this issue, please install the hotfix for your Windows Server 2008 R2 from the following kb:
    http://support.microsoft.com/kb/2495074
    There following thread about the similar issue is for your reference:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/50c071db-b4fc-4a2e-a9f4-e10e833c97d2/report-not-rendering-charts-in-pdf-a-generic-error-occurred-in-gdi?forum=sqlreportingservices
    If there are any other questions, please let me know freely.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Report not rendering charts in pdf (A generic error occurred in GDI+)

    I've found the following exception stack trace in the Report Server log:
    ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: , Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: A generic error occurred in GDI+. ---> System.Runtime.InteropServices.ExternalException:
    A generic error occurred in GDI+.
       at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)
       at Microsoft.Reporting.Chart.WebForms.Chart.Save(Stream imageStream, ChartImageFormat format)
       at Microsoft.ReportingServices.OnDemandReportRendering.ChartMapper.GetImage(ImageType imageType)
       --- End of inner exception stack trace ---;
    I've got no idea what this is, any help would be appreciated. I don't know what could potentially cause this, so I don't even know how to start looking for a fix.
    Other info:
    SSRS 2012 BI
    Win Server 2008 R2 (Running on Hyper-V)
    The pdf report(s) renders and is saved to the location it is meant to, but devoid of any charts. A data driven subscription controls the rendering.

    Hi,
    This is a known issue with Windows GDI+. To resolve the issue, please install the hotfix for youR Windows Server 2008 R2 from:
    http://support.microsoft.com/kb/2495074
    Regards,
    Mike Yin
    TechNet Community Support

Maybe you are looking for