Alternative to HttpUrlConnection.setChunkedStreamingMode()

I've read http://forum.java.sun.com/thread.jspa?threadID=418441&messageID=4237630 which suggests using chunked streaming for uploading large quantities of data.
I have an applet that transfers large files using this method (if I don't use chunked encoding, the client will get an OutOfMemoryException because the whole file will be buffered). However, I've just discovered the method only exists in Java 1.5.
Can anyone think of a good way around this?
Thanks in advance
James Shaw

A long-standing issue with the HTTP protocol handler is that it didn't know the content length in advance so it would buffer the entire request until you invokved getOutputStream or some other method that indicated the request could be sent. In 5.0 the ability to stream chunked encoded requests was added and that method you point is part of that solution. So is your issue that you can't upgrade to J2SE 5.0 for some reason?

Similar Messages

  • Timed HTTP upload via openConnection

    Hi there,
    I've been trying to perform a HTTP POST request which sends as much of a large payload as possible, recording how much is uploaded, within a given timescale.
    write() and flush() within my while loop do not seem to write any data to the socket however, and the console doesn't suggest any errors were encountered. 'data' has many megabytes of data to upload.
    Would welcome any ideas?
    BP
    //Init
    threadTimeStart = System.currentTimeMillis();
    theadTimeStop = threadTimeStart + 10000; // 10 seconds
    int writtenByteCount = 0;
    // Open connection
    URL u = new URL("http://hostname/filepath");
    URLConnection uc = u.openConnection();
    uc.setDoOutput(true);
    // Write data
    OutputStreamWriter wr = new OutputStreamWriter(uc.getOutputStream());
    // BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(uc.getOutputStream())); // has been tried also
    String data = URLEncoder.encode("upload_data", "UTF-8") + "=" + URLEncoder.encode(data, "UTF-8");
    while ( writtenByteCount < data.length() ) {
         wr.write(data, writtenByteCount, 1024);
         wr.flush();
         writtenByteCount += 1024;
         System.out.println("writtenByteCount: " + writtenByteCount + " of maximum " + data.length() + " bytes" );
         if ((double) System.currentTimeMillis() > TimeStop) break;
    // Get response
    BufferedReader br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
    String line = null;
    while ((line = br.readLine()) != null) {
         // **process response**
    // Close connections
    wr.close();
    br.close();

    Since your URLConnection will be an HttpURLConnection you can cast it to an HttpURLConnection and use method
    HttpURLConnection#setChunkedStreamingMode(1024); // Or whatever chunk size you want.

  • Download multiple files with 1 HttpURLConnection

    Hi,
    We have an application that downloads small text files (< 2 Kb) from a webserver. These files are downloaded 1 by 1 when needed. We open a HttpURLConnection, download 1 file and close the connection immediately afterwards. This is done for each file and hence produces a significant overhead.
    For performance reasons (both client and server side), we would like to open a connection to the webserver once, download a number of files and then close the connection.
    Currently, our code roughly looks like:
    InputStream is;
    HttpURLConnection con;
    int resp;
    try {
        URL url = new URL(location);
        con = (HttpURLConnection)url.openConnection();
        resp=con.getResponseCode();
        if(resp==HttpURLConnection.HTTP_OK) {
            is = con.getInputStream();
            // ... read data from the InputStream
            is.close();
    } catch (MalformedURLException murle) {
        murle.printStackTrace();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    }Is it even possible to download multiple files from a web server using a HttpURLConnection? If so, how? :-)
    Please note that the solution should be compliant with J2SE 1.1, since we are writing an MHP application!
    Thanks in advance...

    Seerix,
    You might be able to fudge the settings of the URL class :
    Class URLStreamHandler
    Method protected void setURL
    Sets the fields of the URL argument to the indicated values. Only classes derived from URLStreamHandler are supposed to be able to call the set method on a URL.
    But this is not the best way, as URLs are supposed to be constant.
    Your alternative, is to create a Socket, deal with the protocol requirements
    (i.e. HTTP GET, POST and so on) then you can request any number files
    on that same connection. The only thing that this saves is connection build up and tear down.
    You could also multi-thread your original code ....... Although that might
    only save you some network transit time.
    -Cludge

  • Changing the local address used by HttpURLConnection

    Hi,
    I would like to make an HTTP connection to a remote server but using a different local IP address than the default one.
    For example, I am running my application on a web server which has several IP addresses the code below will open a connection to a web page using the default address but how can I get the HttpURLConnection implementation to use an alternative address?
       URL url = new URL("http://www.somedomain.com/another/webpage.html");
       URLConnection conn = url.openConnection();
       InputStream in = conn.getInputStream();
       ...

    More than one interface/ip on one machine? Shouldn't matter, unless they're going up and down like yoyos. IP will route via whichever one is appropriate.
    I found this
    (but haven't tried out...)Nor has that poster apparently. The DIRECT example just throws an IllegalArgumentException, and the HTTP approach requires you to write a local proxy server, which just shifts the problem (if any) in there.
    like vm launch parametersNo.

  • Alternative to SSLAdapterFactory &  WLSSLAdapter in weblogic 10.3??

    Hi Floks
    The following code with SSLAdapterFactory & WLSSLAdapter works fine in weblogic8.1
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    FileInputStream clientCredentialFile = new FileInputStream("path of
    the client certificate");
    adapter.loadLocalIdentity(clientCredentialFile, "password".toCharArray
    adapter.setVerbose(true);
    adapter.setTrustedCertificatesFile("path of the root ca certificate");
    adapter.setStrictChecking(false);
    factory.setDefaultAdapter(adapter);
    factory.setUseDefaultAdapter(true);
    But, in weblogic 10.3 application server,SSLAdapterFactory & WLSSLAdapter are deprecated.
    plzz suggest some alternative way to the above deprecated classes SSLAdapterFactory & WLSSLAdapter.
    Thanks & Regards
    vishy

    We try to use those deprecated classes. Inspiteof correct certificates used in client, we are facing some issue like handshake failure.
    Exception details:
    javax.xml.ws.WebServiceException: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
         at weblogic.wsee.jaxws.spi.WLSProvider.readWSDL(WLSProvider.java:306)
         at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:77)
         at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:62)
         at javax.xml.ws.Service.<init>(Service.java:56)
         at com.xyz.service.provider.domainservices.profile.x2004.GetYZXInfoService.<init>(GetWFPProfileInfoService.java:59)
         at src.WFPProfileInfoServiceClientForFMO.main(WFPProfileInfoServiceClientForFMO.java:117)
    Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
         at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)
         at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:305)
         at weblogic.wsee.jaxws.spi.WLSProvider.readWSDL(WLSProvider.java:296)
         ... 5 more
    Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
         at weblogic.wsee.util.is.InputSourceUtil.loadURL(InputSourceUtil.java:100)
         at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:118)
         at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:65)
         at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
         ... 7 more
    thnks
    vishy

  • Alternative to (Deprecated)HttpRequest

    Now that most of the javafx.io.http package is Deprecated what is the alternative.

    http://download.oracle.com/javase/7/docs/api/java/net/URL.html
    * Use this to be certain string data is sent in ascii format.
    static final Charset ASCII_CHARSET = Charset.forName("US-ASCII");
    try {
         * Create the URL object.
        URL url = new URL("http://www.somwebsite.com/thepage.html?some_key=some_value");
        //Create the connection object from the url object.
        URLConnection connection = url.openConnection();
        //Since this is an Http URL, we can cast the URLConnection to something more specific.
        HttpURLConnection httpConnection = (HttpURLConnection) connection;
        //Tell it we are reading and writing.
        httpConnection.setDoInput(true);
        httpConnection.setDoOutput(true);
        //We are sending post headers, so set this appropriately.
        httpConnection.setRequestMethod("POST");
        //Tell it the MIME format of the request.
        httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        //Send the post headers.
        OutputStream outputStream = httpConnection.getOutputStream();
        outputStream.write("username=myusername&password=mypassword".getBytes(ASCII_CHARSET));
        outputStream.close();
        //Recieve whatever data here.
        InputStream inputStream = httpConnection.getInputStream();
        inputStream.close();
    } catch (IOException ex) { //Something went wrong. Tell us what.
        ex.printStackTrace();
    }I was a little distracted when writing this, so there may be errors. If you want to send large files, it gets much more complicated. Had to build my own class for that.
    Edited by: aidreamer on Jun 17, 2011 6:38 PM

  • How can I assign points to the alternatives in a question?

    Hi! I am building my first quiz in Captivate and I have this little problem I haven´t been able to solve. I want a make a test that meassures how stress you are att work. It looks like a survey, I´ll have about 20 or more questions with the same type of alternatives, no right or wrong alternatives, but you choose the one you agree the most with. The thing is that i want to give a value point to each alternative and be able to have a score at the end. See the example.
    How often do you feel stressed att work?
    1. never : 0 points
    2. one a week: 2 points
    3. three times a week: 3 points
    4. Everyday: 4 points
    Att the end, the score you get tells you how stressed you are, but instead of showing a result in term of points, you´ll get a text giving you feedback and recomendations for better health. Can I do that in Captivate? I haven´t been able to find a way to do that yet...
    Thanks for any help you can give me!

    Hello,
    Tried putting something together that could be possible, concentrated on the workflow. There will be some repetitive tasks to be done however, problem is that a click box cannot stay for a whole project, which means that a click box gets its proper ID on each slide. Will try to explain, it is up to you to judge if this is acceptable, or if you'd go better with a Flash app.
    Created (for the moment, perhaps you'll need more if p.e. for Q1-Q10 you need a separate result for A and for B, result for Q11-Q20...) two user variables:
    v_AClick     to store the number of clicks on A-option
    v_BClick     to store the number of clicks on B-option
    The results can then be used later on for a condition (did not write it yet).
    Created a first slide with these objects:
    dummy Text Caption 'Option A' (will be replaced later on with question text)
    click box covering up this Text Caption, named it (ID) ClickA1 (this is the tedious part, has to be done for each CB; ClickA2, ClickA3...)
    dummy Text Caption 'Option B' (will be replaced later on with question text)
    click box covering up this Text Caption, named it (ID) ClickB1 (this is the tedious part, has to be done for each CB; ClickB2, ClickB3...)
    imported a 'sign' to be showed after the user clicked into the Library, and put an instance to the right of each Text Caption, those were labeled VinkA and VinkB. Very important: set those instances to 'Show for the entire project', which avoids to have them duplicated to each slide, we will hide and show them as necessary.
    button 'Next' which on Succes jumps to next slide.
    The blue Text Caption was for me, to check if the actions were functioning, shouldn't be there in the end file.
    I created a first Advanced action, labeled it HideVink (sorry for the Dutch, Vink = the green symbol), to be triggered on entering the slide:
    Hide VinkA
    Hide VinkB
    Second/third action, labeled A_Action1/B_Action1 to be triggered by clicking on the ClickA1/ClickB2 with these actions:
    increment v_AClick/v_BClick with 1
    hide the other clickbox, thus ClickB1/ClickA1 to avoid that the user could click on both options
    show AVink/BVink
    Here is an example, action A_Action1
    Those two actions have to be duplicated for each Question slide (A_Action2, B_Action2,....). What has to be changed in the duplicates is only the number of the Click Box, that is why I labeled them to make the process easier.
    Now I duplicated the slide as many times as necessary. The actions for button and entering slide are OK, but the actions for the click boxes have to be adapted (tedious).
    Why did I use 'dummy' Text Captions: I should export (File menu) the Text Captions to a Word-document, change the dummy texts (left column) to the real captions (much easier in one doc) and re-import them into the CP-file.
    That was my homework, as promised. Hope it helps, even if you choose to go the Flash-way after all.
    Lilybiri

  • Alternative Periods in Report Painter

    I'm trying to create a report painter report for labour efficiency, it compares actual labour confirmations to a statistical key figure for payroll hours.
    I have the basic elements, but my problem is this.  We currently run our accounts on a calendar month basis, so we have 12 periods in FI.  This report is required on a weekly basis for each weeks payroll.  Is it possibly to report totals for a given week, when that is not your accounting period?
    I can't see any obvious characterisics that will give me a weekly total of each figure, but I'm wondering if it os possible to define alternative periods (e.g. 52/53 week years ending each sunday for a period, and bring that in as a row characteristic).
    Has anybody managed to achieve anything like this, and if so how?
    Postings can occur anytime in the week, so I don't think posting date is an option, but may be if you can specify ranges that can be logically extrapelated in the report (i.e. Mon-Sun).
    Thanks for any advice on this
    Graham

    Has anybody got any comments or advice on this?
    Graham

  • A semiautomatic alternative to /etc/fstab

    This is probably highly redundant... the chances are, someone will likely say "XYZ does that for you and you can configure it in 5 minutes", but here goes anyways.
    I wanted a simple way to mount the disks in my computer to the same location regardless of where they were in the system (thus via UUID) but what I *didn't* want was to have to copy/type the UUID myself. The following possibly shaky bash script is the result.
    First, however, a (very real-world) demonstration of its functionality!
    /disks/ + ./domount
    Using scriptdir "/disks/.mountscripts".
    Running mount... [ok]
    [Disk ST3250620A_5QE4M336]
    group0-root -> /disks/250gb: [ok]
    38067a33-0556-4cab-a5c5-c96b313bd174 -> /disks/250gb/boot: [ok]
    21D4-2E62 -> /disks/250gb/data: [ok]
    group0-home -> /disks/250gb/home:
    == mount error ==
    mount: wrong fs type, bad option, bad superblock on /dev/mapper/group0-home,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so
    =================
    [R]etry/Skip [P]artition/Skip [D]isk/[Q]uit? q
    /disks/ + fsck.jfs /dev/mapper/group0-home
    fsck.jfs version 1.1.15, 04-Mar-2011
    processing started: 11/10/2011 20:28:10
    Using default parameter: -p
    The current device is: /dev/mapper/group0-home
    Block size in bytes: 4096
    Filesystem size in blocks: 52099072
    **Phase 0 - Replay Journal Log
    Filesystem is clean.
    /disks/ + ./domount
    Using scriptdir "/disks/.mountscripts".
    Running mount... [ok]
    [Disk ST3250620A_5QE4M336]
    group0-root -> /disks/250gb: (already mounted)
    38067a33-0556-4cab-a5c5-c96b313bd174 -> /disks/250gb/boot: (already mounted)
    21D4-2E62 -> /disks/250gb/data: (already mounted)
    group0-home -> /disks/250gb/home: [ok]
    group0-var -> /disks/250gb/var: [ok]
    partition1.vfat -> /disks/250gb/home/backup/80gb/mnt/partition1.vfat: [ok]
    partition2.vfat -> /disks/250gb/home/backup/80gb/mnt/partition2.vfat: [ok]
    partition3.vfat -> /disks/250gb/home/backup/80gb/mnt/partition3.vfat: [ok]
    partition4.ext3 -> /disks/250gb/home/backup/80gb/mnt/partition4.ext3: [ok]
    data2 -> /disks/250gb/home/backup/32gb-2/mnt/data2: [ok]
    [Disk ST340014A_5MQ4HB90]
    0854-08DE -> /disks/20gb-1/data-1: [ok]
    4846-D7E2 -> /disks/20gb-1/data-2: [ok]
    3070DB1E70DAE99C -> /disks/20gb-1/winnt: [ok]
    38BB-158D -> /disks/20gb-1/pool: [ok]
    [Disk WDC_WD800BB-22J_WD-WCAM9H677098]
    e336c404-fca8-4f2b-9c75-81c22f339741 -> /disks/80gb: [ok]
    4738-E723 -> /disks/80gb/vfat: [ok]
    a827cfa1-08cf-4a24-a989-aae94ea0801b -> /disks/80gb/boot: [ok]
    7bb5df89-3a90-4c92-8aa7-a94271806087 -> /disks/80gb/var: [ok]
    09b652b7-4f5e-4895-8464-6f972a44fdd6 -> /disks/80gb/home: [ok]
    a2534aa6-b70f-442d-805e-365ee626d4be -> /disks/80gb/tmpspace: [ok]
    4871-993D -> /disks/80gb/tmpspace2: [ok]
    386a2a83-22e2-425c-bd48-cb0a1fad8a87 -> /disks/80gb/pool: [ok]
    /disks/ +
    Here's the script! (I can pastebin it if neccessary)
    #!/bin/bash
    # ohai from i336 :P <[email protected]>
    # Oct-Nov 2011
    # Public domain, no warranty. Be sure to use the "t" flag on the first run!
    # This program has two modes: scan mode and run mode.
    # Configuration
    # =============
    # You first need to create/go into the directory you want to mount your disks
    # in, such as /mnt (I use /disks), and create the subdirectory ".mountscripts", or
    # alternatively "programname-mountscripts" (the second directory bearing the
    # name of the program/symlink, a simple mechanism to implement some flexibility).
    # You can substitute any created symlinks whereever "./domount" is mentioned.
    # The existance of this directory indicate that this is the work directory.
    # (For added flexibility, the program will look for the second directory, the
    # one bearing its name, first, then fall back on ".mountscripts" if this is not
    # found.)
    # Scan Mode
    # =========
    # After creating this directory for the first time you will want to run
    # "./domount s" to generate the mountscripts into the mountscript directory
    # (which is selected as specified above).
    # Run Mode
    # ========
    # At this point, go into the mountscript directory, open all the files you find
    # there in a text editor, and add in the mountpoints you want to use after the
    # UUID parameter to 'partop' (an internal function defined in this file for the
    # scripts).
    # ** The first time you simply MUST run "./domount t" in order to see that the
    # 'mount' commands are correct! **
    # After this is done, run "./domount" and it will go ahead and mount the disks.
    # Run "./domount u" and it will unmount everything. (No options exist for
    # individual partitions as yet).
    # Limitations
    # ===========
    # * If you use domount to mount loopback images inside real partitions and the
    # real partitions are also mounted by domount, well, domount will try to
    # unmount them in the same order as when it mounts... and it will break.
    # Simple solution: skip however many real [p]artitions you have, then
    # re-run domount again. :)
    # * If you change a disk (eg add a partition), well, you'll have to delete the
    # file for that disk, re-scan (domount will not touch the other scripts) then
    # re-add your partitions back in. This program wasn't really designed to deal
    # with that kind of situation :)
    # * This program does not support LVM partitions - quite frankly, it doesn't
    # even realize such things exist. Thus you will not find any LVM partitions
    # listed in the generated scripts, or any "LVM partitions ignored"
    # messages - indeed, if you only have LVM partitions on a given disk, the
    # resulting syntactically incorrect script will contain an 'if' block with
    # no content and the shell will produce an error.
    toollist=
    needtool=0
    for tool in find lsblk blkid cfdisk xargs grep tail mountpoint; do
    type -P $tool > /dev/null 2>&1
    if [ $? -eq 0 ]; then
    toollist="${toollist} ${tool}"
    else
    toollist="${toollist} [${tool}]"
    needtool=1
    fi
    done
    if [ $needtool -eq 1 ]; then
    echo "This program requires the following tools in order to run. Those marked with"
    echo "brackets cannot be found (using \`type') and their containing packages"
    echo "likely need to be installed."
    echo $toollist
    exit 1
    fi
    sizes=(bytes KB MB GB TB)
    progname=$(basename $0)
    if [ -d ".mountscripts" ]; then
    scriptdir="$(pwd)/.mountscripts"
    elif [ -d ".${progname}-mountscripts" ]; then
    scriptdir="$(pwd)/.${progname}-mountscripts"
    fi
    if ([[ ! -d "${scriptdir}" ]] && [[ "$1" != "s" ]]) || [[ "$1" == "h" ]]; then
    cat << EOF
    usage: $0 [s] [t]
    s = scan
    t = test run (USE THIS THE FIRST TIME AFTER YOU HAVE DONE A SCAN)
    EOF
    exit 1
    fi
    if [[ "$1" = "s" ]]; then
    echo -n "Scanning disk tables... (by name)"
    parttable=(); while IFS= read -r line; do parttable+=("$line"); done < \
    <(find /dev/disk/by-id/ -name "scsi-SATA*" -name "*-part*" -type l | xargs stat -L -c "%t-%T %n")
    echo -n ", (by UUID)"
    uuidtable=(); while IFS= read -r line; do uuidtable+=("$line"); done < \
    <(find /dev/disk/by-uuid/ -type l | xargs stat -L -c "%t-%T %n")
    echo -ne " [ok]\nRunning blkid..."
    blkidtable=(); while IFS= read -r line; do blkidtable+=("$line"); done < \
    <(blkid)
    echo -ne " [ok]\nRunning lsblk (uno momento)..."
    lsblktable=(); while IFS= read -r line; do lsblktable+=("$line"); done < \
    <(lsblk -bro name,size,fstype,model | grep -v group | tail -n +2)
    echo -e " [ok]\n"
    if [ ${#parttable[@]} -ne ${#uuidtable[@]} ]; then
    echo 'Something is very wrong with either this program'
    echo 'or your disk configuration. O.o'
    exit 1
    fi
    echo -e "Using scriptdir \"${scriptdir}\".\n"
    echo -ne "\e[1GCompiling mapping table... [ ]\e[?25l"
    max=$[${#parttable[@]}*${#parttable[@]}]
    runindex=0
    for ((i = 0; i < "${#parttable[@]}"; i++)); do
    partsplit=(${parttable[$i]})
    devok=0
    devname="$(readlink -f ${partsplit[1]})"
    partsize=
    for uuid in "${uuidtable[@]}"; do
    uuidsplit=($uuid)
    c=$[((runindex*43)/$[max-1])]
    echo -ne "\e[29G"
    if [ $c -gt 0 ]; then eval \printf "%.s#" {0..$c}; else echo -n '.'; fi
    if [ $c -lt 43 ]; then eval \printf "%.s." {$[c+1]..43}; fi
    ((runindex++))
    if [[ "${partsplit[0]}" = "${uuidsplit[0]}" ]]; then
    partlabel=
    devok=1
    for entry in "${blkidtable[@]}"; do
    if [[ "${entry:0:$[${#devname}+9]}" != "${devname}: LABEL=\"" ]]; then continue; fi
    partlabel="${entry:$[${#devname}+9]}"
    partlabel=$(echo -n $(echo $partlabel | cut -d'"' -f1))
    done
    for entry in "${lsblktable[@]}"; do
    entry=($entry)
    if [[ "/dev/${entry[0]}" != "$devname" ]]; then continue; fi
    partsize=${entry[1]}
    parttype=${entry[2]}
    done
    if [ ! partsize ]; then
    echo "$0: error: cannot determine partition size for $devname"
    exit 1
    fi
    devline="${partsplit[1]:26} ${uuidsplit[1]:18} ${partsize} ${parttype}${partlabel:+ $partlabel}"
    map[${#map[@]}]="$devline"
    fi
    done
    if [ $devok -eq 0 ]; then
    checkparttable[${#checkparttable[@]}]="${parttable[$i]#* }"
    fi
    done
    echo -e "\e[?25h\e[75Gdone.\n"
    if [[ ${#checkparttable[@]} -gt 0 ]]; then
    cat << EOF
    Warning: The following partitions do not have matching UUID entries
    in /dev/disk/by-uuid/.
    Linux seems to be quite smart, and won't list UUIDs for LVM
    members, partitions \`mount' cannot mount without the -t flag,
    or extended partition headers, but /dev/disk/by-id/ will still
    list them. So these are probably not a problem but may still
    warrant a double-check; if these contain valid filesystems you
    will need to insert them manually since their UUIDs cannot be
    calculated.
    EOF
    for partition in "${checkparttable[@]}"; do
    echo " >> $(readlink -f $partition) (/dev..by-id/${partition:26})";
    done
    echo
    fi
    find /dev/disk/by-id/ -name "scsi-SATA*" -not -name "*-part*" -type l | while read disk; do
    scriptfile="${scriptdir}/${disk:26}.mount.sh"
    rm -f "${scriptfile}"
    if [ ! -f "${scriptfile}" ]; then
    echo -ne "No mountscript found for disk ID \"${disk:26}\", creating one...\nRunning cfdisk... "
    cfdtable=(); while IFS= read -r line; do cfdtable+=("$line"); done < \
    <(cfdisk -Ps $disk | grep -v "Free Space" | grep -v "Unusable" | tail -n +6)
    echo -ne "[ok]\nRunning smartctl... "
    smartctlinfo="$(smartctl -i $disk)"
    diskdevname="$(readlink -f ${disk})"
    diskdevname=${diskdevname:5}
    disk="${disk:26}"
    disktable[${#disktable[@]}]="${disk}"
    tmp=
    diskparttable=
    for entry in "${lsblktable[@]}"; do
    entry=($entry)
    if [[ "${diskdevname}" != "${entry[0]}" ]]; then continue; fi
    devicename=$(echo -n $(echo "${entry[@]}" | cut -d' ' -f3-))
    done
    echo -e "# Script generated by domount at $(date +'%T on %D (MM/DD/YY)') for disk \"${devicename}\"\n" > "${scriptfile}"
    echo '# '$(echo "$smartctlinfo" | grep '^Model Family:') >> "${scriptfile}"
    echo '# '$(echo "$smartctlinfo" | grep '^Device Model:') >> "${scriptfile}"
    echo -e '# '$(echo "$smartctlinfo" | grep '^User Capacity:')"\n" >> "${scriptfile}"
    for part in "${map[@]}"; do
    if [[ "${part:0:$[${#disk}+1]}" != "${disk}-" ]]; then continue; fi
    diskparttable="${diskparttable}${part}\n";
    done
    mapfile -t diskparttable < <(echo -ne "${diskparttable%%\\n}" | sort -n -k1.$[${#disk}+6]n)
    echo -ne "if diskexists ${disk}; then\n\t\n" >> "${scriptfile}"
    for part in "${diskparttable[@]}"; do
    partsplit=($part)
    parttype=
    for line in "${cfdtable[@]}"; do
    line=($line)
    if [[ "X${partsplit[0]:${#disk}+5}X" != "X${line[0]}X" ]]; then continue; fi
    parttype="${line[1]}"
    done
    if [[ "X${parttype}X" = "XX" ]]; then
    echo "$0: error: Cannot parse cfdisk output"
    rm -f "${scriptfile}"
    exit 1
    fi
    echo -ne "\t# Partition: #${partsplit[0]:${#disk}+5} (${parttype}, ${partsplit[3]}" >> "${scriptfile}"
    if [[ "${partsplit[3]}" = "swap" ]]; then
    echo -n " - Skipping" >> "${scriptfile}"
    fi
    echo -n "); Size: " >> "${scriptfile}"
    sizeidx=0
    size=${partsplit[2]}
    while [ $size -gt 0 ]; do
    sizetext="${size}${sizes[$sizeidx]} ${sizetext}"
    size=$(($size/1024))
    ((sizeidx++))
    done
    sizetext=($sizetext)
    for ((i = 0; i < 2; i++)); do
    if [ $i -eq 1 ]; then echo -n ' (' >> "${scriptfile}"; fi
    if [[ "${sizetext[$i]: -1:1}" = "s" ]]; then
    echo -n "${sizetext[$i]:0:-5} bytes" >> "${scriptfile}"
    else
    echo -n "${sizetext[$i]:0:-2} ${sizetext[$i]: -2:2}" >> "${scriptfile}"
    fi
    if [ $i -eq 1 ]; then echo -n ')' >> "${scriptfile}"; fi
    done
    if [[ "X${partsplit[4]}X" != "XX" ]]; then
    echo -n "; Label: \"" >> "${scriptfile}"
    echo $(echo -n "${part}" | cut -d' ' -f5-)"\"" >> "${scriptfile}"
    else
    echo >> "${scriptfile}"
    fi
    if [[ "${partsplit[3]}" != "swap" ]]; then
    echo -e "\tmountpart /dev/disk/by-uuid/${partsplit[1]} \n\t" >> "${scriptfile}"
    else
    echo -e "\t" >> "${scriptfile}"
    fi
    done
    echo "fi" >> "${scriptfile}"
    echo -e "[ok]\nSuccess!\n"
    #echo ---; cat $scriptfile; echo ---
    else
    echo "Script found for disk ID ${disk}"
    fi
    done
    exit
    fi
    trap 'echo; exit' SIGINT
    echo -ne "Using scriptdir \"${scriptdir}\".\nRunning mount..."
    mapfile -t mounttable < <(mount)
    echo -e " [ok]"
    function spin() {
    trap 'echo -e "\e[?25h"' SIGINT SIGQUIT SIGKILL
    echo -ne "\e[?25l"
    if [[ $unicode -eq 1 ]]; then s=$(printf \\u2580\\u259C\\u2590\\u259F\\u2584\\u2599\\u258C\\u259B); m=8; d=0.03; else s='/-\|'; m=4; d=0.07; fi
    ("$@" & pid=$! ; c=1; while ps -c $pid 2>&1>/dev/null; do echo -ne "\e[s${s:c:1} \e[u"; c=$[c+1]; test $c -eq $m && c=0; sleep $d; done)
    echo -ne "\e[?25h"
    trap SIGINT SIGQUIT SIGKILL
    function diskexists {
    disk=/dev/disk/by-id/scsi-SATA_${@}
    if [[ ! -L $disk ]]; then
    echo "(Disk $0 is not installed)"
    else
    echo "[Disk ${1}]"
    fi
    function partop {
    if [[ $mode -eq 1 ]]; then
    while true; do
    echo -n "Unmounting ${1##*/}... "
    if ! mountpoint > /dev/null 2>&1 $2; then
    echo "(Not mounted, or not a mountpoint)"
    break;
    fi
    if [ ! -d $2 ]; then
    echo "error: Not a directory!"
    break
    fi
    cmd="umount $1"
    if [[ ! $testmode ]]; then
    output="$(${cmd} 2>&1)"
    err=$?
    else
    echo "{would run: ${cmd}} "
    fi
    if [[ $err = 0 ]]; then
    if [[ ! $testmode ]]; then echo "[ok]"; fi
    return
    else
    echo -e "\n== umount error =="
    echo -n "${output}"
    echo -e "\n=================\n"
    c=X;
    while [[ ! $c =~ (R|r|P|p|D|d|Q|q) ]]; do read -sn1 -p"[R]etry/Skip [P]artition/Skip [D]isk/[Q]uit? " c; echo $c; done
    echo
    case $c in
    D|d) skipdisk=1; break ;;
    P|p) break ;;
    Q|q) exit ;;
    esac
    fi
    done
    else
    if [[ $skipdisk = 1 ]] && [[ $newdisk = 0 ]]; then return; fi
    err=0
    skipdisk=0
    newdisk=0
    while true; do
    echo -n "${1##*/} -> $2: "
    if mountpoint > /dev/null 2>&1 $2; then
    echo "(already mounted)"
    break;
    fi
    if [[ $testmode == 0 ]]; then echo echo -n "Mounting"; fi
    if [ ! -d $2 ]; then
    echo -n " (creating dir $2"
    cmd="mkdir -p $2 2>&1"
    if [[ ! $testmode ]]; then
    output="$(eval $cmd)"
    err=$?
    else
    echo -n " {would run: $cmd}"
    fi
    echo -n ') '
    fi
    if [[ $err = 0 ]]; then
    if [[ $testmode == 0 ]]; then echo -n '... '; fi
    cmd="mount $@"
    if [[ ! $testmode ]]; then
    output="$(${cmd} 2>&1)"
    err=$?
    else
    echo "{would run: ${cmd}} "
    fi
    else
    echo
    fi
    if [[ $err = 0 ]]; then
    if [[ ! $testmode ]]; then echo "[ok]"; fi
    return
    else
    echo -e "\n== mount error =="
    echo -n "${output}"
    echo -e "\n=================\n"
    c=X;
    while [[ ! $c =~ (R|r|P|p|D|d|Q|q) ]]; do read -sn1 -p"[R]etry/Skip [P]artition/Skip [D]isk/[Q]uit? " c; echo $c; done
    echo
    case $c in
    D|d) skipdisk=1; break ;;
    P|p) break ;;
    Q|q) exit ;;
    esac
    fi
    done
    fi
    if [[ $1 = "u" ]]; then mode=1; else mode=0; fi
    if [[ $1 = "t" ]]; then testmode=1; fi
    scripts=(${scriptdir}/*.mount.sh)
    for ((i = 0; i < ${#scripts[@]}; i++)); do
    newdisk=1
    . ${scripts[$i]}
    if (($i < ${#scripts[@]} - 1)); then echo; fi
    done
    echo -ne "\e[?25h"
    Hopefully someone else finds this helpful. I am aware of udev/automount; that was overkill, since the disks are always installed, and I don't need a system whose focus is on-the-fly detection of newly inserted media of whatever kind.
    -i336
    Last edited by i336 (2011-11-10 04:42:08)

    Thanks. I might use it soon...
    Does it automatically make folders named after the volume labels? And does it handle the conversion of spaces and non-alphanumeric characters to octal codes?
    I could read the script but it would be faster for everyone reading, if you leave the answer as a reply.
    I also think that there should be some major work done on modernizing the fstab, either by replacing it with a better implementation of file system mounting or changing the file structure and adding in better handling of non-alphanumerics. I don't want to have to look up a stupid octal table every time I type in my labels.

  • Adobe Creative Cloud can't signin  is there alternative to downloading these programs?

    I just purchased Adobe Creative Cloud and when went to sign in all it would do is sign me out in which I never got to sign in lol is there alternative way to download this software as I have Photoshop and Lightbloom

    Finally, after- how long? - two months? I have uploaded the new Creative Cloud. Only to find that all the programs have been upgraded from CS6 to CC.
    This ranks as the worst piece of customer-relations I've ever come across. Even though I asked for instructions the Staff member dealing with me got fed-up and just dumped me.
    I kept trying - and today - finally I got it fixed.
    It took 20 minutes to download, at 20Mbps! There were no intermediate instructions, I wasn't told what was happening. Suddenly the Install screen disappeared - the new Creative Cloud didn't open, I had to go find it.
    Adobe - this is not good. I suggest you find the boss of this team and quietly boot them out of the door.

  • Lync Reverse Proxy Alternatives

    When migrating from OCS 2007 to Lync 2010, we balked Microsoft’s recommendation to deploy Forefront Threat Management Gateway (or ISA) just to get the reverse proxy services. 
    TMG is way too expensive and complex for such a limited, simple use case.
    I didn't find much information on what people are using as free alternatives to ISA/TMG, so I decided to post this discussion in case there are others out there who are interested.
    We decided to use Apache 2.2 on Windows Server 2008 R2. 
    Here's how we configured it:
    Read here to understand what features require a reverse proxy, and follow the steps to configure your FQDNs, Network Adapters and (maybe) obtain an SSL Certificate for the reverse proxy. 
    http://technet.microsoft.com/en-us/library/gg398069.aspx
    Download and install the latest stable release of Apache with OpenSSL on your reverse proxy server. 
    http://httpd.apache.org/download.cgi
    We're using the same certificate on the reverse proxy that we use on our front end server (it has the appropriate SANs), so we need to convert it to PEM format for use with Apache:
    Use the Certificates MMC on your front end server to export the certificate and include the private key.
    Transfer the resultant .pfx file to your reverse proxy server.
    Use OpenSSL to convert your .pfx file to PEM:
    openssl pkcs12 -in c:\pathto\yourcert.pfx -out c:\pathto\yourcert.pem –nodes 
    Separate the private key from the certificate using notepad: 
    Open the new .pem file and cut the text from the beginning of the file through the end of the “----END RSA PRIVATE KEY----“ tag. 
    Save that text to a new file named
    yourcert.key. 
    Save
    yourcert.pem, which should now only include the certificate.
    Copy (or move) the certificate and private key to the Apache configuration directory. We like to use: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\ssl
    for storing the certificates.
    Edit httpd.conf (typically in
    C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf) to enable and configure the proxy and SSL features:
    (See  http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
     for more information on each directive)
    Uncomment the following lines, which will enable proxy and SSL:
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule ssl_module modules/mod_ssl.so
    Include conf/extra/httpd-ssl.conf
    Add the following lines to configure reverse proxy behavior:
    #Be a reverse proxy, not a forward proxy
    ProxyRequests Off
    #Accept requests from any client to any URL
    <Proxy *>
    Order Deny,Allow
    Allow from all
    </Proxy>
    #Set the network buffer to improve throughput
    ProxyReceiveBufferSize 4096
    #Configure the Reverse Proxy to forward all requests to your front end server on 4443
    ProxyPass / https://yourfrontend.domain.com:4443/
    ProxyPassReverse / https://yourfrontend.domain.com:4443/
    #Preserve Host Headers for Lync
    ProxyPreserveHost On
    Optionally, configure logging directives, bindings and server name.
    Save and close httpd.conf
    Edit httpd-ssl.conf (typically in conf\extra):
    Configure the session cache:
    Uncomment:
    SSLSessionCache “dbm:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache”
    Comment out:
    SSLSessionCache “shmcb:C:/Program Files (x86)/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)”
    Locate the <VirtualHost _default_:443> tag and configure the following:
    Add the following directive:
    SSLProxyEngine On
    Configure the path to your SSL Certificate saved in step 3-5 above:
    SSLCertificateFile “C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\ssl\yourcert.pem”
    Configure the path to your private key saved in step 3-5 above:
    SSLCertificateKeyFile “C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\extra\ssl\yourcert.key”
    Optionally, configure the SSLCACertificateFile (you can download the appropriate bundle from your CA).
    Optionally, configure logging directives.
    Save and close httpd-ssl.conf
    Restart the Apache2.2 service
    Configure public DNS records and appropriate firewall rules to allow public http/https traffic to the external interface of your reverse proxy, and to allow the internal interface of
    the reverse proxy to talk to the front end Lync server on 8080 and 4443.
    From an external connection, test connectivity through the reverse proxy:
    Test
    https://dialin.company.com (friendly URL for getting dial-in information, if you’re using voice conferencing)
    Test the Lync Web App by setting up an online meeting and following the URL to join the meeting. 
    You can force the use of the web app by appending ?sl= to the end of the meet.company.com link. 
    See this for more information http://blogs.technet.com/b/jenstr/archive/2010/11/30/launching-lync-web-app.aspx
    Hope this information is helpful and saves some of you some money and trouble.
    Please contact me if you need further clarification or see any mistakes in my notes.
    Best regards,
    Kenneth Walden
    Enterprise Systems Supervisor
    GSD&M
    Austin, TX

    I'd like to thank you for this article.  We were setting up Apache RP for Lync .... needless to say they weren't too excited to learn this new (and highly complex with lots of specific undocumented requirements) Microsoft product.  Anyways, your
    blog saved me a LOT of headache.  I owe you big time. 
    AWESOME JOB. 
    -Greg
    *****EDIT***
    Decided to come back in there and post good information.  We had issues with EXTERNAL and ANONYMOUS users being able to attend a meeting.  The "DIALUP" url was working fine but the "MEETING" url was broken.  On our WFE servers we were getting
    the event error as below.   Turns out that our reverse proxy was not set to "PROXYPRESERVEHOST ON".  Once we put that in there ALL was good.
    Notice that the MEET portion was the only thing that was really broken.  So, if you can get DIALUP to work, but MEET doesn't ... your RP is working to FW the 443 to the 4443 correctly but you're RP is sending the wrong HEADER.  Look for
    http://10.x.x.x/meet/ or soemthing in the event logs. 
    Log Name:      Application
    Source:        ASP.NET 2.0.50727.0
    Date:          11/16/2011 1:26:35 PM
    Event ID:      1309
    Task Category: Web Event
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      OneofMyInternalWFEservers.local
    Description:
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 11/16/2011 1:26:35 PM
    Event time (UTC): 11/16/2011 6:26:35 PM
    Event ID: b2039ecd0a62482284030f62e1e639d8
    Event sequence: 129
    Event occurrence: 28
    Event detail code: 0
    Application information:
        Application domain: /LM/W3SVC/34578/ROOT/meet-1-129658725547585993
        Trust level: Full
        Application Virtual Path: /meet
        Application Path: C:\Program Files\Microsoft Lync Server 2010\Web Components\Join Launcher\Ext\
        Machine name: MYWFE.local
    Process information:
        Process ID: 14204
        Process name: w3wp.exe
        Account name: NT AUTHORITY\NETWORK SERVICE
    Exception information:
        Exception type: HttpException
        Exception message: Server cannot append header after HTTP headers have been sent. 
    Request information:
        Request URL:
    https://FQDN:4443/meet/MyName/456456
        User host address: gatewayIP
        User: 
        Is authenticated: False
        Authentication Type: 
        Thread account name: NT AUTHORITY\NETWORK SERVICE
    Thread information:
        Thread ID: 7
        Thread account name: NT AUTHORITY\NETWORK SERVICE
        Is impersonating: False
        Stack trace:    at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)
       at Microsoft.Rtc.Internal.WebServicesAuthFramework.OCSAuthModule.EndRequest(Object source, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    Custom event details:
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="ASP.NET 2.0.50727.0" />
        <EventID Qualifiers="32768">1309</EventID>
        <Level>3</Level>
        <Task>3</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2011-11-16T18:26:35.000000000Z" />
        <EventRecordID>4483</EventRecordID>
        <Channel>Application</Channel>
        <Computer>XXXXXXXXXXXXXXXXXX</Computer>
        <Security />
      </System>
      <EventData>
        <Data>3005</Data>
        <Data>An unhandled exception has occurred.</Data>
        <Data>11/16/2011 1:26:35 PM</Data>
        <Data>11/16/2011 6:26:35 PM</Data>
        <Data>b2039ecd0a62482284030f62e1e639d8</Data>
        <Data>129</Data>
        <Data>28</Data>
        <Data>0</Data>
        <Data>/LM/W3SVC/34578/ROOT/meet-1-129658725547585993</Data>
        <Data>Full</Data>
        <Data>/meet</Data>
        <Data>C:\Program Files\Microsoft Lync Server 2010\Web Components\Join Launcher\Ext\</Data>
        <Data>SNKXS300</Data>
        <Data>
        </Data>
        <Data>14204</Data>
        <Data>w3wp.exe</Data>
        <Data>NT AUTHORITY\NETWORK SERVICE</Data>
        <Data>HttpException</Data>
        <Data>Server cannot append header after HTTP headers have been sent.</Data>
        <Data>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Data>
        <Data>/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Data>
        <Data>10.71.1.1</Data>
        <Data>
        </Data>
        <Data>False</Data>
        <Data>
        </Data>
        <Data>NT AUTHORITY\NETWORK SERVICE</Data>
        <Data>7</Data>
        <Data>NT AUTHORITY\NETWORK SERVICE</Data>
        <Data>False</Data>
        <Data>   at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)
       at Microsoft.Rtc.Internal.WebServicesAuthFramework.OCSAuthModule.EndRequest(Object source, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
    </Data>
      </EventData>
    </Event>

  • What is a quick alternative to launching an enterprise DPS app if Apple Store rejects the App? We are under a major deadline and can't wait for Apple. We want to host the app elsewhere. How do we host our DPS app on our client's website?

    What is a quick alternative to launching an enterprise DPS app if Apple Store rejects the App? We are under a major deadline and can't wait for Apple to approve. We want to host the app elsewhere. How do we host our DPS app on our client's website? Thanks.

    Unless I misunderstand the question, you can't do what you're asking to do. Apple doesn't allow you to bypass their store and host public apps on a website. The exception is an enterprise app, which requires an Enterprise account with both Apple and Adobe. This type of enterprise app can be distributed only within the company. If that's what you want to do, you can learn more here:
    Digital Publishing Suite Help | Creating viewer apps for private distribution
    Distributing enterprise iOS viewer applications with Digital Publishing Suite | Adobe Developer Connection
    Another option is to add the development app to several devices and use those for your demo.

  • What is the use of Alternative Calculation Type =2 and 4

    Dear Friends
    In pricing procedure in gross value, Net value for Item and Net value has Alternative calucation type is 2.
    What is the use of it?
    Without using it these value line are also fetching net value then what is the work of it. Please give me detail information with its effects in pricing condition tab page in sales document.
    Thanking You
    Arun

    Arun biswal,
    Correct Biswal. We have at varoius stages within Pricing procedure the "net value" which is calculated. Not only the alternative calculation type "2" is used if you notice carefully they are stored as subtotals at various levels.
    For Ex Gross Value  --> Subtotal =1 --> Calc type = 2
    similarly for Net value for Item --> Subtotal =2 --> Calc type = 2
    Net value 2 --> Subtotal =3 --> Calc type = 2
    See, these are used to calculate the net value at various levels in pricing. The calculation Type has got a set of routines that will facilitate us in pricing. SAP has provided certain clauclated formulas or routines to facilitate us during calculation within pricing . Here the "2" is used for calculation without tax and store it as subtotal and display it or use it for further calculations.
    We can use this "netvalue" amount for further calculations. It is used for clarity purpose when you issue a statement to customer. (like Confirmation order) at various levels like discount amt involved, Freight involved, Rebate amount invloved.....
    Even without this Calc type or using sub total u can proceed....
    Finally we have  TOTAL  --> Subtotal =A --> Calc type = 4
    In the above line we have Calc type as 4, which means when you use TAX this calc type is used .
    Routines are used to facilitate your process....
    Regards
    Sathya

  • Like we have If Not Exists in T-SQL, Is there any alternative in MDX

    Hi All,
    I am a newbie in MDX. I am trying to execute MDX query through SSIS Execute SQL Task. I have set Single Row as a result set. Every thing is fine, But the problem arise when the query does not return any result.
    Because , this is the property of Execute SQL Task that it fails , If result set is SET and query does not return any value.
    This occurance is handle in T-SQL by used of If Not Exits/If Exists , Do we have something over here i.e. MDX ?
    If not then what might be the alternative for this.

    Hi Shadab,
    Try writing iif() (if and only if) to handle this situation.
    Check this for syntax and examples:
    http://msdn.microsoft.com/en-IN/library/ms145994(v=sql.105).aspx
    If you have any issues please let me know.
    Please vote as helpful or mark as answer, if it helps Regards, Anand

  • Stuck Threads on weblogic 10.3.2 Holding lock HttpURLConnection

    We are having issue with STUCK THREADS on weblogic 10.3.2. Basically my application makes a lot of web service calls over HTTPS and once in a while I see few STUCK THREADS and most of the time they clear but sometimes I have to bounce my server to clean.
    I have a thread dump, according to this its holding lock at weblogic.net.http.HttpURLConnection.getInputStream
    Any help to resolve this problem is highly appreciated.
    ThreadDump:
    <May 24, 2011 9:59:08 AM EDT> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "604" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@b607d75", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    Thread-75 "[STUCK] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'" <alive, in native, suspended, priority=1, DAEMON> {
    jrockit.net.SocketNativeIO.readBytesPinned(SocketNativeIO.java:???)
    jrockit.net.SocketNativeIO.socketRead(SocketNativeIO.java:31)
    java.net.SocketInputStream.socketRead0(SocketInputStream.java:???)
    java.net.SocketInputStream.read(SocketInputStream.java:107)
    weblogic.utils.io.ChunkedInputStream.read(ChunkedInputStream.java:149)
    java.io.InputStream.read(InputStream.java:85)
    com.certicom.tls.record.ReadHandler.readFragment(Unknown Source)
    com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
    com.certicom.tls.record.ReadHandler.read(Unknown Source)
    ^-- Holding lock: com.certicom.tls.record.ReadHandler@bec563c[thin lock]
    com.certicom.io.InputSSLIOStreamWrapper.read(Unknown Source)
    java.io.BufferedInputStream.fill(BufferedInputStream.java:189)
    java.io.BufferedInputStream.read(BufferedInputStream.java:236)
    ^-- Holding lock: java.io.BufferedInputStream@bec5d9f[thin lock]
    weblogic.net.http.MessageHeader.isHTTP(MessageHeader.java:214)
    weblogic.net.http.MessageHeader.parseHeader(MessageHeader.java:141)
    weblogic.net.http.HttpClient.parseHTTP(HttpClient.java:452)
    ^-- Holding lock: weblogic.net.http.HttpsClient@bec5202[thin lock]
    weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:328)
    weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
    ^-- Holding lock: weblogic.net.http.SOAPHttpsURLConnection@bd3b209[thin lock]
    weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:939)
    com.sun.xml.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:213)
    com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:116)
    com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:101)
    com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:580)
    com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:553)
    com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:535)
    com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:433)
    ^-- Holding lock: com.sun.xml.ws.api.pipe.Fiber@bd3afa8[thin lock]
    com.sun.xml.ws.client.Stub.process(Stub.java:238)
    com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
    com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:102)
    com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
    com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:116)
    $Proxy107.jobSubmit(Unknown Source)
    com.somejob.invokeService(JobOperation.java:53)
    com.somejobws.operations.ticket.execute(ticket.java:30)
    com.somejobutil.Somehelper.process(Somehelper.java:174)
    com.somejobutil.Somehelper.processJob(Somehelper.java:147)
    com.somejobutil.Somehelper.processMDB(Somehelper.java:91)
    com.somejobejb.ProcessMDB.onMessage(ProcessMDB.java:28)
    sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:575)
    com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:102)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:86)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:102)
    com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:151)
    $Proxy67.onMessage(Unknown Source)
    weblogic.ejb.container.internal.MDListener.execute(MDListener.java:403)
    weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:352)
    weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:264)
    weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4564)
    weblogic.jms.client.JMSSession.execute(JMSSession.java:4060)
    weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3746)
    weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5096)
    weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:165)
    }

    Yes, we have the same problem, stuck thread on weblogic.net.http.HttpsURLConnection.getResponseCode() (actually implemented by weblogic.net.http.SOAPHttpsURLConnection which also appears to be deprecated ???)
    When we use the class javax.net.ssl.HttpsURLConnection the getResponseCode() method works perfectly well, so it looks like the weblogic implementation is to blame.
    This is becoming rather urgent now because we're looking to migrate from OC4J to Weblogic and this issue has therefore become a blocker.

Maybe you are looking for

  • BEx hierarchies not displayed in Crystal report parameters

    Hi All, I am trying to using a Bex query that has a cost center hierarchy with a variable that allows users to select specific nodes or even cost centers. In BEx reports, this query works fine and gives the users the view of the cost centres in a hie

  • Error during OLAP AW UPDATE

    Hi, I am using AWM 11.1.0.7.0B and the DB 11.1.0.7.0 After every one or two days I am getting this error..Whenever I am maintaining the dimention I am getting the following error.... An error has occurred on the server Error class: Express Failure Se

  • Im having trouble installing photoshop CS4.

    i deleted all my adobe products so i could reinstalled photoshop cs4 but now when i try to install photoshop cs4 i get this message and cant get rid of it.. " Steup error " "Setup has encountered an error and cannot continue. Contact Adobe customer s

  • How to make selection parameter gray out, not changeble mode

    Hi Experts,   Selection screen having parameters, I am putting default values in that parametrs. How to make this parameter gray out, not changeable mode. Thanks in advance mahahe. See comments below Edited by: Rob Burbank on Jul 1, 2009 12:43 PM

  • Sound - Change input line to output line

    Hi to everyone I just have a question. It is possible to change the input line to output to have an stereo output? I use pulseaudio. My sound works great. Even when I connect earphones, the audio of my laptop speakers go off. But I have an amplifier