Python multipart POST

http://pastebin.isawsome.net/pastebin.php?show=366
I'm trying to get a POST together to upload a local file to the tumblr api (tumblr.com). I keep getting Authorization Failed. I'm thinking it could be the header, or maybe a malformed URL (but that looks ok to me).
Anyways, code is above and below. I can't seem to find much documentation, so I figured I'd give the ol' BBS a shot.
def upvid(self):
password = self.password
email = self.email
BOUNDARY = 'bOn3dkjlDr3Y'
CRLF = '\r\n'
files = '/home/dude/warn.wav'
f=file('/home/dude/warn.wav')
fvalue = f.read()
ctype = mimetypes.guess_type(files)
L = []
L.append('--' + BOUNDARY)
L.append('Content-Disposition: form-data; name="files"; filename="%s"' % (files))
L.append('Content-Type: %s' %(ctype[0]))
L.append('')
L.append(fvalue)
L.append('--' + BOUNDARY + '--')
L.append('')
#body = CRLF.join(L)
body = ''.join(L)
values = {
'data' : body,
'type' : 'audio',
'password' : self.password,
'email' : self.email
values=urllib.urlencode(values)
content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
h = httplib.HTTPConnection(self.url)
headers = {'Content-Type': content_type }
h.follow_all_redirects = True
h.request('POST', '/api/write', values, headers)
print values
res = h.getresponse()
print res.status, res.reason, res.read()

the code seems fine at a quick glance,
i checked using a web browser(GET) and it returns the same thing regardless of what input or lack thereof
i'm going to guess this is a problem with tumblr

Similar Messages

  • HTTPS using a Multipart Post

    I have been given a new requirement to send a zipped file(s) to a client using HTTPS using a Multipart Post.
    I have found an example...
    DECLARE
      req   utl_http.req;
      resp  utl_http.resp;
      value VARCHAR2(1024);
    BEGIN
      req := utl_http.begin_request('http://www.psoug.org');
      resp := utl_http.get_response(req);
      LOOP
        utl_http.read_line(resp, value, TRUE);
        dbms_output.put_line(value);
      END LOOP;
      utl_http.end_response(resp);
    EXCEPTION
      WHEN utl_http.end_of_body THEN
        utl_http.end_response(resp);
    END;Which obviously returns and displays the HTML content of the URL, however we need to post zipped files in the content. We have been told by someone at Oracle that we can use the UTL_HTTP package to do this but when i search for this all i find is Java.
    Can anyone point me in the right direction as to where to start and any code examples would be a great help, i tried posting this in the SQL / PLSQL forum but with no success..
    Thanks in advance
    Graham.

    Hi:
    This is tricky one and I have to say that there is not a lot around about it.
    The example you have shown is for UTL_HTTP and while you are on the right track, you want HTTPS and that requires, in addition to what you, the use of the Oracle Wallet. The wallet has to be setup on your machine and referenced in your code. Additionally, you need to be quite clear about the data that is being expected by the remote system to which you are sending the POST request.
    Here is a code example that I have tried to explain a bit for you. Obviously my code is doing something quite different from what you require but the methodology will be similar:
    +++++++++++++++++++++++
    create or replace
    PROCEDURE ABS_MSG_API
    (cab IN VARCHAR2,
    booking_ref IN NUMBER)
    AS
    l_cab VARCHAR2(10);
    l_booking_ref NUMBER;
    l_uuid VARCHAR2(50);
    l_answer integer;
    req utl_http.req;
    resp utl_http.resp;
    value clob;
    listing VARCHAR2(400);
    BEGIN
    l_cab := cab;
    l_booking_ref := booking_ref;
    listing := 'https://........<site address>;
    /* next you must identify the location of your wallet */
    utl_http.set_wallet('file:C:\Documents and Settings\administrator\ORACLE\WALLETS','redy2go4it');
    utl_http.set_transfer_timeout(60);
    dbms_output.put_line(listing);
    /* next we start the request. Though a GET here, a POST is the same thing */
    req := utl_http.begin_request(listing,'GET','HTTP/1.1');
    /* in my case a username and password are passed - think of this at your POST parameters */
    utl_http.set_header(req,'Username',xxxx);
    utl_http.set_header(req,'Password',xxxxx);
    utl_http.set_header(req,'Version','99.99.99');
    /* the rest is much like your code already, with some debug capability */
    resp := utl_http.get_response(req);
    DBMS_OUTPUT.PUT_LINE('Request Method....'||req.METHOD);
    DBMS_OUTPUT.PUT_LINE('HTTP Response Status Code: ' || resp.status_code);
    DBMS_OUTPUT.PUT_LINE('HTTP Response Reason Phrase: ' || resp.reason_phrase);
    DBMS_OUTPUT.PUT_LINE('HTTP Response Version: ' || resp.http_version);
    LOOP
    utl_http.read_line(resp, value, TRUE);
    l_answer := instr(value,'uuid',1,1);
    IF l_answer > 0 THEN
    l_uuid := substr(value,l_answer+6,36);
    dbms_output.put_line('The string is.....'||l_uuid);
    END IF;
    IF l_answer > 0 THEN
    send_dt_message(l_uuid,l_cab,l_booking_ref);
    EXIT;
    END IF;
    END LOOP;
    utl_http.end_response(resp);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    l_answer := instr(value,'uuid',1,1);
    dbms_output.put_line('The value is......'||l_answer);
    END ABS_MSG_API;
    When you submit a POST, all of the parameters are passed as part of the header. You must determine exactly the information being expected by the remote system.
    You can find further information is you search for HTTPS on Ask Tom. There is some useful stuff there.
    I use UTL_HTTP for HTTPS requrests all the time. As I said, it is a bit tricky at first, but the key is the Oracle Wallet and then reading the UTL_HTTP documentation that comes on your DB media disc under PLSQL Packaged Procedures.
    I hope this helps.
    Bruce Clark

  • HTTP Multipart Post

    I have been given a new requirement to send a zipped file(s) to a client using HTTPS using a Multipart Post.
    I have found an example...
    DECLARE
      req   utl_http.req;
      resp  utl_http.resp;
      value VARCHAR2(1024);
    BEGIN
      req := utl_http.begin_request('http://www.psoug.org');
      resp := utl_http.get_response(req);
      LOOP
        utl_http.read_line(resp, value, TRUE);
        dbms_output.put_line(value);
      END LOOP;
      utl_http.end_response(resp);
    EXCEPTION
      WHEN utl_http.end_of_body THEN
        utl_http.end_response(resp);
    END;Which obviously returns and displays the HTML content of the URL, however we need to post zipped files in the content. We have been told by someone at Oracle that we can use the UTL_HTTP package to do this but when i search for this all i find is Java.
    Can anyone point me in the right direction as to where to start and any code examples would be a great help.
    Thanks in advance
    Graham.

    I have been given a new requirement to send a zipped file(s) to a client using HTTPS using a Multipart Post.
    I have found an example...
    DECLARE
      req   utl_http.req;
      resp  utl_http.resp;
      value VARCHAR2(1024);
    BEGIN
      req := utl_http.begin_request('http://www.psoug.org');
      resp := utl_http.get_response(req);
      LOOP
        utl_http.read_line(resp, value, TRUE);
        dbms_output.put_line(value);
      END LOOP;
      utl_http.end_response(resp);
    EXCEPTION
      WHEN utl_http.end_of_body THEN
        utl_http.end_response(resp);
    END;Which obviously returns and displays the HTML content of the URL, however we need to post zipped files in the content. We have been told by someone at Oracle that we can use the UTL_HTTP package to do this but when i search for this all i find is Java.
    Can anyone point me in the right direction as to where to start and any code examples would be a great help.
    Thanks in advance
    Graham.

  • POST/multipart-POST

    Hi,
    I've been looking at various APIs for sending HTTP POST functions, in particular I'm interested in the different uses between the above 2 methods. The typical line is "if you're sending a file - use multipart".
    Why, do POST methods have a certain maximum size?
    Or, what's the point when I should use POST or multipart-POST?
    Is it typical to just use multipart-POST everywhere?
    Is the trade-off just more overhead?
    Any help on this would be appreciated.

    This is really an HTTP question, not a Java question.

  • Does anyone know anything about servlets and multipart posting?

    im not getting much response on the servlet forum :(
    http://forum.java.sun.com/thread.jspa?threadID=701292&tstart=0
    (i'll link back to here too)

    I have a QR reader on my iphone. Works just brill. I've used it to create business cards, with a boat load more information on it (Including my duty times, etc)
    Most of the QR readers in the App store are free, so give them a try. You can copy and paste the data just like normal text.
    What application for them did you have in mind?

  • Multipart HTTP Post

    Dear All,
    I need to forward a text file (without any conversion or mapping) to the HTTP receiver adapter and create a HTTP POST to an external server. Now the problem is that the HTTP Post is supposed to be a multipart message with 3 different content-types, content-lengths and all of them have to be delimited by a "--BOUNDARY" constant.
    I read through a lot of SDN Blogs and HTTP forum post, even setup TCPGATEWAY in order to trace my HTTP output, but just can't come even close to producing this sample HTTP Post:
    "POST /hapld/tos/kdwhapltos HTTP/1.1
    Host: www.xxx.com
    Content-type: multipart/mixed; boundary=BOUNDARY
    Content-length: 1040
    --BOUNDARY
    Content-type: application/x-www-form-urlencoded
    Content-length: 140
    AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-xxx-pld&VersionNumber=
    V4R1&UserId=useridvalue&Password=passwordvalue
    --BOUNDARY
    Content-type: application/x-xxx-binary
    Content-length: 719
    020082 2.0 2002101700000000000010500 000000001*AA0A1754 US
    1234567002000001*BA1z1234560100002352 00001+0000000000000010 +000
    0000000000000LBS01PRE10 3INUSD000001*CA18ATTENTION
    DELIVERY 234 SOME LOCAL ST SO
    ME CITY NJ 07652 US12015551212 *PA1z1234560100002352
    02+0000010 +0000010
    *SA000004
    BOUNDARY"
    1. Is it even possible to produce that kind of multipart post, using the HTTP adapter with it's header filed, prolog or epilog possibilities? How to insert a "new line" within the prolog string for example?
    2. Can anyone who was required to develop a similar complex HTTP post, please provide his solution or any useful tips and links. I've read the SAP Help sites...
    Thanks in advance!
    Michael

    Hi again,
    I am using the file adapter and a virtual Inbound Interface and namespace, so that I don't need to define any object within the Repository, but in order to use the java mapping, I need to create an interface-mapping. The interface mapping requires an inbound and outbound interface though.
    What I want to achive is polling a text file from a local network folder via the file adapter and forwarding this file without any conversion as an HTTP Post to an external HTTP service. As this receiver service requires a multipart HTTP message, I'm forced to figure out another way to foward the original payload, but modify the HTTP buildup. 
    Regards
    Michael

  • Creating a cfhttp multi part form post for google docs upload

    Hey all,
    If you saw my last thread, you know I am working with google docs and uploading documents to it. Well I got basic document uploading working, but now I am trying to include meta data. Google requires you to include the metadata with the actual file data and seperate them by using a multi part form upload. I don't know exactly the process for doing so, but they have a handy code snippet of the desired results at
    http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDoc s
    So I am basically trying to mimic that payload, however I am continually getting an error stating that there are no parts in a multi part form upload.
    <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>No parts detected in multipart message</internalReason></error></errors>
    to be exact. I am not really sure what I am doing wrong here. I figure it is one of two things, either I am not including the actual data in the payload properly (I am currently using a body type param for the payload, but I have also tried a formfield named content to deliver it. Neither worked). So maybe I need to do something else tricky there? The other thing which I am not reallly sure about is the content-length attribute. I don't know exactly how to calculate that, and I read in another forum that a content length attribute was messing that guy up. Right now I am just taking the lenght of the payload string and multiplying by 8 (to get the number of bytes for the entire payload) but hell if I know if that is right. It could be I just don't know how to set up the parts for the message, it seems pretty straight forward though. Just define a boundary in the content-type, then put two dashes before it wherever you define a new part, and two dashes trailing the last part.
    Anyway, here is my code, any help is much appreciate. I'm a bit beyond my expertise here (not really used to trying to have to roll my own http requests, nevermind multipart post form data) so I'm kinda flailing around. Thanks again.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="filePath" type="string" required="false" hint="file to upload.">
        <cfargument name="docType" type="string" required="yes" hint="The document type to identify this document see google list api supported documents">
        <cfargument name="parentCollectionId" type="string" required="no" hint="the name of the collection/collection to create (include collection%3A)">
        <cfargument name="metaData" type="struct" required="no" hint="structure containing meta data. Keyname is attribute name, value is the value">
        <cfset var result = structnew()>
        <cfset result.success = true>
        <cftry>
            <cfif structkeyexists(arguments,"parentCollectionId")>
                      <cfset arguments.parentCollectionId = urlencodedformat(parentCollectionId)>             
                      <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/#arguments.parentCollectionId#/contents">
                <cfelse>
                        <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/">
            </cfif>
             <cfoutput>
                  <cffile action="read" file="#arguments.filePath#" variable="theFile">
                <cfsavecontent variable="atomXML">
                     Content-Type: application/atom+xml
                    <?xml version='1.0' encoding='UTF-8'?>
                    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
                      <category scheme="http://schemas.google.com/g/2005##kind"
                          term="http://schemas.google.com/docs/2007###arguments.docType#"/>
                        <cfloop collection="#arguments.metaData#" item="key">
                            <#key#>#arguments.metadata[key]#</#key#>
                        </cfloop>
                    </entry>
                    --END_OF_PART
                    Content-Type: text/plain
                    #theFile#
                    --END_OF_PART--
                </cfsavecontent>       
            </cfoutput>      
            <cfset result.postData = atomXML>
            <cfhttp url="#result.theUrl#" method="post" result="httpRequest" charset="utf-8" multipart="yes">
                <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
                <cfhttpparam type="header" name="GData-Version" value="3">
                <cfhttpparam type="header" name="Content-Length" value="#len(trim(atomXML))*8#">           
                <cfhttpparam type="header" name="Content-Type" value="multipart/related; boundary=END_OF_PART">
                <cfhttpparam type="header" name="Slug" value="test file --END_OF_PART">
                <cfhttpparam type="body" name="content" value="#trim(atomXML)#">
            </cfhttp>
            <cftry>
                   <cfset packet = xmlParse(httpRequest.fileContent)>
                <cfif httpRequest.statusCode neq "201 created">
                    <cfthrow message="HTTP Error" detail="#httpRequest.fileContent#" type="HTTP CODE #httpRequest.statusCode#">
                </cfif>
                <cfset result.data.resourceId = packet.entry['gd:resourceId'].xmlText>
                <cfset result.data.feedLink = packet.entry['gd:feedLink'].xmlText>
                <cfset result.data.title = packet.entry.title.xmlText>  
                <cfset result.data.link = packet.entry.title.xmlText>    
                <cfcatch>
                     <cfset result.data = httpRequest>
                </cfcatch>
            </cftry>       
            <cfcatch type="any">
                 <cfset result.error = cfcatch>
                <cfset result.success = false>
            </cfcatch>
        </cftry>   
        <cfreturn result>
    </cffunction>
    Also, this is what my atomXML data ended up looking like when it got sent to google. This isn't the WHOLE request (it doesn't include the headers, just the body).
    Content-Type: application/atom+xml
    <?xml version='1.0' encoding='UTF-8'?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/>
    <TITLE>Woot Test</TITLE> </entry>
    --END_OF_PART
    Content-Type: text/plain
    I'm a test document lol!
    --END_OF_PART--

    Woot, I got it. I had to send the gData version number, and change the URL.
    Here is the working function.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="myFile" type="string" required="false" hint="file to upload.">
        <cfset var result = "">
        <cfset theUrl = "https://docs.google.com/feeds/default/private/full">
        <cffile action="read" file="C:\website\xerointeractive\testing\test.txt" variable="theFile">
        <cfset fileSize = createObject("java","java.io.File").init("C:\website\xerointeractive\testing\test.txt").length()>
        <cfhttp url="#theURL#" method="post" result="result" charset="utf-8" >
            <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
            <cfhttpparam type="header" name="Content-Type" value="text/plain">
            <cfhttpparam type="header" name="Slug" value="test file">
            <cfhttpparam type="header" name="GData-Version" value="3">
            <cfhttpparam type="header" name="Content-Length" value="#fileSize#">
            <cfhttpparam type="body" value="#theFile#">
        </cfhttp>
        <cfreturn result>
    </cffunction>

  • Python closes on open

    Lemme preface this post by saying the following - I've taken my computer to the local IT office on RIT campus, asked a Computer Science professor specializing in Python, and posted my question on answers.yahoo.com (I don't know why I expected that to work...). I've also googled my problem multiple times and have not come up with anything newer than about 4 years ago. Also I'm positive this is an issue with my computer because I have copied and pasted python 2.7, as well as EVERY corresponding framework to my iMac from my laptop which is running it perfectly.
    Okay, so the problem. I tried to install Python 2.7 about two months ago on both my laptop and iMac. Both are running up-to-date Mac OS X
    10.6, with 64-bit processors and around 2.4GHz speed and 2G of RAM. My laptop installed python 2.7 and ran it perfectly, first time. My desktop... not so much.
    How to recreate the issue on iMac - try to open IDLE, or in terminal, type the following:
    python
    import turtle
    turtle.up()
    This is what's displayed in terminal:
    COMPUTERNAME:~ USER$ python
    Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import turtle
    >>> turtle.up()
    CGColor with 1 components
    Abort trap
    COMPUTERNAME:~ USER$
    It also pops up a Problem Report for Python:
    Python quit unexpectedly.
    Click Reopen to open the application again. This report will be sent
    to Apple automatically.
    Problem Details and System Configuration
    Process:         Python [33535]
    Path:            /Library/Frameworks/Python.framework/Versions/2.7/
    Resources/Python.app/Contents/MacOS/Python
    Identifier:      org.python.python
    Version:         2.7.2 (2.7.2)
    Code Type:       X86-64 (Native)
    Parent Process:  bash [33532]
    Date/Time:       2011-11-10 17:31:58.424 -0500
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          1141508 sec
    Crashes Since Last Report:           2
    Per-App Interval Since Last Report:  2 sec
    Per-App Crashes Since Last Report:   2
    Anonymous UUID:                      C667A2E4-5530-4A3E-B6E3-
    B38E970458E5
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Application Specific Information:
    abort() called
    Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
    0   libSystem.B.dylib                   0x00007fff89bd40b6 __kill + 10
    1   libSystem.B.dylib                   0x00007fff89c749f6 abort + 83
    2   Tcl                                 0x000000010067f9ef Tcl_Panic + 0
    3   Tcl                                 0x000000010067fa91 Tcl_Panic + 162
    4   Tk                                  0x00000001010ac5a7 TkpGetColor +
    383
    5   Tk                                  0x00000001010b9a2a TkpMenuInit +
    156
    6   Tk                                  0x000000010103c36c TkMenuInit + 88
    7   Tk                                  0x00000001010bc68b -
    [TKApplication(TKMenus) _setupMenus] + 53
    8   Tk                                  0x00000001010b6d27 -
    [TKApplication(TKInit) _setup:] + 56
    9   Tk                                  0x00000001010b7260 TkpInit + 545
    10  Tk                                  0x000000010102da26 Initialize +
    1678
    11  _tkinter.so                         0x00000001005fccfb Tcl_AppInit + 75
    12  _tkinter.so                         0x00000001005fa153 Tkinter_Create +
    915
    13  org.python.python                   0x00000001000c102d
    PyEval_EvalFrameEx + 22397
    14  org.python.python                   0x00000001000c2d29
    PyEval_EvalCodeEx + 2137
    15  org.python.python                   0x000000010003da80 function_call +
    176
    16  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    17  org.python.python                   0x000000010001ebcb
    instancemethod_call + 363
    18  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    19  org.python.python                   0x00000001000be5f3
    PyEval_EvalFrameEx + 11587
    20  org.python.python                   0x00000001000c2d29
    PyEval_EvalCodeEx + 2137
    21  org.python.python                   0x000000010003da80 function_call +
    176
    22  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    23  org.python.python                   0x000000010001ebcb
    instancemethod_call + 363
    24  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    25  org.python.python                   0x00000001000ba5f7
    PyEval_CallObjectWithKeywords + 87
    26  org.python.python                   0x0000000100021e5e PyInstance_New +
    126
    27  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    28  org.python.python                   0x00000001000be5f3
    PyEval_EvalFrameEx + 11587
    29  org.python.python                   0x00000001000c2d29
    PyEval_EvalCodeEx + 2137
    30  org.python.python                   0x000000010003da80 function_call +
    176
    31  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    32  org.python.python                   0x000000010001ebcb
    instancemethod_call + 363
    33  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    34  org.python.python                   0x0000000100077a68 slot_tp_init +
    88
    35  org.python.python                   0x0000000100074e65 type_call + 245
    36  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    37  org.python.python                   0x00000001000be5f3
    PyEval_EvalFrameEx + 11587
    38  org.python.python                   0x00000001000c1ebe
    PyEval_EvalFrameEx + 26126
    39  org.python.python                   0x00000001000c2d29
    PyEval_EvalCodeEx + 2137
    40  org.python.python                   0x000000010003da80 function_call +
    176
    41  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    42  org.python.python                   0x000000010001ebcb
    instancemethod_call + 363
    43  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    44  org.python.python                   0x0000000100077a68 slot_tp_init +
    88
    45  org.python.python                   0x0000000100074e65 type_call + 245
    46  org.python.python                   0x000000010000c5e2 PyObject_Call +
    98
    47  org.python.python                   0x00000001000be5f3
    PyEval_EvalFrameEx + 11587
    48  org.python.python                   0x00000001000c1ebe
    PyEval_EvalFrameEx + 26126
    49  org.python.python                   0x00000001000c1ebe
    PyEval_EvalFrameEx + 26126
    50  org.python.python                   0x00000001000c2d29
    PyEval_EvalCodeEx + 2137
    51  org.python.python                   0x00000001000c2e46 PyEval_EvalCode
    + 54
    52  org.python.python                   0x00000001000e769c
    PyRun_InteractiveOneFlags + 380
    53  org.python.python                   0x00000001000e78fe
    PyRun_InteractiveLoopFlags + 78
    54  org.python.python                   0x00000001000e80e1
    PyRun_AnyFileExFlags + 161
    55  org.python.python                   0x00000001000fe77c Py_Main + 2940
    56  org.python.python                   0x0000000100000f14 0x100000000 +
    3860
    Thread 1:  Dispatch queue: com.apple.libdispatch-manager
    0   libSystem.B.dylib                   0x00007fff89b9ec0a kevent + 10
    1   libSystem.B.dylib                   0x00007fff89ba0add
    _dispatch_mgr_invoke + 154
    2   libSystem.B.dylib                   0x00007fff89ba07b4
    _dispatch_queue_invoke + 185
    3   libSystem.B.dylib                   0x00007fff89ba02de
    _dispatch_worker_thread2 + 252
    4   libSystem.B.dylib                   0x00007fff89b9fc08
    _pthread_wqthread + 353
    5   libSystem.B.dylib                   0x00007fff89b9faa5 start_wqthread +
    13
    Thread 2:
    0   libSystem.B.dylib                   0x00007fff89b9fa2a
    __workq_kernreturn + 10
    1   libSystem.B.dylib                   0x00007fff89b9fe3c
    _pthread_wqthread + 917
    2   libSystem.B.dylib                   0x00007fff89b9faa5 start_wqthread +
    13
    Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x0000000000000000  rbx: 0x00007fff7116b2f8  rcx:
    0x00007fff5fbfc0e8  rdx: 0x0000000000000000
    rdi: 0x00000000000082ff  rsi: 0x0000000000000006  rbp:
    0x00007fff5fbfc100  rsp: 0x00007fff5fbfc0e8
      r8: 0x00007fff7116ea60   r9: 0x0000000000000000  r10:
    0x00007fff89bd00fa  r11: 0x0000000000000206
    r12: 0x00000001006ecb20  r13: 0x0000000000000001  r14:
    0x00000001010e1f77  r15: 0x0000000000000000
    rip: 0x00007fff89bd40b6  rfl: 0x0000000000000206  cr2:
    0x00000001135b54f3
    Model: iMac7,1, BootROM IM71.007A.B03, 2 processors, Intel Core 2 Duo,
    2.4 GHz, 4 GB, SMC 1.20f4
    Graphics: ATI Radeon HD 2600 Pro, ATI,RadeonHD2600, PCIe, 256 MB
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x88),
    Broadcom BCM43xx 1.0 (5.10.131.42.4)
    Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial
    ports
    Network Service: Built-in Ethernet, Ethernet, en0
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: WDC WD3200AAJS-40RYA0, 298.09 GB
    Parallel ATA Device: OPTIARC  DVD RW AD-5630A, 406.7 MB
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8502,
    0xfd400000 / 2
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.),
    0x8206, 0x1a100000 / 2
    USB Device: Razer Naga, 0x1532, 0x0015, 0x1d100000 / 2
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0x5d100000 / 2
    I have tried copying every framework possible from the laptop to the iMac, done several reinstalls, and pretty much everything else I and the IT people on campus could think of to no avail. I've called Apple and even suggested paying for help to be told that there's nothing they can do to assist because it's not their software... I pointed out that it comes installed with every mac, and got no support STILL. I asked if he could tell me what my error report meant. His response of course was to try and post it on the development forums... I asked him where to go for help with this issue. He said his SUPERVISOR linked me to devloper.apple.com (not a hint of python there, btw) and python.org (...source of the problem?). I asked to talk to his supervisor and he told me I couldn't, he's on the phone... Yet he just gave him links for me... Suspicious.
    I put this to you guys - help!

    Go to Options > General, and set your home page to "about:newtab" to go to the new tab page on startup.

  • Http post large images

    Hello people ...
    I've been working on this for almost a week
    am trying to post an image and some text with it to my server
    i know that i can post large images to an ASP.NET page .. but now am dealing with apache 2.2.3 and am using multipart post
    I've tested this code using nokia devices and it is working fine
    but on sony ericsoon devices " z520 and z610" it is giving 502 proxy error response ...
    here is the client and server responses ....
    WHAT IS WRONG WITH SONY ERICSSON DEVICES
    any idea what is happening
    here is my code
    InputStream is = null;
            OutputStream os = null;
            DataInputStream dis = null;
            StringBuffer responseMessage = new StringBuffer();      
            StringBuffer b = new StringBuffer();
            HttpConnection c= null;
            try
                String message1 =  "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[id]\"\r\n\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[title]\"\r\n\r\n" +
                        " bahjat\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[discription]\"\r\n\r\n" +
                        "Description\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[username]\"\r\n\r\n" +
                        "Username\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[password]\"\r\n\r\n" +
                        "Password\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[category_id]\"\r\n\r\n" +
                        "1\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[file]\"; filename=\"mobile.jpg\"\r\n" +
                        "Content-Type: image/jpeg\r\n\r\n";
                 String message2 ="-----------------------------2789938726602--"; 
                 byte[] Message1 = message1.getBytes();
                 byte[] Message2 = message2.getBytes();
                 int total_length = Message1.length + Message2.length + postByte.length ;
                c = (HttpConnection) Connector.open(URL, Connector.READ_WRITE);
                c.setRequestMethod(HttpConnection.POST);
                c.setRequestProperty("Host","hq.d1g.com")  ;
                c.setRequestProperty("Accept"," text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
                c.setRequestProperty("Accept-Charset"," ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Confirguration/CLDC-1.0");
                c.setRequestProperty("Accept-Encoding", "gzip, deflate");
                c.setRequestProperty("Accept-Language","en-us,en;q=0.5");
                c.setRequestProperty("Http-version","HTTP/1.1");
                c.setRequestProperty("Content-Type", "multipart/form-data;boundary=---------------------------2789938726602");
                c.setRequestProperty("Content-Length", Integer.toString(total_length) ); 
                c.setRequestProperty("Keep-Alive","300");
                c.setRequestProperty("Connection","Keep-Alive");
                os = c.openOutputStream();  
                os.write(Message1);
                os.write(postByte);
                os.write(Message2);          
                os.close();
                Message1 = null;
                Message2 = null;
               int rc = c.getResponseCode();
               if (rc != HttpConnection.HTTP_OK) {
                    b.append("Response Code: " + c.getResponseCode() + "\n");
                    b.append("Response Message: " + c.getResponseMessage() +
                            "\n\n");        
               Resived_String=b.toString();
               is = c.openInputStream() ;
                // retrieve the response from server
               int ch;
               while( ( ch = is.read() ) != -1 )
                    responseMessage.append( (char)ch );
               String s=responseMessage.toString();
               Resived_String+=s;
            catch (Exception ce) {
                Resived_String=ce.getMessage(); }
            finally {
                if(dis != null)
                    dis.close();
                if (is != null)
                    is.close();
                if (os != null)
                    os.close();
            return Resived_String;here is the headers as i followed them using wireshark
    client
    POST /gallery/post/update HTTP/1.1
    Host: hq.d1g.com
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    User-Agent: Profile/MIDP-2.0 Confirguration/CLDC-1.0
    Accept-Encoding: gzip, deflate
    Accept-Language: en-us,en;q=0.5
    Http-version: HTTP/1.1
    Content-Type: multipart/form-data;boundary=---------------------------2789938726602
    Keep-Alive: 300
    Connection: Keep-Alive
    User-Agent: UNTRUSTED/1.0
    Transfer-Encoding: chunked
    server response
    HTTP/1.1 502 Proxy Error
    Date: Wed, 04 Apr 2007 12:49:40 GMT
    Content-Length: 493
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>502 Proxy Error</title>
    </head><body>
    Proxy Error
    The proxy server received an invalid response from an upstream server.
    The proxy server could not handle the request POST /gallery/post/update.
    Reason: Error reading from remote server
    <hr>
    <address>Apache/2.2.3 (Fedora) Server at hq.d1g.com Port 80</address>
    </body></html>
    and some times i get this response
    404 not found
    so any idea what i can do

    Thank your reply,and I think there are some bad with code,but there is only
    a swc,and I can't analyze the c/c++ code,so I relly don't konw how to solve
    it, Can you provide me some c/c++ code,and I can compile them to Alchemy
    code...
    2009/10/28 zazzo9 <[email protected]>
    It is either a bug with your code or with the library, which may be
    aggravated by a bug in alchemy where it fails to report exhausted memory
    properly.  The library you are using is just a demonstration and may likely
    have bugs.
    >

  • Help in mutlipart post FIle Upload using Apache FileUpload

    Hi there,
    I am using the FileUpload class of Apache and getting an issue when I try to write the multipart post data (file) into a physical disk on the server. I am attaching herewith the servlet code. The error I get when I compile the code is:
    Information: 1 error
    Information: 0 warnings
    Information: Compilation completed with 1 errors and 0 warnings
    C:\unzipped\commons-fileupload-1.0-src\commons-fileupload-1.0\src\java\FileUpload.java
    Error: line (80) write(java.io.File) in org.apache.commons.fileupload.FileItem cannot be applied to (java.lang.String)
    C:/unzipped/commons-fileupload-1.0-src/commons-fileupload-1.0/src/java/FileUpload.java:80: write(java.io.File) in org.apache.commons.fileupload.FileItem cannot be applied to (java.lang.String)
    Any help would be greatly appreciated.
    Thanks
    John

    are you calling the writeFile method trying to pass a String instead of a File object?

  • Error Upload document in portal ........

    Hi :
    We have integrated the portal with Active Directory to make single sign-on, but when trying to attach a document we need insert user and pass and we cant attach documents..
    We make a trace and get this result
    Java Plug-in 1.6.0_03
    Usar versión JRE 1.6.0_03 Java HotSpot(TM) Client VM
    Directorio local del usuario = C:Documents and Settings09811473
    c: borrar ventana de consola
    f: finalizar objetos en la cola de finalización
    g: liberación de recursos
    h: presentar este mensaje de ayuda
    l: volcar lista del cargador de clases
    m: imprimir sintaxis de memoria
    o: activar registro
    p: recargar configuración de proxy
    q: ocultar consola
    r: recargar configuración de norma
    s: volcar propiedades del sistema y de despliegue
    t: volcar lista de subprocesos
    v: volcar pila de subprocesos
    x: borrar antememoria del cargador de clases
    0-5: establecer nivel de rastreo en
    Filehandler - (c) SAP AG, Walldorf - version 0.99.8.6.3.1
    MODE = SCRIPT
    init(): You use JVM of Sun Microsystems Inc.
    JVM Name is Java HotSpot(TM) Client VM
    JVM Version is 1.6.0_03-b05
    This JVM does not know class com.ms.security.PolicyEngine
    Start: Workmode = 3, first start = true
    start(): get Permissions...
    Ping
    doupload(): get Permissions...
    =================
    selectFile...
    addDialog Dialog =
    java.awt.FileDialog[filedlg0,0,0,0x0,invalid,hidden,APPLICATION_MODAL,title=Select
    File for Upload,dir= null,file= null,load]
    selected Dir = P:CONCURSOS 2008CONCURSOS ABIERTOSCONCURSOS
    0885ADHESIVOS COMERCIOSCOMUNICACIONES
    selected File = 080807 MAIL DE SERMEPA_AVISO AG TPTE_ADHESIVOS COMERCIOS.pdf
    open file with path = P:CONCURSOS 2008CONCURSOS ABIERTOSCONCURSOS
    0885ADHESIVOS COMERCIOSCOMUNICACIONES080807 MAIL DE SERMEPA_AVISO AG
    TPTE_ADHESIVOS COMERCIOS.pdf
    selected file can be read = true
    getFilesize() from P:CONCURSOS 2008CONCURSOS ABIERTOSCONCURSOS
    0885ADHESIVOS COMERCIOSCOMUNICACIONES080807 MAIL DE SERMEPA_AVISO AG
    TPTE_ADHESIVOS COMERCIOS.pdf
    getFilesize() returns 25012
    Start upload thread...
    =================
    MMPost: Read from File = P:CONCURSOS 2008CONCURSOS ABIERTOSCONCURSOS
    0885ADHESIVOS COMERCIOSCOMUNICACIONES080807 MAIL DE SERMEPA_AVISO AG
    TPTE_ADHESIVOS COMERCIOS.pdf
    Report (alternative) filepath = P:CONCURSOS 2008CONCURSOS
    ABIERTOSCONCURSOS 0885ADHESIVOS COMERCIOSCOMUNICACIONES080807 MAIL DE
    SERMEPA_AVISO AG TPTE_ADHESIVOS COMERCIOS.pdf
    Report mimetype = application/octet-stream
    filesize on disk = 25012
    Multipart-POST: url =
    http://sapsrmex.lacaja.net:8002/sap/ebp/docserver?attcreate&docid=FAC1EB0228CB514C8F8E7DF4087EE350&sap-client=111&p_filepath=P%3A%5CCONCURSOS+2008%5CCONCURSOS+ABIERTOS%5CCONCURSOS+0885%5CADHESIVOS+COMERCIOS%5CCOMUNICACIONES%5C080807+MAIL+DE+SERMEPA_AVISO+AG+TPTE_ADHESIVOS+COMERCIOS.pdf
    Multipart-POST: total size of request = 25538
    Multipart-POST: message 1 =
    7d22923527020a
    Content-Disposition: form-data; name="thefile"; filename="P:CONCURSOS
    2008CONCURSOS ABIERTOSCONCURSOS 0885ADHESIVOS
    COMERCIOSCOMUNICACIONES080807 MAIL DE SERMEPA_AVISO AG TPTE_ADHESIVOS
    COMERCIOS.pdf"
    Content-Type: application/octet-stream
    Content-Length: 25012
    X-compId: P:CONCURSOS 2008CONCURSOS ABIERTOSCONCURSOS 0885ADHESIVOS
    COMERCIOSCOMUNICACIONES080807 MAIL DE SERMEPA_AVISO AG TPTE_ADHESIVOS
    COMERCIOS.pdf
    Start to write... with msg2... packetsize = 4096
    Multipart-POST: message 2 =
    7d22923527020a--
    Close streams...(flushed after each package)
    Close outputstream....
    Close streams...Outputstream closed. get Input Stream)
    *Exception after Upload java.io.IOException: Server returned HTTP response
    code: 401 for URL:*
    http://sapsrmex.lacaja.net:8002/sap/ebp/docserver?attcreate&docid=FAC1EB0228CB514C8F8E7DF4087EE350&sap-client=111&p_filepath=P%3A%5CCONCURSOS2008%5CCONCURSOSABIERTOS%5CCONCURSOS0885%5CADHESIVOSCOMERCIOS%5CCOMUNICACIONES%5C080807MAILDESERMEPA_AVISOAGTPTE_ADHESIVOSCOMERCIOS.pdf
    Writing finished, cleaning up...
    Write total = 25012
    How can i see version of portal and support packages installed ????
    Somebody can help me , i dont know what happen.
    Thanks in advance......
    Edited by: Avelino Carrizo Pérez on Aug 21, 2008 12:22 PM

    Hi,
    about the portal version etc...login to your portal here:
    http://your_portal_url/sap/monitoring/SystemInfo
    as an Administrator - you can see here all the info.
    Romano

  • Problem with file upload in JDeveloper 10.1.2 version

    Hi,
    My application is running in JDveloper 10.1.2.1 version with BC4J Struts. Now, I want to do a module with file upload. I am getting an error in the uploading section as
    java.lang.NullPointerException
    at oracle.jbo.html.struts11.MultipartUtil.populate(MultipartUtil.java:227)
    at oracle.jbo.html.struts11.BC4JRequestProcessor.processPopulate(BC4JRequestProcessor.java:433)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
    Please suggest me an option to resolve the issue.
    Regards,
    Jobz....

    I remember that there was a bug in the MultipartHandler of the BC4JRequestProcessor in one of the 10.1.2.x version, however I'm nit sure which one. I found the old fix we implemented back then
    Try this request processor and see if this helps:
    package xx.yy.zz.common;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.html.struts11.BC4JActionMapping;
    import org.apache.struts.Globals;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.upload.MultipartRequestHandler;
    import org.apache.struts.upload.MultipartRequestWrapper;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import oracle.jbo.html.HtmlServices;
    import oracle.jbo.html.struts11.BC4JRequestProcessor;
    import oracle.jbo.html.struts11.MultipartUtil;
    * RequestProcessor for Apache Struts based applicartions
    * Fix for a bug in <code>BC4JRequestProcessor</code> Multipart-Requests (e.g. Upload).
    * @projekt common
    public class HvbgBC4JRequestProcessor extends BC4JRequestProcessor {
         * Override to fix a bug. Note that this works only if all ActionMappings in the project
         * are of the type BC4JActionMapping.
         * @see oracle.jbo.html.struts11.BC4JRequestProcessor#processMultipart(HttpServletRequest) processMultipart
        protected HttpServletRequest processMultipart(HttpServletRequest request)
            // Overide only if the action mapping is a BC4JActionMapping.
            BC4JActionMapping mapping = (BC4JActionMapping) request.getAttribute(Globals.MAPPING_KEY);
            if (HtmlServices.isMultipartPost(request)) {
                MultipartRequestHandler handler = MultipartUtil.retrieveMultipartHandler(request);
                if (handler == null) {
                    try {
                        request = MultipartUtil.parseMultipartRequest(request, servlet);
                    catch (ServletException se) {
                        throw new RuntimeException(se.getMessage());
                else {
                    // This is a forward from a Multipart Post upload
                    if (!(request instanceof MultipartRequestWrapper)) {
                        request = new MultipartRequestWrapper(request);
                        MultipartUtil.setWrapperParams(handler, (MultipartRequestWrapper) request);
                    else {
                        // do nothing
            return (request);
    Don't forget to set this new class in your struts-config.xml file!
    Timo

  • Having trouble with a push to phone app?

    If you have ever seen this error messages "The requested URL '/CGI/Execute' was not found on the RomPager server." you are not alone.  I had this problem recently writing a python script to push a simple raw file to a phone and in my searching I have seen postings that were very similar but almost none of them had successful responses.
    One of the main problems here is that the error message is fairly misleading.  The root cause is how your XML needs to be written when being sent to the phone and the content-type header being used.  I stumbled across this when examining a successful request from a simple HTML app and when compared to my unsuccessful python script post.
    You need the content-type header to look like this: 'Content-Type':'application/x-www-form-urlencoded'.
    the next part is the XML message you are pushing needs to look like this or some variation depending on the command needing to be sent: 'XML=<CiscoIPPhoneExecute><ExecuteItem Priority="0" URL="Analog1.raw"/></CiscoIPPhoneExecute>'
    Please let me know if this works for you or if you have run into anything different.  Thanks.

    If the db is huge, you may want to copy it, and delete all but a few hundred rows.
    Then you can play with the copy till you get the query doing what you want.
    You might try changing this section
    "tblQAMonitorTrack"."CSR_ID"="tblCSR"."CSRID") INNER JOIN "SMG_APPS"."dbo"."tblFM_BeginEndDates" "tblFM_BeginEndDates" ON ("tblQAMonitorTrack"."FiscalYear"="tblFM_BeginEndDates"."fiscalyear") AND ("tblQAMonitorTrack"."FW_Month"="tblFM_BeginEndDates"."fiscal_month")) INNER JOIN "SMG_APPS"."dbo"."tblMonitorsPerFM" "tblMonitorsPerFM" ON
    To left outer joins.
    Also, just create a connection to the tblMonitorsPerFM all by itself, run a query and see if you get multiple results directly from the DB...

  • How to set Content-Disposition to "application/json;"

    Using System.Net.Http.Httpclient, I am trying to do a multipart post in C# and with a wp8.
    This is a snippet of my code:
    varclient =
    newHttpClient();
                    client.DefaultRequestHeaders.TryAddWithoutValidation(
    "Content-Type",
    "application/json");
    MultipartFormDataContent
    content = newMultipartFormDataContent();
    content.Add(
    newStringContent(requestObj,
    Encoding.UTF8,
    "application/json"),
    "request");
    but using Fiddler, I noticed that I am sending this:
    Content-Type: application/json; charset=utf-8
    Content-Dis name=request
    while I need to send this (taken from an android device where the call is working):
    Content-Dis name="request"
    Content-Type: text/plain; charset=UTF-8
     - How to achieve the expected result?

    Your code explicitly sets the incorrect content type.  Why are you setting it to "application/json", when you say it requires "text/plain; charset=UTF-8"?
    Bret Bentzinger (MSFT) @awehellyeah

  • HELP IN DATABASE CONNECTIVITY IN A SERVLET`

    HI there,
    I have some issues in an application. I have a servlet which is called Servlet1.class. I have deployed this in my tomcat webapps folder. There is a stand alone application called MailAgent.class which pools into a mail box and retrieves the messages and converts them as HTTP messages. Then the MailAgent.class sends the HTTP message as multipart post (email message) to the servlet. In the servlet I am trying to establish a database connection with the JDBC driver from third party vendor. I am unable to get the driver class when I establish the connection with the database. Is there any issues with servlet and database access. I am able to connect if I run as a stand alone application.
    Any help would be greatly appreciated.
    Thanks
    John

    There shouldn't be any .class file in your webapps folder. I hope you mean that you created a subdirectory under webapps, with a WEB-INF under that and /classes and /lib under that. Your servlet .class file and its package directory structure belong under webapps/yourApp/WEB-INF/classes, right?
    You can create database connections in a servlet, although I agree with the previous poster that you'd be better off putting database code into objects that you could test off-line, without the servlet.
    You've got to have the JDBC driver JARs in the webapps/yourApp/WEB-INF/lib directory, for starters.
    If you get really adventurous you can create a pooled JNDI data source, but maybe that's another day's work. Get the basic connection working first.

Maybe you are looking for