Error in calling APEX_UTIL.SET_SESSION_MAX_IDLE_SECONDS - oracle-apex

I am calling an APEX page from EBS. I have written a code in Before header to set the session values.
lv_profile_value := NVL(xxua_apex_common_pkg.fnd_profile_value
('ICX_SESSION_TIMEOUT'),'0');
:EBS_ICX_SESSION_TIMEOUT := TO_NUMBER(lv_profile_value)*10;
APEX_UTIL.SET_SESSION_MAX_IDLE_SECONDS (p_seconds =>
:EBS_ICX_SESSION_TIMEOUT);
Here the fnd_profile_value for 'ICX_SESION_TIMEOUT' is set to 240.
Now if I use :
:EBS_ICX_SESSION_TIMEOUT := TO_NUMBER(lv_profile_value)*10;
Then I get this error : 'ORA-06502: PL/SQL: numeric or value error: number precision too large'
But If I just write
:EBS_ICX_SESSION_TIMEOUT := TO_NUMBER(lv_profile_value)*9;
Everything works fine. Can somebody please suggest why it gives no error when I multiply by 9(240*9=2160) and gives an error when multiplied by 10 (240*10=2400).
The value gets properly set in my varaible :'EBS_ICX_SESSION_TIMEOUT'
But when APEX_UTIL.SET_SESSION_MAX_IDLE_SECONDS is called it throws this error.
Please suggest.

Related

How to use mod_assign_save_grade?

I'm trying to use mod_assign_save_grade with : https:/[my-root]/webservice/rest/server.php?wstoken=[token]&wsfunction=mod_assign_save_grade&moodlewsrestformat=json&assignmentid=4&userid =45&grade =15&attemptnumber =-1&addattempt =0&workflowstate =graded&applytoall =1
but the output came with
{
"exception": "invalid_parameter_exception",
"errorcode": "invalidparameter",
"message": "Invalid parameter value detected"
}
any ideas to use it correctly
It seems there are blank spaces before = in several places. I copied your request, (of course, with actual server name, token and parameter values), removed blanks and it works correctly. When I insert blank space anywhere, the message that you posted appears.

Assertion Error While Testing the Pipeline Apache Beam

