i have applied below CSP policy and changed my GWT version to 2.8.2 after that i am getting below error for PRC call ( to read Database and populate the data in UI and save data to DB) and button click ( front validations , read data from DB ..etc).

48 views
Skip to first unread message

paparao rambuddi

unread,
Mar 27, 2024, 3:23:13 AMMar 27
to GWT Users
i have applied below CSP policy and changed my GWT version to 2.8.2
after that i am getting below error for PRC call ( to read Database and populate the data in UI and save data to DB) and button click ( front validations , read data from DB ..etc).

Error Details :
java.lang.Exception: com.google.gwt.core.client.JavaScriptException: (EvalError) : Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' https://salesiq.zoho.com https://js.zohocdn.com https://static.zohocdn.com https://css.zohocdn.com/salesiq/  'nonce-ByDmqt7tbtEnVEDxmZslig=='".

my current csp policy :
script-src 'self' https://salesiq.zoho.com https://js.zohocdn.com https://static.zohocdn.com https://css.zohocdn.com/salesiq/ 'nonce-ByDmqt7tbtEnVEDxmZslig=='; object-src 'self'; img-src https: 'self' data:

my current code to make RPC call : 

protected AsyncCallback<List<BillToCompany>> getTeamBillToCompaniesByUser()

{

final String methodName = "getTeamBillToCompaniesByUser: ";

GWTLOG.info(methodName + " started");

return new AsyncCallback<List<BillToCompany>>()

{

@Override

public void onFailure(Throwable caught)

{

Exception ex = new Exception(caught);

GWTLOG.info(methodName + "onFailure" + "caught:" + ex);

}

@Override

public void onSuccess(List<BillToCompany> result)

{

GWTLOG.info(methodName + "onSuccess: billingAccnId: " + billingAccnId);

updateBillToListBox(result, true); //boolean onload = true

}

};

}


based on browser console message error is with below code 


  msg = com_google_gwt_logging_client_TextLogFormatter_$format__Lcom_google_gwt_logging_client_TextLogFormatter_2Ljava_util_logging_LogRecord_2Ljava_lang_String_2(this.java_util_logging_Handler_formatter, record);
    val = record.java_util_logging_LogRecord_level.intValue__I();
    val >= (java_util_logging_Level_$clinit__V(),
    $intern_38) ? (window.console.error(msg),
    undefined) : val >= 900 ? (window.console.warn(msg),
   
undefined) : val >= 800 ? (window.console.info(msg),
    undefined) : (window.console.log(msg),
    undefined);
    $JsStackEmulator_stackDepth = JsStackEmulator_stackIndex - 1;

Thomas Broyer

unread,
Mar 28, 2024, 7:48:41 AMMar 28
to GWT Users
Reply all
Reply to author
Forward
0 new messages