Depricted API Gives Warnings

hello all,
I have a class called GZIPResponseWrapper .The inheritance hierarchy of my class as follows.
HttpServletResponseWrapper implements HttpServletResponse
GZIPResponseWrapper extends HttpServletResponseWrapper
HttpServletResponse has 3 depricated Methods
1.void setStatus(int sc, String sm)
2. String encodeUrl(String url)
3. String encodeRedirectUrl(String url)
When compiling I get the deprication warning from compiler. My environment of compilation as follows
j2ee Server: Jboss4.0
Java : Java 5 and latest j2ee.jar
Use ant.exe to compile the project.
The wanrining given bye the compiler as follows
[javac] Compiling 118 source files to C:\Documents and Settings\J.Lona\Desktop\Kep-Latest\WEB-INF\classes
[javac] C:\Documents and Settings\J.Lona\Desktop\Kep-Latest\WEB-INF\classes\com\beo\kep\servlets\GZIPResponseWrapper.java:8: warning: [deprecation
etStatus(int,java.lang.String) in javax.servlet.http.HttpServletResponse has been deprecated
[javac] public class GZIPResponseWrapper extends HttpServletResponseWrapper {
[javac] ^
[javac] C:\Documents and Settings\J.Lona\Desktop\Kep-Latest\WEB-INF\classes\com\beo\kep\servlets\GZIPResponseWrapper.java:8: warning: [deprecation
ncodeRedirectUrl(java.lang.String) in javax.servlet.http.HttpServletResponse has been deprecated
[javac] public class GZIPResponseWrapper extends HttpServletResponseWrapper {
[javac] ^
[javac] C:\Documents and Settings\J.Lona\Desktop\Kep-Latest\WEB-INF\classes\com\beo\kep\servlets\GZIPResponseWrapper.java:8: warning: [deprecation
ncodeUrl(java.lang.String) in javax.servlet.http.HttpServletResponse has been deprecated
[javac] public class GZIPResponseWrapper extends HttpServletResponseWrapper {
[javac] ^
[javac] 3 warnings
Please help me in this problem
Thank U for reading my Words
JINOY

These deprecated warnings simply mean that these methods should no longer be used and they may be removed from future versions of servlet API. Reading the Javadoc for the 1.4 APIs tells what methods you should use instead. See the Javadocs here: http://java.sun.com/j2ee/1.4/docs/api/index.html
Excerpts taken from the javadocs below:
encodeRedirectUrl
public java.lang.String encodeRedirectUrl(java.lang.String url)
Deprecated. As of version 2.1, use encodeRedirectURL(String url) instead
encodeUrl
public java.lang.String encodeUrl(java.lang.String url)
Deprecated. As of version 2.1, use encodeURL(String url) instead
setStatus
public void setStatus(int sc, java.lang.String sm)
Deprecated. As of version 2.1, due to ambiguous meaning of the message parameter. To set a status code use setStatus(int), to send an error with a description use sendError(int, String). Sets the status code and message for this response.

Similar Messages

  • OpenMarket sms api gives "Connection timed out: connect"

    Hello All,
    I am new to web applications with sms services.
    I am trying to send sms from my java application to mobile device. But I am getting below error.
    Aug 25, 2010 10:55:58 AM com.eha.sms.ema.EMACMMessageSendProxy init
    INFO: Move to send the receiver initialization.
    Destination address = +**********
    Source addres = +*****
    Sending message to Simplewire...
    REQUEST XML ==
    <?xml version="1.0" ?>
    <request version="3.0" protocol="wmp" type="submit">
         <user agent="Java/SMS/2.9.16"/>
         <account id="******************" password="***************"/>
         <option type="production"/>
         <source ton="0" address="+*****"/>
         <destination ton="0" address="+**********"/>
         <message udhi="false" text="Hello World!"/>
    </request>
    protocol: http
    remote host: ******Some site given to us by open market people that opens on browser**********
    remote port: 8080
    remote file: /wmp
    {main} [10:55:58.722] Conn: added module com.simplewire.http.RetryModule
    {main} [10:55:58.725] Conn: added module com.simplewire.http.AuthorizationModule
    {main} [10:55:58.726] Conn: added module com.simplewire.http.DefaultModule
    {main} [10:55:58.747] Conn: Creating Socket: smsc-01.openmarket.com:8080
    {main} [10:56:19.759] Conn: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at com.simplewire.http.HTTPConnection$_A.run(Unknown Source)
    Message was not sent!
    Error Code: 106
    Error Description: A connection could not be established with the Simplewire network. Connection timed out: connect
    Error Resolution:
    The code I am using is as below.
    private void config()
              Properties properties = new Properties();
              InputStream smscmReceiver = EMACMMessageSendProxy.class.getClassLoader().getResourceAsStream("sms.properties");
              try
                   properties.load(smscmReceiver);
                   System.out.println(properties.getProperty("SMS.SubscriberID").trim());
                   System.out.println(properties.getProperty("SMS.Password").trim());
                   System.out.println(properties.getProperty("SMS.DestinationAddress").trim());
                   System.out.println(properties.getProperty("SMS.SourceAddress").trim());
                   SMS sms = new SMS();
                   // subscriber settings
                   sms.setRemoteHost(" ******Some site given to us by open market people that opens on browser**********");
                   sms.setDebugMode(true);
                   sms.setRemotePort(8080);
                   sms.setSubscriberID(properties.getProperty("SMS.SubscriberID").trim());
                   sms.setSubscriberPassword(properties.getProperty("SMS.Password").trim());
                   // Message Settings
                   sms.setDestinationAddr(properties.getProperty("SMS.DestinationAddress").trim());          // recipient of message
                   sms.setSourceAddr(properties.getProperty("SMS.SourceAddress").trim());               // originator of message
                   sms.setMsgText("Hello World!");
                   System.out.println("Sending message to Simplewire...");
                   // submit message and check results
                   if (sms.submit())
                        System.out.println("Message was sent!");
         System.out.println("Ticket ID: " + sms.getMsgTicketID());
                   else
                        System.out.println("Message was not sent!");
                        System.out.println("Error Code: " + sms.getErrorCode());
                        System.out.println("Error Description: " + sms.getErrorDesc());
                        System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
              } catch (IOException e)
              log.error("Load profile sms.properties failed to send Move.", e);
    I am using windows 7 and the required info from the java code is picked up from a property file.
    destination address is a "+" sign followed by cell number of client in US and I am in diff country.
    source code I am using is "+" sign followed by a short code given by client.
    I am also not aware what short codes are for.
    I am also not sure whether I am passing correct parameters.
    I just followed a demo code from the api's sample file. (open market api......swsms-2.9.16 is the jar used.).
    would like to know If destination address can be my cell number.
    The open market people have configured the demo short code for our SMS messaging account.
    This feature will allow us to test our platform to send and receive SMS messages
    while we are waiting for our dedicated short code.
    Mobile Originated messages MUST start with our assigned keyword(s) to be routed to you.
    We have a few keywords but don't know how to use them.
    Please help!
    Thanks in advance.
    Edited by: Vish_1x1 on Aug 24, 2010 11:06 PM

    I had a same problem.
    It was definately URL and SOAP Action Problem.
    Also, I didnt configure the Proxy too.
    Please dont waste more time in looking inot other configs.
    Just give a careful look at Target URL and SOAP Action, again and again.
    Sweta , Please make this question Answerd , it will be useful for other users.
    And Bahvesh Deserves good points..
    Thanks ,
    Deo.

  • The Deployment of the SOAOrderBooking gives Warnings

    Dear Developers
    In windows I succesfully installed the SOA suite. (I followed the tutorial without any change)
    I deployed all the projects.
    However the deployment of the SOAOrderBooking gives the following Warnings.
    When I place an order as mentioned in the tutorial, nothing appears in Worklist Application. (Tutorial shows at page 41 the assigned task.)
    Also, Tutorial says that on page 36, "You can monitor the progress of that BPEL process from the Oracle Enterprise Manager 10g BPEL Control (Oracle BPEL Control)." However, I see initiated SOAOrderBooking processes with warnings.
    How can I get clean deployment of SOAOrderBooking?
    Any help appreciated,
    | Compiling bpel process SOAOrderBooking, revision 1.0
    [bpelc] unknown wsdl extension.
    [bpelc] In WSDL at "http://localhost:8888/esb/wsil/Fulfillment/OrderFulfillment?wsdl", extension element "{http://www.oracle.com/esb/}binding" is not known. Ignore this element.
    [bpelc] Please make sure the spelling of the element is correct and the WSDL import is complete.
    [bpelc]
    [bpelc] validating "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel" ...
    [bpelc] BPEL suitcase generated in: C:\SOADEMOJDEV\SOAOrderBooking\output\bpel_SOAOrderBooking_1.0.jar
    [bpelc] Warning: BPEL validation has warnings.
    [bpelc] The following warnings were reported during validation:
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 151 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}string" is not compatible with <to> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/top/OrderStatus}ordid anonymous type".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 162 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}string" is not compatible with <to> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/top/OrderStatus}comments anonymous type".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 208 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}decimal" is not compatible with <to> value type "{http://www.w3.org/2001/XMLSchema}string".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 343 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/top/getSsn}SsnCollection" is not compatible with <to> value type "{http://www.w3.org/2001/XMLSchema}string".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 676 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}string" is not compatible with <to> value type "{http://www.w3.org/2001/XMLSchema}decimal".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 692 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}string" is not compatible with <to> value type "{http://www.w3.org/2001/XMLSchema}decimal".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc] [Warning ORABPEL-10041]: Trying to assign incompatible types
    [bpelc] [Description]: in line 739 of "C:\SOADEMOJDEV\SOAOrderBooking\bpel\SOAOrderBooking.bpel", <from> value type "{http://www.w3.org/2001/XMLSchema}string" is not compatible with <to> value type "{http://xmlns.oracle.com/pcbpel/adapter/db/top/OrderStatus}ordid anonymous type".
    [bpelc] [Potential fix]: Please make sure that the return value of from-spec query is compatible with the to-spec query.
    [bpelc]
    [bpelc]
    [bpelc]
    deployProcess:
    [echo]

    OK I solved my problem.
    When I analyzed the flow and their XML's in BPEL Console, I saw that
    <summary>file:/D:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_SOAOrderBooking_1.0_937b09d1bd8dae1b33b028b2871aef63.tmp/OrderSequence.wsdl [ OrderSequence_ptt::OrderSequence(OrderSequenceInput_msg,OrderSequenceOutputCollection) ] - WSIF JCA Execute of operation 'OrderSequence' failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore. [Caused by: xADataSourceName not found]
    This means that I set the xADataSourceName as wrong.
    So I changed it according to the tutorail page 21.
    Now it works...

  • Using Windows.Devices.SmartCards API give 'System.UnauthorizedAccessException'

    Hi everybody,
    In the past I used the Windows.Devices.SmartCards APIs for Windows Phone 8.1 with success (https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.smartcards.aspx).
    Now i want to use the same APIs to connect my PC (Windows 8.1) to a SmartCardReader (e.g. ACR122) and read some data from a SmartCard.
    Unfortunately, when i use those APIs, a System.UnauthorizedAccessException is launched.
    How can i resolve it?
    Many thanks!
    This is the code:
    private async Task getSmartCardReader()
    string selector = SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Generic);
    DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector);
    Debug.WriteLine("Number of devices: "+devices.Count.ToString());
    if (devices != null && devices.Count != 0)
    foreach (DeviceInformation s in devices)
    try
    Debug.WriteLine("Device Id: "+s.Id);
    Debug.WriteLine("Device Name: " + s.Name);
    Debug.WriteLine("Is Device Enabled: " + s.IsEnabled);
    //Here is the line that launches exception
    SmartCardReader reader = await SmartCardReader.FromIdAsync(s.Id);
    catch (Exception e) {
    Debug.WriteLine(e.StackTrace);

    Does checking "Share User Certificates" in the capabilities help at all?
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Diskutil and SDK APIs give conflicting disk-status information

    I have a new USB CDROM device. When I run "diskutil info /dev/disk1s2", it shows the device status information properly, including Ejectable status Yes. Please see the details below. But when I tried to retrive the "ejectable" status programatically using Mac OS X functions - "[NSWorkspace sharedWorkspace] getFileSystemInfoForPath",  "FSGetVolumeParms(info.volume, &params, sizeof(params)" or  "DADiskCopyDescription( disk )", I always get ejectable status NO or FALSE. I have some old USB CDROM devices - in this case, diskutil and Mac OS X functions show same results. What can it be? I tested it on many Mac OSs, everywhere it shows the same problem.
    Thanks!
    my-mac:Desktop sreekanthgeorge$ diskutil info /dev/disk1s2
       Device Identifier:        disk1s2
       Device Node:              /dev/disk1s2
       Part of Whole:            disk1
       File System Personality:       HFS+
       Type (Bundle):                      hfs
       Name (User Visible):                Mac OS Extended
       Owners:                   Disabled
       Partition Type:           Apple_HFS
       OS Can Be Installed:      No
       Media Type:              
       Protocol:                 USB
       SMART Status:             Not Supported
       Volume UUID:              BA5E769E-3CE0-33BA-9963-EBD55A11A176
       Total Size:               68.3 MB (68302848 Bytes) (exactly 133404 512-Byte-Blocks)
       Volume Free Space:        0 B (0 Bytes) (exactly 0 512-Byte-Blocks)
       Device Block Size:        2048 Bytes
       Read-Only Media:          Yes
       Read-Only Volume:         Yes
      Ejectable:                Yes
       Whole:                    No
       Internal:                 No
       Optical Drive Type:       CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-R, DVD-RW, DVD+R, DVD+R DL, DVD+RW
       Optical Media Type:       DVD-ROM
       Optical Media Erasable:   No

    Thanks for your reply.
    If you are talking about diskutil, diskutil always returns the same results for /dev (device) and /Volumes/xxxx (mounted) path. Please see my code snippet below, all code look good and all Mac OS X function calls succeeded with proper results. But when I check the device/volume status, it always give "not-ejectable", "not-unmountable" and "not-removable". Read-only status is always NO (thats correct).
    Thanks again!
    Method 1 with "[NSWorkspace sharedWorkspace] getFileSystemInfoForPath"
        NSString *path = @"/Volumes/xxxx";
        BOOL isRemovable = NO;
        BOOL isUnmountable = NO;
        BOOL isWritable  = NO;
        BOOL ret =[[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:path isRemovable:&isRemovable isWritable:&isWritable isUnmountable:&isUnmountable description:nil type:nil];
        if ( ret )
            std::cout << "Removable " << (int)isRemovable  << "\n";
            std::cout << "Writable " << (int)isWritable << "\n";
            std::cout << "Unmountable " << (int)isUnmountable << "\n";
        else
            std::cout << "Failed" << "\n";
    Method 2 with "FSGetVolumeParms"
        CFStringRef mobiKEYVolumeName = CFStringCreateWithCString(kCFAllocatorDefault, "xxxx", kCFStringEncodingUTF8);
        OSStatus result = noErr;
        for (ItemCount volumeIndex = 1; result == noErr; ++volumeIndex)
            HFSUniStr255    volumeName;
            FSVolumeInfo    volumeInfo;
            FSRef           ref;
            bzero((void *) &volumeInfo, sizeof(volumeInfo));
            result = FSGetVolumeInfo(kFSInvalidVolumeRefNum, volumeIndex, &actualVolume, kFSVolInfoFSInfo, &volumeInfo, &volumeName, &ref);
            if (result == noErr)
                CFStringRef name = CFStringCreateWithCharacters(kCFAllocatorDefault, volumeName.unicode, volumeName.length);
                if (name != NULL && (CFStringCompare(name, mobiKEYVolumeName, 0) == kCFCompareEqualTo))
                    FSCatalogInfo info = {0};
                    if (FSGetCatalogInfo(&ref, kFSCatInfoVolume, &info, NULL, NULL, NULL) == noErr)
                        GetVolParmsInfoBuffer params;
                        if (FSGetVolumeParms(info.volume, &params, sizeof(params)) == noErr)
                            std::cout << "Removable " << (int)((params.vMExtendedAttributes & (1 << bIsRemovable)) != 0)  << "\n";
                            std::cout << "Ejectable " << (int)((params.vMExtendedAttributes & (1 << bIsEjectable)) != 0) << "\n";
    Method 3 with "DADiskCopyDescription"
        DASessionRef daSession = DASessionCreate( kCFAllocatorDefault );
        if ( daSession )
            DADiskRef disk = DADiskCreateFromBSDName( kCFAllocatorDefault, daSession,  "disk1s2");
            if ( disk )
                CFDictionaryRef desc = DADiskCopyDescription( disk );
                if ( desc )
                    CFBooleanRef ejectable = (CFBooleanRef)CFDictionaryGetValue( desc, kDADiskDescriptionMediaEjectableKey );
                    CFBooleanRef removable = (CFBooleanRef)CFDictionaryGetValue( desc, kDADiskDescriptionMediaRemovableKey );
                    CFBooleanRef writable = (CFBooleanRef)CFDictionaryGetValue( desc, kDADiskDescriptionMediaWritableKey );
                    std::cout << "Ejectable " << (int)(ejectable == kCFBooleanTrue)  << "\n";
                    std::cout << "Writable " << (int)(writable == kCFBooleanTrue)<< "\n";
                    std::cout << "Removable " << (int)(removable == kCFBooleanTrue)<< "\n";

  • Raw types from JDK API show warnings.

    Hi,
    Backwards compatibility means that old code will work with JDK 5 code. These warnings will be there always till the old code is changed completely to generics code. Is that right ?
         List list = new ArrayList();
         list.add( new String() );
         list.add( new Integer( 1 ) );
    com\annotation\processor\ArrayStoreCheck.java:17: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    list.add( new String() );
    ^
    Mohan

    Backwards compatibility means that old code
    d code will work with JDK 5 code. These warnings will
    be there always till the old code is changed
    completely to generics code. Is that right ?Pretty much. The code will continue to work, but the compiler will warn you about the dangers of using raw types.

  • Negative values p_quantity API pa_budget_pub.add_budget_line

    Is it possible to give negative values for the parameters p_quantity or p_raw_cost or p_burdened_cost in the API pa_budget_pub.add_budget_line.
    I require to give negative values for the p_quantity and the API gives a error message. No problem while giving a positve or zero.

    Hi ,
    Looks like your budget type might have been upgraded to financial plans. Oracle Projects has two models when it comes to budgets. One is the traditional form based budgets, identified by budget types. The other is the Financial Plans, which is used in Project Management Module. The older model ones are referred to as budget and the newer model ones are referred to as Financial Plans which provides several more additional functionality as compared with the traditional budget types.
    Both are supported by oracle, however, once a budget type / budget version is upgraded to financial plan types/versions you will not be able to maintain them using the forms interface, you will have to use the self service pages only for those.
    It appears that your budget type / budget version might have been upgraded to financial plan types, which is why you had to pass the fin_plan_type_id (Financial Plan type id) for the API to work.
    Regards,
    Raghavan Gopalakrishnan

  • PrintWindow api with possible solution for capture screenshot Google Chrome window

    Hi,
    as all you know, PrintWindow api give us a black image when us want a capture screenshot  of Google Chrome window. So, a friend said me that a possible solution for this problem is: 
    Reduce Google Chrome window for -1px in both sides and after this, reset  to original size. And so, will repaint again.
    Based on code below, someone could help me make this? sincerely I don't know where begin.
    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
    [DllImport("user32.dll")]
    private static extern IntPtr GetDC(IntPtr WindowHandle);
    [DllImport("user32.dll")]
    private static extern void ReleaseDC(IntPtr WindowHandle, IntPtr DC);
    [DllImport("user32.dll")]
    private static extern IntPtr GetWindowRect(IntPtr WindowHandle, ref Rect rect);
    [DllImport("User32.dll", SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
    [StructLayout(LayoutKind.Sequential)]
    private struct Rect
    public int Left;
    public int Top;
    public int Right;
    public int Bottom;
    public static Bitmap Capture(IntPtr handle)
    Rect rect = new Rect();
    GetWindowRect(handle, ref rect);
    Bitmap Bmp = new Bitmap(rect.Right - rect.Left, rect.Bottom - rect.Top);
    Graphics memoryGraphics = Graphics.FromImage(Bmp);
    IntPtr dc = memoryGraphics.GetHdc();
    bool success = PrintWindow(handle, dc, 0);
    memoryGraphics.ReleaseHdc(dc);
    return Bmp;
    private void button1_Click(object sender, EventArgs e)
    IntPtr WindowHandle = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Chrome_WidgetWin_1", null);
    Bitmap BMP = Capture(WindowHandle);
    BMP.Save("C:\\Foo.bmp");
    BMP.Dispose();
    Any suggestions here is appreciated.

    Hello,
    I would prefer capture the screen rather than get it from that application directly.
    It has been discussed in the following thread.
    Is there any way to hide Chrome window and capture a screenshot or convert the Chrome window to image?
    In this case, you could remove the line "ShowWindowAsync(mainHandle, 0); " since you don't want to hide it.
    using System;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.Drawing.Imaging;
    [DllImport("user32.dll")]
    private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
    [DllImport("user32.dll")]
    public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
    [DllImport("user32.dll")]
    public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdcBlt, int nFlags);
    public WhateverMethod()
    //initialize process and get hWnd
    Process chrome = Process.Start("chrome.exe","http://www.cnn.com");
    //wait for chrome window to open AND page to load (important for process refresh)
    //you might need to increase the sleep time for the page to load or monitor the "loading" title on Chrome
    System.Threading.Thread.Sleep(4000);
    chrome.Refresh();
    IntPtr mainHandle = chrome.MainWindowHandle;
    RECT rc;
    GetWindowRect(mainHandle, out rc);
    Bitmap bmp = new Bitmap(rc.Width, rc.Height, PixelFormat.Format32bppArgb);
    Graphics gfxBmp = Graphics.FromImage(bmp);
    IntPtr hdcBitmap = gfxBmp.GetHdc();
    PrintWindow(mainHandle, hdcBitmap, 0);
    gfxBmp.ReleaseHdc(hdcBitmap);
    gfxBmp.Dispose();
    bmp.Save("c:\\temp\\test.png", ImageFormat.Png);
    ShowWindowAsync(mainHandle, 0);
    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    private int _Left;
    private int _Top;
    private int _Right;
    private int _Bottom;
    public RECT(RECT Rectangle)
    : this(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom)
    public RECT(int Left, int Top, int Right, int Bottom)
    _Left = Left;
    _Top = Top;
    _Right = Right;
    _Bottom = Bottom;
    public int X
    get { return _Left; }
    set { _Left = value; }
    public int Y
    get { return _Top; }
    set { _Top = value; }
    public int Left
    get { return _Left; }
    set { _Left = value; }
    public int Top
    get { return _Top; }
    set { _Top = value; }
    public int Right
    get { return _Right; }
    set { _Right = value; }
    public int Bottom
    get { return _Bottom; }
    set { _Bottom = value; }
    public int Height
    get { return _Bottom - _Top; }
    set { _Bottom = value + _Top; }
    public int Width
    get { return _Right - _Left; }
    set { _Right = value + _Left; }
    public Point Location
    get { return new Point(Left, Top); }
    set
    _Left = value.X;
    _Top = value.Y;
    public Size Size
    get { return new Size(Width, Height); }
    set
    _Right = value.Width + _Left;
    _Bottom = value.Height + _Top;
    public static implicit operator Rectangle(RECT Rectangle)
    return new Rectangle(Rectangle.Left, Rectangle.Top, Rectangle.Width, Rectangle.Height);
    public static implicit operator RECT(Rectangle Rectangle)
    return new RECT(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom);
    public static bool operator ==(RECT Rectangle1, RECT Rectangle2)
    return Rectangle1.Equals(Rectangle2);
    public static bool operator !=(RECT Rectangle1, RECT Rectangle2)
    return !Rectangle1.Equals(Rectangle2);
    public override string ToString()
    return "{ + _Left + "; " + " + _Top + "; Right: " + _Right + "; Bottom: " + _Bottom + "}";
    public override int GetHashCode()
    return ToString().GetHashCode();
    public bool Equals(RECT Rectangle)
    return Rectangle.Left == _Left && Rectangle.Top == _Top && Rectangle.Right == _Right && Rectangle.Bottom == _Bottom;
    public override bool Equals(object Object)
    if (Object is RECT)
    return Equals((RECT)Object);
    else if (Object is Rectangle)
    return Equals(new RECT((Rectangle)Object));
    return false;
    And the key method used is the one shared in
    Get a screenshot of a specific application.
    Regards,
    Carl
    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.

  • URGENT Help: Converting JAVA ALE API (9.3)  to MDX API (11.1.1)

    Hi All,
    currnetly I am in the process of converting ALE to MDX API as ALE is no more used
    com.hyperion.ap.IAPMdMember in ALE Api gives the member details like Alias, level, Gen etc
    Equivalent to IAPMdMember , In MDX there are two
    1.com.essbase.api.metadata.IEssMember -> It gives all the member details like Alias, level, Gen etc
    IEssMember metatdata extraction is very slow. need to increase maxport user as Goodwin said.Even then for 10 lakhs metadata it fails at one point or other (Using outline or member selection every thing fails)
    SEVERE: Cannot get members. Essbase Error(1007165): Cannot obtain new member handle.  The maximum number of open member handles for this outline has been reached.  You must save and close the outline to continue
    2. com.essbase.api.dataquery.IEssMdMember - It gives members Name/alias based on Query setting and some properties like readonly etc.
    This IEssMdMember metadata extraction is very fast. Even 10 lakhs data is retrieved ina minute, but I am in need of Alias, level and Gen to frame the metadat as Nodes (or in bean object with same hierarchy)
    can some Java MDX experts help me.Is there any to access member details like geb, level, alias using IEssMdMember? I searched in API i couldnt find any clue. converting IEssMdMember to IEssMember using outline findmember also time consuming and it taking 2 to 3 days to fetch the 10 lakhs record.
    If there is no way to get details , then give me some tips how it can be managed, by cache technology or threading or is there any fastest collection object available

    Add the below DIMENSION properties in MDX query will provide the Gen_Number, level and alias
    DIMENSION PROPERTIES MEMBER_ALIAS ,GEN_NUMBER ,LEVEL_NUMBER,MEMBER_NAME on columns
    Thanks for http://www.network54.com/Forum/58296/

  • Bridge CS5 using lots of memory and give out-of-memory errors

    Hi,
    I'm using Bridge CS5 with the latest updates on Vista 32bit 4GB RAM on quad core machine.
    Bridge memory seems to keep raising during the usage, browsing a new folder seems to raise it a bit and previewing files raise it alot, mainly when I preview a large 18MP files.  (Bridge seems to not freeing the memory and re-use it...  leaking(?) )
    Very quickly the Bridge RAM usage is reaching about 1GB and at this point Bridge gives warnings that it can't generate 100% previews.
    When I restart Bridge, it works fine for a while until the memory start raising again.
    (It takes about 5-6 100% previews of 18MP files to reach that RAM usage - so the problem occurs rather quickly)
    I've tried limiting the cache in the preferences and disable caching of 100% previews -- didn't help.
    Any ideas?
    Thanks.

    I've tried
    a larger page file - no change.
    (I doubt it will help as 32bit OS can't accessthat much memory anyways)
    I'm not sure why you think it's a HD/page file problem?  like I said, I don't have a speed problem of an issue with files not being cached.
    My problem is that Bridge memory usage keep growing without any reason I can see - and at some point Bridge stops functioning correctly cause of it.
    I deleted all my cache, and browsed a folder with under 1000 files, and after previewing about 5-6 files in 100% - bridge memory usage was close to 1GB.
    currently my cache is set to 10000 files and not caching 100% previews.
    Where did you find other peoping reporting on such a problem?  I mostly find people reporting out-of-storag errors and crashes -- I have neither of those.
    Thanks!

  • Java logging API (1.4) -- where's the file?

    Where on God's green earth does the log file get written to?
    I am doing some very simple code:
    import java.util.logging.*;
    public class SimpleLogging {
       static Logger jcfeLog = Logger.getLogger("test1");
       static Logger sampleLog = Logger.getLogger("test2");
       public static void main(String [] args)
          jcfeLog.warning("sample warning");
          sampleLog.log(Level.INFO, "sample info entry");
          byte[] moreInfo = new byte[10];
          //fill moreInfo with some binary info
          jcfeLog.log(Level.FINEST, "Some obscure event", new Object[]{moreInfo});
    } doesn't get much simpler, plus I am using the default properties file. I get the console output but simply cannot find the log file anywhere on my system. Just for kicks, here is the config entry for the file:
    java.util.logging.FileHandler.pattern =%t/java%u.logmy understanding is that it should go to the temp directory?
    also, why aren't the specs for the config file listed anywhere, all these %t, %u, etc.....????

    The FileHandler API gives the meaning for the % symbols.
    http://java.sun.com/j2se/1.4/docs/api/java/util/logging/FileHandler.html
    Your pattern indicates that the file should be put in the system's temp directory, with the file name java###.log.
    Maybe you should try calling the addHandler method on your Loggers, and add a FileHandler to write the messages to that file.

  • Apple Search API screenshotUrls problem

    Currently Apple provide search API for developers to grab app information, but there is a problem.
    The Search API gives screenshot urls sometimes in tiff format, for example, if you look at http://itunes.apple.com/lookup?id=427451581, it outputs a json object and gives the screenshotUrls property as:
    screenshotUrls: [
    "http://a3.mzstatic.com/us/r1000/105/Purple/f4/1e/10/mzl.iglsmwvl.png"
    "http://a1.mzstatic.com/us/r1000/091/Purple/36/c1/6c/mzl.jjjtwaoh.tiff"
    "http://a1.mzstatic.com/us/r1000/093/Purple/0e/f9/22/mzl.fzvvuldk.tiff"
    "http://a1.mzstatic.com/us/r1000/099/Purple/e2/90/12/mzl.qxijgrsp.tiff"
    "http://a1.mzstatic.com/us/r1000/086/Purple/ae/6d/85/mzl.egcruftz.tiff"
    "http://a1.mzstatic.com/us/r1000/075/Purple/2c/07/fa/mzl.yoylibvb.tiff"
    note it give 5 images with tiff format, but browsers cannt load tiff images, which brokes some functionality of application using the search API
    however, the itunes store itself uses a converted jpg format image, just look at the corresponding itunes appstore page and take a look at screenshots: http://itunes.apple.com/us/app/strahlenschutz-osterreich/id427451581?mt=8&uo=4
    the screen shots url are:
    http://a1.mzstatic.com/us/r1000/105/Purple/f4/1e/10/mzl.iglsmwvl.320x480-75.jpg
    http://a2.mzstatic.com/us/r1000/091/Purple/36/c1/6c/mzl.jjjtwaoh.320x480-75.jpg
    and so on, all with .jpg format
    so, is there a way to extract out the .jpg image urls, or is there any other API that provides desired screenshot and icon urls?
    Thanks

    I am surprised to say that I don't think this is possible.  Which is strange because upon inspection of the JSON results there is a return key for EVERYTHING except target iOS version.  I would imagine that this may be an oversight by apple.  It does not make sense that I can search "supportedDevices", "isGameCenterEnabled", and "fileSizeBytes" but not minimum or target OS.

  • IPhone API

    Hi Adobe/Etc
    Now that CS5 Flash is officially been released on trial download where can we find the iPhone API's? I am looking for more information on loading in external videos - please can you let me know!
    Thanks again

    If you're part of the private beta you should already have access to the docs, if not you'll have to wait for the public beta. In the mean time you can start developing Flash content for the desktop with the docs available here: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html, the same APIs (give or take a few desktop specific ones) will be supported by iPhone Flash apps.

  • Has anyone here built a front end using the API?

    .. and if so, how have you found it? I need to create one sharpish (most likely using the generated JSP pages from JDeveloper)
    any pointers, links to tutorials, pitfalls and best practice would be greatly appreciated, as well as comments on your own experience. If you've found real problems, this would be interesting too.
    Thanks in advance,
    Dan

    The assumption above is using the ADF or any Web framework technology it's not that hard to develop. Afterthe post I gave it a try and I was able to list deployed processes and list of instances and their configurations in a nice table format.
    But the problem I see is it's not that easy to simulate BPEL PM visual flow, audit trail functionalities which I feel are very useful for trouble shooting. The APIs give you proprietary XML dump and you have to do some sort of XSL transformation to present it in a meaningful way.
    Hopefully Oracle addresses this and seperate the Admin and BPEL process auditing/troubleshooting aspects in BPEL PM Console very soon.
    Regards,
    Rajesh

  • Pass information between dom0 & domU thanks to web service API

    I have to build automation API in Java programming language for application deployment on virtualized infrastructures. Is there any way to pass information to application running inside the deployed virtual machine and to notify the host about some application's states? Everything using only the Webservice API...
    The principal examples I can give:
    For VMware (Virtual Infrastructure compliant products) & Virtualbox infrastructures, WS API give use the capability to set variables to retrieve them thanks to the guest tools ( vmware-guestd & VBoxControl )...
    For XenServer and Hyper-V, the only way we found to get that done is to directly write the variables in a part of the virtual machine configuration. Then, from the virtual machine, we need to connect to the XenServer/Hyper-V, identify the virtual machine which is currently running our application, and use it to retrieve the application configuration... The problem with the later is that we have to "hard write" the authentication information in the virtual machine, and to find a way to determine in which virtual machine the application is running ( this is done so far using NIC Mac address ).
    Because of the "light" documentation, i don't know if such a thing is possible for OVM manager...

    My mistake...
    on [http://download.oracle.com/docs/cd/E11081_01/doc/web.21/e14979/toc.htm|http://download.oracle.com/docs/cd/E11081_01/doc/web.21/e14979/toc.htm] , the method
    void      createPropertiesFileOnVirtualMachine(java.util.Properties props, VirtualMachine vm, java.lang.String propFileName)seems to do what I need...
    Now, because my test environment only allow PV Guests, I'd like to know if that also work for HW Guests?

Maybe you are looking for

  • SQL Plus Log on Issues

    Not entirely sure if I've posted in the correct area.. I've recently installed the Oracle 11g. Installation process seemed fine but I'm unable to access any components of the software (eg. SQL Plus) When I try to enter my UN and PW, I keep getting th

  • ATTRIBUTE_IDOC_METADATA : In segment E1FIKPF attribute occurred instead of

    Hi All, I am getting this error message in sxmb_moni when I try sending an idoc in idoc-XI-idoc scenario.Message type that I am using is FIDCCP01. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:

  • Problem in Universal worklist configuration

    Hi, I wnt to register sap system. i have Navigated to System Administration  System Configuration  Universal Worklist and Workflow  Universal Worklist - Administration. Click new button and provided the following details: System alias : sapr3 Conn

  • Questions concerning OpenAL and SDL sound

    Hi, After having sound problems with Warsow, I wanted to rebuild OpenAL as it seemed to use OSS by default. However, the PKGBUILD currently in ABS does not work anymore, the download for the source is invalid. I wrote my own PKGBUILD for openal-soft,

  • Tabbed Pane shapes

    I'm having trouble with changing the shape of the tab for example the default shape of the tab is rectangle i want it to be a bit oblique however i have no idea if this is possible or not.