While testing the pipeline I got this error even the error log shows that the objects are equal:
public void testGenerateUserPageViews() throws Exception{
final PCollection<SessionModel> input = p.apply(Create.of(SESSION_MODEL));
final PCollection<UserPageViews> output = input.apply(ParDo.of(new GenerateUserPageViews()));
PAssert.that(output).containsInAnyOrder(USER_PAGEVIEWS);
p.run().waitUntilFinish();
}
java.lang.AssertionError: ParDo(GenerateUserPageViews)/ParMultiDo(GenerateUserPageViews).output:
Expected: iterable over [<com.userprofile.models.UserPageViews#e1688b19>] in any order
but: Not matched: <com.userprofile.models.UserPageViews#e1688b19>
at org.apache.beam.sdk.testing.PAssert$PAssertionSite.capture(PAssert.java:174)
at org.apache.beam.sdk.testing.PAssert.that(PAssert.java:416)
at org.apache.beam.sdk.testing.PAssert.that(PAssert.java:408)
at
I would guess that com.userprofile.models.UserPageViews does not have a fully implemented equals or hashCode method.
The solution is that I replace String variable with "" value in place of null. But I still don't understand why the object reference are the same in both cases.

Concrete5 Community Store (Square) not processing payment as an integer

This error is occurring each time I try to put a payment through.
Log shows:
JSON from response body:
{"errors":[{"category":"INVALID_REQUEST_ERROR","code":"EXPECTED_INTEGER","detail":"Expected
an integer value.","field":"amount_money.amount"}]}
I modified line 123 of CommunityStoreSquarePaymentMethod.php from:
"amount" => StoreCalculator::getGrandTotal()*100,
to:
"amount" => number_format(StoreCalculator::getGrandTotal()*100,'',''),
This gave me the error:
Exception Occurred:
/public_html/packages/community_store_square/src/CommunityStore/Payment/Methods/CommunityStoreSquare/CommunityStoreSquarePaymentMethod.php:123
number_format() expects parameter 2 to be integer, string given (2)
So it looks like it's being read as a string instead of an integer. What's the best way to rectify this? I've tried set_type but not sure I understand how to use it as it returns a boolean.

Unparsable MOF Query When Trying to Register Event

Update 2
I accepted an answer and asked a different question elsewhere, where I am still trying to get to the bottom of this.
I don't think that one-lining this query is the answer, as I am still not getting the required results (and multi-lining queries is allowed in .mof, as shown in the URLs in comments to the answer ...
Update
I rewrote the query as a one-liner as suggested, but still got the same error! As it was still talking about lines 11-19 I knew there must be another issue. After saving a new file with the change, I reran mofcomp and it appears to have loaded, but the event which I have subscribed to simply does not work.
I really feel that there is not enough documentation on this topic and it is hard to work out how I am meant to debug this - any help on this would be much appreciated, even if this means using a different more appropriate method.
I have the following .mof file, which I would like to use to register an event on my system :
#pragma namespace("\\\\.\\root\\subscription")
instance of __EventFilter as $EventFilter
{
Name = "Event Filter Instance Name";
Query = "Select * from __InstanceCreationEvent within 1 "
"where targetInstance isa \"Cim_DirectoryContainsFile\" "
"and targetInstance.GroupComponent = \"Win32_Directory.Name=\"c:\\\\test\"\"";
QueryLanguage = "WQL";
EventNamespace = "Root\\Cimv2";
};
instance of ActiveScriptEventConsumer as $Consumer
{
Name = "TestConsumer";
ScriptingEngine = "VBScript";
ScriptText =
"Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n"
"Set objFile = objFSO.OpenTextFile(\"c:\\test\\Log.txt\", 8, True)\n"
"objFile.WriteLine Time & \" \" & \" File Created\"\n"
"objFile.Close\n";
// Specify any other relevant properties.
};
instance of __FilterToConsumerBinding
{
Filter = $EventFilter;
Consumer = $Consumer;
};
But whenever I run the command mfcomp myfile.mof I am getting this error:
Parsing MOF file: myfile.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while processing item 1 defined on lines 11 - 19 in file myfile.mof:
Error Number: 0x80041058, Facility: WMI
Description: Unparsable query.
Compiler returned error 0x80041058
This error appears to be caused by incorrect syntax in the query, but I don't understand where I have gone wrong with this - is anyone able to advise?
There are no string concatenation or line continuation characters being used in building "Query". To keep it simple, you could put the entire query on one line.

rest-assured expected doesn't match

I try
#Test
public void testGetSingleUser() {
given().expect().
statusCode(200).contentType(ContentType.JSON).
body("_testingString", equalTo("got it")).when().
get("http://localhost:8080/getIt");
}
But always got this error message
java.lang.AssertionError : JSON path _testingString dosen't match.
Expected : "got it" got : [got it]
how to ignore "" and [] problem
Thanks
Note: This is untested code snippet but while looking at your error trace it may help you.
try
equalTo(Arrays.asList("got it"))
instead of
equalTo("got it")
When you receive a error saying, same like that:
JSON path total doesn't match.
Expected: 2000
Actual: <[2000]>
It means that your result(Actual:) is coming inside an array.
Hence, you should use a rest-assured-command(for example, hasItem) that verifies values 'inside an array'.
My code below illustrate a solution for this situation:
RestAssuredWebTestClient
.given()
.webTestClient(mockedWebClient)
.queryParam("cost", 1000)
.when()
.get(TEMPL_AGGREG_DATE)
.then()
.log()
.everything()
.statusCode(OK.value())
.body("_id", hasItem(project2.getStartDate()))
.body("total", hasItem((int)project2.getEstimatedCost()))
.body(matchesJsonSchemaInClasspath("contracts/aggregations/CostsGroupByStartDate.json"))
;