0
votes

My question is relatively the same than the one posted on developerworks forum (forum is read only due to migration) wich is :

I have a http adapter that interfaces with external web services. Part of the payload is audio, and images. We're hitting a form size limit. Please see attached exception at end of this post. I've read on previous posts that jetty configurations need to be adjusted to accommodate the larger payload. We want to control this size limit at the server side application layer, and thought that of creating a jetty-web.xml to define the max form size:

400000

In Worklight is this the proper approach to resolve this issue?

If this is the proper approach can you provide details whether the jetty-web.xml should be placed under server/conf, or does it need to be under WEB-INF of the application war?

If the file needs to be placed under WEB-INF can you explain how to accomplish this file being placed under WEB-INF during the WL project build.

Thanks E: Ajax request exception: Form too large802600>200000 2013-02-06 11:39:48 FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request Form too large802600>200000, User Identity {wl_authenticityRealm=null, GersServiceAdapterRealm=(name:USAEMP4, loginModule:GersServiceAdapterLoginModule), wl_remoteDisableRealm=(name:NullLoginModule, loginModule:NullLoginModule), SampleAppRealm=null, wl_antiXSRFRealm=(name:antiXSRF, loginModule:WLAntiXSRFLoginModule), wl_deviceAutoProvisioningRealm=null, WorklightConsole=null, wl_deviceNoProvisioningRealm=(name:device, loginModule:WLDeviceNoProvisioningLoginModule), myserver=(name:3e857b6a-d2f6-40d1-8c9c-10ca1b96c8df, loginModule:WeakDummy), wl_anonymousUserRealm=(name:3e857b6a-d2f6-40d1-8c9c-10ca1b96c8df, loginModule:WeakDummy)}.

I have exactly the same problem : I send a large amount of data to a worklight adapter and my application fail with the following error message into the log :

2013-08-21 09:48:17] FWLSE0020E: Ajax request exception: Form too large202534>200000
[2013-08-21 09:48:18] FWLSE0117E: Error code: 1, error description: INTERNAL_ERROR, error message: FWLSE0069E: An internal error occurred during gadget request Form too large202534>200000, User Identity {wl_authenticityRealm=null, wl_remoteDisableRealm=(name:null, loginModule:NullLoginModule), SampleAppRealm=null, wl_antiXSRFRealm=(name:b2isf3704k2fl8hovpa6lv9mig, loginModule:WLAntiXSRFLoginModule), wl_deviceAutoProvisioningRealm=null, WorklightConsole=null, wl_deviceNoProvisioningRealm=(name:40a24da9-0a32-464a-8dec-2ab402c683ae, loginModule:WLDeviceNoProvisioningLoginModule), myserver=(name:2b1a7864-37c4-47f0-9f5c-49621b6915b5, loginModule:WeakDummy), wl_anonymousUserRealm=(name:2b1a7864-37c4-47f0-9f5c-49621b6915b5, loginModule:WeakDummy)}.

This occurs on calling an adapter procedure by calling WL.Client.invokeProcedure(...) and before the first line of the called procedure... If I try to log the start of the called procedure I have nothing written in my debug log...

I can give you my source code :

This one is called by a dhtml user event (onclick) :

// Construct the param to pass to the WL adapter insert procedure
var paramObject = {
    QCDART: machine,                    // machine is a javascript variable as long int
    QTITRE: title,                      // title is a javascript variable as string(255)
    QDESC: desc,                        // desc is a javascript variable as string(255)
    QHODAT: todayDateDb2IntFormat,      // todayDateDb2IntFormat is a javascript variable as long int
    QACTIF: active,                     // active is a javascript variable as int
    SSRCFIC: currentPdfFileDataBase64,  // currentPdfFileDataBase64 is a javascript variable as base64 encoded string from a binary file > 150 ko approx.
    SMIMFIC: 'application/pdf',         
    SSIZFIC: currentPdfFileSize         // currentPdfFileSize is a javascript variable as long int
};

// Construct adapter invocation data
var invocationData = {
    adapter : 'IseriesDB2Backend', // adapter name
    procedure : 'addModeleReleves', // procedure name
    parameters : [paramObject] // parameters if any
};

WL.Client.invokeProcedure(invocationData, {
    timeout: 60000,
    onSuccess: function() {
        // Notify success
        alert('OK');
    }, // invokeProcedure success callback
    onFailure: function(invocationResult) {
        alert('ERROR');
    } // invokeProcedure failure callback
});

This one is my adapter source code :

var addModeleReleveStatement = WL.Server.createSQLStatement("select QCDDOC from FINAL TABLE (insert into ERIHACFICH.DOCENTQ (QCDART, QTITRE, QDESC, QHODAT, QACTIF) values (?, ?, ?, ?, ?))");
function addModeleReleves(params) {
    WL.Logger.debug('Starting adapter procedure...');

    var modeleReleveResult =  WL.Server.invokeSQLStatement({
        preparedStatement : addModeleReleveStatement,
        parameters : [params.QCDART, params.QTITRE, params.QDESC, params.QHODAT, params.QACTIF]
    });

    if(modeleReleveResult.isSuccessful) {
        WL.Logger.debug('Success !');
    }

    WL.Logger.debug('Adapter procedure ended !');

    // Return result (with the last id inside)
    return modeleReleveResult;
}

if the javascript varable called currentPdfFileDataBase64 is small, all is working normally but if it exceeds approximatively 200000 chars length it fails...

Last, I ca say that the problem occurs in development environment (WL Studio 5.0.6 + WL Server 5.0.6), I didn't test it on the production environment based on SLES + Websphere application server 7 + worklight.

Thanks for any help

2
Did you try adapters? - rooftop
Yes I use an sql adapter generated by WLStudio wizards - erica

2 Answers

0
votes

I understand you are using the test server provided by Worklight.

It looks like this is a Jetty limitation so you could try any of these:

1) Set the system property org.eclipse.jetty.server.Request.maxFormContentSize to a bigger value (i.e. adding -Dorg.eclipse.jetty.server.Request.maxFormContentSize=25000000) to the end of eclipse.ini before launching Worklight.

or

2) Instead, set this other system property -Dorg.mortbay.jetty.Request.maxFormContentSize=25000000 to the same place.

0
votes

Another way to solve the problem was to use WL Studio version 6 that doesn't use Jetty anymore as test environment